DGtal  1.2.0
Public Types | Public Member Functions | Data Fields
DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform Struct Reference

#include <DGtal/geometry/surfaces/COBAGenericStandardPlaneComputer.h>

Public Types

typedef Point Value
 
typedef Point value_type
 

Public Member Functions

 Transform ()
 
 Transform (bool posX, bool posY)
 
Point operator() (const Point &p) const
 
bool isPlusZOnX () const
 
bool isPlusZOnY () const
 
Point inverse (const Point &p) const
 
template<typename Vector3D >
void transformBack (Vector3D &v)
 
template<typename Vector3D >
void transform (Vector3D &v)
 

Data Fields

bool _posX
 
bool _posY
 

Detailed Description

template<typename TSpace, typename TInternalInteger>
struct DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform

This type is used to cast points from \((x,y,z)\) to \((x \pm z,y \pm z,z)\) and inversely. This is used when recognize a standard plane. Indeed, we only know how to recognize naive planes. So we dilate points of standard planes with this transform so that the standard plane becomes naive. Otherwise said, if \(T_{\pm,\pm}: (x,y,z) \mapsto (x \pm z,y \pm z,z)\), then P is a standard plane iff one of \(T_{+,+}(P), T_{+,-}(P), T_{-,+}(P), T_{-,-}(P)\) is a naive plane of main axis z.

Definition at line 167 of file COBAGenericStandardPlaneComputer.h.

Member Typedef Documentation

◆ Value

template<typename TSpace , typename TInternalInteger >
typedef Point DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::Value

Definition at line 168 of file COBAGenericStandardPlaneComputer.h.

◆ value_type

template<typename TSpace , typename TInternalInteger >
typedef Point DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::value_type

Definition at line 169 of file COBAGenericStandardPlaneComputer.h.

Constructor & Destructor Documentation

◆ Transform() [1/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::Transform ( )
inline

Definition at line 172 of file COBAGenericStandardPlaneComputer.h.

172 {}

◆ Transform() [2/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::Transform ( bool  posX,
bool  posY 
)
inline

Member Function Documentation

◆ inverse()

template<typename TSpace , typename TInternalInteger >
Point DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::inverse ( const Point p) const
inline

Definition at line 186 of file COBAGenericStandardPlaneComputer.h.

187  {
188  if ( _posX ) {
189  if ( _posY ) return Point( p[ 0 ] - p[ 2 ], p[ 1 ] - p[ 2 ], p[ 2 ] );
190  else return Point( p[ 0 ] - p[ 2 ], p[ 1 ] + p[ 2 ], p[ 2 ] );
191  } else {
192  if ( _posY ) return Point( p[ 0 ] + p[ 2 ], p[ 1 ] - p[ 2 ], p[ 2 ] );
193  else return Point( p[ 0 ] + p[ 2 ], p[ 1 ] + p[ 2 ], p[ 2 ] );
194  }
195  }

References DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posX, and DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posY.

◆ isPlusZOnX()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::isPlusZOnX ( ) const
inline

◆ isPlusZOnY()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::isPlusZOnY ( ) const
inline

◆ operator()()

template<typename TSpace , typename TInternalInteger >
Point DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::operator() ( const Point p) const
inline

Definition at line 174 of file COBAGenericStandardPlaneComputer.h.

175  {
176  if ( _posX ) {
177  if ( _posY ) return Point( p[ 0 ] + p[ 2 ], p[ 1 ] + p[ 2 ], p[ 2 ] );
178  else return Point( p[ 0 ] + p[ 2 ], p[ 1 ] - p[ 2 ], p[ 2 ] );
179  } else {
180  if ( _posY ) return Point( p[ 0 ] - p[ 2 ], p[ 1 ] + p[ 2 ], p[ 2 ] );
181  else return Point( p[ 0 ] - p[ 2 ], p[ 1 ] - p[ 2 ], p[ 2 ] );
182  }
183  }

References DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posX, and DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posY.

◆ transform()

template<typename TSpace , typename TInternalInteger >
template<typename Vector3D >
void DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::transform ( Vector3D &  v)
inline

Definition at line 205 of file COBAGenericStandardPlaneComputer.h.

206  {
207  if ( _posX ) v[ 2 ] -= v[ 0 ];
208  else v[ 2 ] += v[ 0 ];
209  if ( _posY ) v[ 2 ] -= v[ 1 ];
210  else v[ 2 ] += v[ 1 ];
211  }

References DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posX, and DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posY.

◆ transformBack()

template<typename TSpace , typename TInternalInteger >
template<typename Vector3D >
void DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::transformBack ( Vector3D &  v)
inline

Definition at line 197 of file COBAGenericStandardPlaneComputer.h.

198  {
199  if ( _posX ) v[ 2 ] += v[ 0 ];
200  else v[ 2 ] -= v[ 0 ];
201  if ( _posY ) v[ 2 ] += v[ 1 ];
202  else v[ 2 ] -= v[ 1 ];
203  }

References DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posX, and DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posY.

Field Documentation

◆ _posX

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posX

◆ _posY

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericStandardPlaneComputer< TSpace, TInternalInteger >::Transform::_posY

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