Patate Lib  0.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Grenaille::Concept::PointConcept Class Reference

Detailed Description

Definition of a point sample.

All fitting methods in Grenaille rely on the definition of a Point type. Specific features might be required depending on the content of the Basket: for instance, an OrientedSphereFit will require points equipped with normals as illustrated in the User Manual.

Grenaille does not provide an implementation for this concept so that users may adapt it to their own data structure. However, the following implementation can be used as a starting point for most 3D applications:

class MyPoint{
enum {Dim = 3};
typedef float Scalar;
typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
MULTIARCH inline MyPoint(const VectorType &pos = VectorType::Zero())
: _pos(pos) {}
MULTIARCH inline const VectorType& pos() const { return _pos; }
MULTIARCH inline VectorType& pos() { return _pos; }
VectorType _pos;

Public Types

enum  { Dim = 3 }
 Defines the ambient space dimension, 3 in this example.
typedef float Scalar
 Defines the type used ton encode scalar values.
typedef Eigen::Matrix< Scalar,
Dim, 1 > 
 Defines type used ton encode vector values.

Public Member Functions

 PointConcept ()
 Default constructor.
const VectorTypepos () const
 Read access to the position property.
VectorTypepos ()
 Write access to the position property.