[Go back to user manual]
Ponca is designed to be lightweight and easy to integrate in existing code bases. To achieve this goal:
- Ponca does not include datastructures to represent and store point cloud data, and let clients defining how to store and access data,
- Ponca cannot rely on C++ polymorphism to define its API: most computational objects used through the library involve very small computation. Combining these computation using polymorphism requires to use virtual functions, which introduce a very high overhead (considering the small computation of each class).
- Instead, Ponca is based on 'Concepts' that need to be followed to use/extend the library.
Hence, we expect client code to define how point data can be accessed, by respecting the following interface:
class PointConcept {
public:
enum {
Dim = 3
};
typedef float Scalar;
typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
PONCA_MULTIARCH inline PointConcept();
PONCA_MULTIARCH inline const VectorType& pos() const;
PONCA_MULTIARCH inline VectorType& pos();
};
This represents the minimal API required to use Ponca:
- an integer
Dim
defining the number of dimensions of the ambient space (3 for 3d point clouds)
- types
Scalar
and VectorType
that will be used by the library to represent scalars and vectors
- a default constructor
- read and read/write access to an attribute describing the position of a point (
pos()
)
Depending on the use cases, other types (e.g. MatrixType
) or accessors (normal()
) might be required.
- See also
- Example Ponca data-structure binding, that demonstrate how to implement
PointConcept
in order to access point data in existing arrays without duplication.
See concepts used in each modules:
[Go back to user manual]