DGtal  1.5.beta
DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 26, 1 > Struct Template Reference

#include <DGtal/shapes/IntersectionTarget.h>

Public Member Functions

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

Data Fields

const std::array< Edge, 4 > myTarget
 Target. More...
 
std::array< VectorR3, 4 > myE1base
 E1 base for each target's edge. More...
 
std::array< VectorR3, 4 > myE2base
 E2 base for each target's edge. More...
 

Detailed Description

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

Specialization for 26-separated with 1D intersection target

Definition at line 150 of file IntersectionTarget.h.

Constructor & Destructor Documentation

◆ IntersectionTarget()

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 26, 1 >::IntersectionTarget ( )
inline

Default constructor

Definition at line 166 of file IntersectionTarget.h.

172  {
173  const double coef = 1. / std::sqrt(3.);
174 
175  std::array<VectorR3, 4> myNormal {{
176  { coef, -coef, -coef } ,
177  { -coef, -coef, -coef } ,
178  { -coef, -coef, coef } ,
179  { coef, -coef, coef }
180  }};
181 
182  // computation of each e1/e2 bases foreach normal
183  for(int i = 0; i < 4; i++)
184  {
185  auto& x = myNormal[i][0];
186  auto& y = myNormal[i][1];
187  auto& z = myNormal[i][2];
188 
189  myE1base[i] = std::move( VectorR3(-y, x, 0).getNormalized() );
190  myE2base[i] = std::move( VectorR3(-x*z, -y*z, x*x + y*y).getNormalized() );
191  }
192  }
std::array< VectorR3, 4 > myE1base
E1 base for each target's edge.
std::array< VectorR3, 4 > myE2base
E2 base for each target's edge.
typename TSpace::RealPoint VectorR3

Member Function Documentation

◆ operator()() [1/2]

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

Get definition of the target

Returns
intersection target

Definition at line 200 of file IntersectionTarget.h.

200  {
201  return myTarget;
202  }

◆ 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, 26, 1 >::operator() ( int  i) const
inline

Get edge of index i

Parameters
iindex
Returns
intersection target

Definition at line 209 of file IntersectionTarget.h.

209  {
210  return myTarget[i];
211  }

◆ project()

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
PointR2 DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 26, 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 219 of file IntersectionTarget.h.

219  {
220  ASSERT( 0 <= i && i <= 3 );
221 
222  return { myE1base[i].dot(p), myE2base[i].dot(p) };
223  }

Field Documentation

◆ myE1base

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
std::array<VectorR3, 4> DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 26, 1 >::myE1base

E1 base for each target's edge.

Definition at line 163 of file IntersectionTarget.h.

◆ myE2base

template<typename TSpace , size_t TSeparation, size_t TDimension = 1>
template<typename Space >
std::array<VectorR3, 4> DGtal::IntersectionTargetTrait< TSpace, TSeparation, TDimension >::IntersectionTarget< Space, 26, 1 >::myE2base

E2 base for each target's edge.

Definition at line 166 of file IntersectionTarget.h.

◆ myTarget

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

Target.

Definition at line 155 of file IntersectionTarget.h.


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