DGtal
1.4.2
|
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an array containing the coordinates - (0, 1, ..., j-1) by default - that are copied from P to Q. More...
#include <DGtal/kernel/BasicPointFunctors.h>
Public Types | |
typedef S | Space |
typedef Space::Dimension | Dimension |
typedef Space::Integer | Integer |
typedef Space::Point | Point |
Public Member Functions | |
BOOST_STATIC_CONSTANT (Dimension, dimension=Space::dimension) | |
Projector (const Integer &aDefaultInteger=NumberTraits< Integer >::zero()) | |
template<typename TIterator > | |
void | init (const TIterator &itb, const TIterator &ite) |
void | initRemoveOneDim (const Dimension &dimRemoved) |
void | initAddOneDim (const Dimension &newDim) |
template<typename TInputPoint > | |
Point | operator() (const TInputPoint &aPoint) const |
Private Attributes | |
std::array< Dimension, dimension > | myDims |
Integer | myDefaultInteger |
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an array containing the coordinates - (0, 1, ..., j-1) by default - that are copied from P to Q.
Description of template class 'Projector'
Ex: for i = 3 and j = 2, the first two coordinates (numbered 0 and 1) are copied so that point (x,y,z) is is mapped to point (x,y).
All kth coordinates (0 < k < j) that are greater than i, are set to a value given at construction (0 by defaut).
Ex: for i = 2 and j = 3, the first two coordinates (numbered 0 and 1) are copied so that point (x,y) is is mapped to point (x,y,0).
Instead of using the default order, you can define your own orthonormal basis as shown below:
S | type for the space where must lie the projected point |
Definition at line 106 of file BasicPointFunctors.h.
typedef Space::Dimension DGtal::functors::Projector< S >::Dimension |
Definition at line 109 of file BasicPointFunctors.h.
typedef Space::Integer DGtal::functors::Projector< S >::Integer |
Definition at line 111 of file BasicPointFunctors.h.
typedef Space::Point DGtal::functors::Projector< S >::Point |
Definition at line 112 of file BasicPointFunctors.h.
typedef S DGtal::functors::Projector< S >::Space |
Definition at line 108 of file BasicPointFunctors.h.
DGtal::functors::Projector< S >::Projector | ( | const Integer & | aDefaultInteger = NumberTraits< Integer >::zero() | ) |
Default constructor
DGtal::functors::Projector< S >::BOOST_STATIC_CONSTANT | ( | Dimension | , |
dimension | = Space::dimension |
||
) |
void DGtal::functors::Projector< S >::init | ( | const TIterator & | itb, |
const TIterator & | ite | ||
) |
Initialization of the array of relevant dimensions
itb | begin iterator on dimensions. |
ite | end iterator on dimensions. |
Referenced by testProjector().
void DGtal::functors::Projector< S >::initAddOneDim | ( | const Dimension & | newDim | ) |
Initialisation by adding a given dimension.
newDim | the new dimension. |
Referenced by main(), and testSliceImageFromFunctor().
void DGtal::functors::Projector< S >::initRemoveOneDim | ( | const Dimension & | dimRemoved | ) |
Initialisation by removing a given dimension.
dimRemoved | the removed dimension. |
Referenced by main(), and testSliceImageFromFunctor().
Point DGtal::functors::Projector< S >::operator() | ( | const TInputPoint & | aPoint | ) | const |
Main operator
aPoint | any point. |
|
private |
Default integer set to coordinates of the projected point not in the input point
Definition at line 161 of file BasicPointFunctors.h.
|
private |
Array storing the coordinates that are copied from the input point to its projection (order matters)
Definition at line 155 of file BasicPointFunctors.h.