DGtal  0.9.3beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::Projector< S > Struct Template Reference

#include <DGtal/kernel/BasicPointFunctors.h>

Inheritance diagram for DGtal::functors::Projector< S >:
[legend]
Collaboration diagram for DGtal::functors::Projector< S >:
[legend]

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
 

Detailed Description

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
struct DGtal::functors::Projector< S >

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:

PointVector<3,int> p(3,1,5):
Projector<SpaceND<2,int> > proj;
proj( p ) //== (3,1)
...
//v (2, 0): selection of the 2nd and 0th basis vectors
proj.init(v.begin(), v.end());
proj( p ) //== (5,3)
Template Parameters
Stype for the space where must lie the projected point
Examples:
images/extract2DImagesFrom3DandVisu.cpp, images/extract2DSlicesImagesFrom3D.cpp, io/viewers/viewer3D-8-2DSliceImages.cpp, and tutorial-examples/2DSliceImageFromVol.cpp.

Definition at line 104 of file BasicPointFunctors.h.

Member Typedef Documentation

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
typedef Space::Dimension DGtal::functors::Projector< S >::Dimension

Definition at line 107 of file BasicPointFunctors.h.

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
typedef Space::Integer DGtal::functors::Projector< S >::Integer

Definition at line 109 of file BasicPointFunctors.h.

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
typedef Space::Point DGtal::functors::Projector< S >::Point

Definition at line 110 of file BasicPointFunctors.h.

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
typedef S DGtal::functors::Projector< S >::Space

Definition at line 106 of file BasicPointFunctors.h.

Constructor & Destructor Documentation

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
DGtal::functors::Projector< S >::Projector ( const Integer aDefaultInteger = NumberTraitsInteger >::zero())

Default constructor

Member Function Documentation

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
DGtal::functors::Projector< S >::BOOST_STATIC_CONSTANT ( Dimension  ,
dimension  = Space::dimension 
)
template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
template<typename TIterator >
void DGtal::functors::Projector< S >::init ( const TIterator &  itb,
const TIterator &  ite 
)

Initialization of the array of relevant dimensions

Parameters
itbbegin iterator on dimensions.
iteend iterator on dimensions.
template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
void DGtal::functors::Projector< S >::initAddOneDim ( const Dimension newDim)

Initialisation by adding a given dimension.

Parameters
newDimthe new dimension.
template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
void DGtal::functors::Projector< S >::initRemoveOneDim ( const Dimension dimRemoved)

Initialisation by removing a given dimension.

Parameters
dimRemovedthe removed dimension.
template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
template<typename TInputPoint >
Point DGtal::functors::Projector< S >::operator() ( const TInputPoint &  aPoint) const

Main operator

Parameters
aPointany point.
Returns
the projected point.

Field Documentation

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
Integer DGtal::functors::Projector< S >::myDefaultInteger
private

Default integer set to coordinates of the projected point not in the input point

Definition at line 159 of file BasicPointFunctors.h.

template<typename S = SpaceND< 2, DGtal::Z2i::Integer >>
std::array<Dimension, dimension> DGtal::functors::Projector< S >::myDims
private

Array storing the coordinates that are copied from the input point to its projection (order matters)

Definition at line 153 of file BasicPointFunctors.h.


The documentation for this struct was generated from the following file: