DGtal  1.1.0
DGtal::functors::FlipDomainAxis< TDomain > Class Template Reference

Aim: Functor that flips the domain coordinate system from some selected axis. For instance, if a flip on the y axis is applied on a domain of bounds (0, 0, 0) (MaxX, MaxY, MaxZ), then the coordinate of P(x,y,z) will transformed in P(x, MaxY-y, z). More...

#include <DGtal/kernel/BasicPointFunctors.h>

Collaboration diagram for DGtal::functors::FlipDomainAxis< TDomain >:
[legend]

## Public Types

typedef TDomain::Space Space

typedef TDomain::Size Size

typedef Space::Dimension Dimension

typedef Space::Point Point

## Public Member Functions

FlipDomainAxis (const TDomain &aSourceDomain, const std::vector< Size > &axisFlipped)

Point operator() (const Point &aPoint) const

## Private Attributes

TDomain mySourceDomain

std::vector< SizemyAxisFlipped

## Detailed Description

### template<typename TDomain> class DGtal::functors::FlipDomainAxis< TDomain >

Aim: Functor that flips the domain coordinate system from some selected axis. For instance, if a flip on the y axis is applied on a domain of bounds (0, 0, 0) (MaxX, MaxY, MaxZ), then the coordinate of P(x,y,z) will transformed in P(x, MaxY-y, z).

Description of template class 'FlipDomainAxis'

Such functor can be useful to apply basic image flip from some specific axis directions.

tests/kernel/testBasicPointFunctors.cpp
Template Parameters
 TDomain the type of the domain.

Definition at line 711 of file BasicPointFunctors.h.

## ◆ Dimension

template<typename TDomain >
 typedef Space::Dimension DGtal::functors::FlipDomainAxis< TDomain >::Dimension

Definition at line 716 of file BasicPointFunctors.h.

## ◆ Point

template<typename TDomain >
 typedef Space::Point DGtal::functors::FlipDomainAxis< TDomain >::Point

Definition at line 717 of file BasicPointFunctors.h.

## ◆ Size

template<typename TDomain >
 typedef TDomain::Size DGtal::functors::FlipDomainAxis< TDomain >::Size

Definition at line 715 of file BasicPointFunctors.h.

## ◆ Space

template<typename TDomain >
 typedef TDomain::Space DGtal::functors::FlipDomainAxis< TDomain >::Space

Definition at line 714 of file BasicPointFunctors.h.

## ◆ FlipDomainAxis()

template<typename TDomain >
 DGtal::functors::FlipDomainAxis< TDomain >::FlipDomainAxis ( const TDomain & aSourceDomain, const std::vector< Size > & axisFlipped )
inline

Constructor. Construct the functor from a source domain and a vector defining the axis being flipped. Such a vector should contain the dimension number associated to the axis to be flipped. For instance to flip the x and z axis of a given 3d domain you have to give a vector containing 1 and 2.

Parameters
 aSourceDomain the source domain. axisFlipped a vector containing the indices of the dimension to be flipped.

Definition at line 731 of file BasicPointFunctors.h.

731  : mySourceDomain(aSourceDomain),
732  myAxisFlipped(axisFlipped){
733  };

## ◆ operator()()

template<typename TDomain >
 Point DGtal::functors::FlipDomainAxis< TDomain >::operator() ( const Point & aPoint ) const
inline

The operator computes the coordinates of the point in the flipped domain.

Parameters
 aPoint a source point.
Returns
the point with flipped coordinates according the source domain.

Definition at line 746 of file BasicPointFunctors.h.

747  {
748  Point ptRes;
749  for (Dimension dim=0; dim< Space::dimension; dim++){
750  ptRes[dim] = aPoint[dim];
751  }
752  for(Dimension i = 0; i< myAxisFlipped.size(); i++){
753  ptRes[myAxisFlipped[i]] = mySourceDomain.upperBound()[myAxisFlipped[i]]-aPoint[myAxisFlipped[i]];
754  }
755  return ptRes;
756  }

## ◆ myAxisFlipped

template<typename TDomain >
 std::vector DGtal::functors::FlipDomainAxis< TDomain >::myAxisFlipped
private

## ◆ mySourceDomain

template<typename TDomain >
 TDomain DGtal::functors::FlipDomainAxis< TDomain >::mySourceDomain
private

The documentation for this class was generated from the following file:
DGtal::functors::FlipDomainAxis::Dimension
Space::Dimension Dimension
Definition: BasicPointFunctors.h:716
aPoint
const Point aPoint(3, 4)
dim
unsigned int dim(const Vector &z)
Definition: viewDualSurface.cpp:174
DGtal::functors::FlipDomainAxis::mySourceDomain
TDomain mySourceDomain
Definition: BasicPointFunctors.h:759
DGtal::functors::FlipDomainAxis::myAxisFlipped
std::vector< Size > myAxisFlipped
Definition: BasicPointFunctors.h:760
DGtal::SpaceND::dimension
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132
Point
MyPointD Point
Definition: testClone2.cpp:383