Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca Concepts
[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:
/* \brief Defines the ambient space dimension, 3 in this example */
enum {
Dim = 3
};
// \brief Defines the type used ton encode scalar values
typedef float Scalar;
// \brief Defines type used ton encode vector values
typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
// \brief Default constructor
PONCA_MULTIARCH inline PointConcept();
// \brief Read access to the position property
// \note The return type should have the same API than VectorType (e.g. const Eigen::Map< const VectorType >&),
// or be implicitly convertible to VectorType
PONCA_MULTIARCH inline const VectorType& pos() const;
// \brief Write access to the position property
// \note Same constraints on return type
PONCA_MULTIARCH inline VectorType& pos();
}; //class PointConcept

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]