DGtal  1.2.0
Public Member Functions | Data Fields
DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 > Struct Template Reference

#include <DGtal/shapes/IntersectionTarget.h>

Public Member Functions

const std::array< Edge, 3 > & operator() ()
 
const Edgeoperator() (int i)
 
PointR2 project (int i, const PointR3 &p) const
 

Data Fields

const std::array< Edge, 3 > myTarget
 Target. More...
 

Detailed Description

template<typename TSpace, size_t TSeparation, size_t TDimension = 1>
template<typename Space>
struct DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 >

Specialization for 6-separated with 1D intersection target

Definition at line 98 of file IntersectionTarget.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
const std::array<Edge, 3>& DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 >::operator() ( )
inline

Get definition of the target

Returns
intersection target

Definition at line 115 of file IntersectionTarget.h.

115  {
116  return myTarget;
117  }

◆ operator()() [2/2]

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
const Edge& DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 >::operator() ( int  i)
inline

Get edge of index i

Parameters
iindex
Returns
intersection target

Definition at line 124 of file IntersectionTarget.h.

124  {
125  return myTarget[i];
126  }

◆ project()

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
PointR2 DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 >::project ( int  i,
const PointR3 p 
) const
inline

2D Projection of 3D point on plane with normal represented by edge of index i

Parameters
iindex of target's edge representing the normal of the plane for the projection
p3d point
Returns
2d point

Definition at line 134 of file IntersectionTarget.h.

134  {
135  ASSERT( 0 <= i && i <= 2 );
136 
137  if(myTarget[i].myFirst[0] == 0.5)
138  return { p[1], p[2] }; // ignore x
139  else if(myTarget[i].myFirst[1] == 0.5)
140  return { p[0], p[2] }; // ignore y
141  else
142  return { p[0], p[1] }; // ignore z
143  }

Field Documentation

◆ myTarget

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
const std::array<Edge, 3> DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 6, 1 >::myTarget
Initial value:
{{
{ { 0.5, 0.0, 0.0 }, { -0.5, 0.0, 0.0} } ,
{ { 0.0, 0.0, 0.5 }, { 0.0, 0.0, -0.5} } ,
{ { 0.0, 0.5, 0.0 }, { 0.0, -0.5, 0.0} }
}}

Target.

Definition at line 103 of file IntersectionTarget.h.


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