DGtal  1.1.0
LambdaMST3DBy2D.h
1 
17 #pragma once
18 
29 #if defined(LAMBDAMST3DBy2D_RECURSES)
30 #error Recursive header files inclusion detected in LambdaMST3DBy2D.h
31 #else // defined(LAMBDAMST3DBy2D_RECURSES)
32 
33 #define LAMBDAMST3DBy2D_RECURSES
34 
35 #if !defined LAMBDAMST3DBy2D_h
36 
37 #define LAMBDAMST3DBy2D_h
38 
39 #include <algorithm>
40 #include <cmath>
41 #include <list>
42 #include <iterator>
43 #include <DGtal/base/Common.h>
44 #include <DGtal/helpers/StdDefs.h>
45 #include "DGtal/kernel/CSpace.h"
46 #include "DGtal/kernel/PointVector.h"
47 #include "DGtal/kernel/BasicPointFunctors.h"
48 #include "DGtal/geometry/curves/estimation/LambdaMST2D.h"
49 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
50 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
51 
52 namespace DGtal {
61  template < typename Iterator3D, typename Functor, typename LambdaFunctor, int CONNECTIVITY = 8 >
63  {
64  public:
65  // ----------------------- Types ------------------------------
66  public:
71  typedef std::vector < Point2D > TCurve2D;
74  typedef typename Functor::MAIN_AXIS MAIN_AXIS;
75 
76  // ----------------------- Private types ------------------------------
77  private:
80 
81  // ----------------------- Standard services ------------------------------
82  public:
84 
91  void init ( Iterator3D itB, Iterator3D itE, MAIN_AXIS axis );
92 
97  bool isValid ( ) const;
98 
103  RealVector3D eval ( const Point3D & point );
104 
114  template <typename OutputIterator>
115  OutputIterator eval ( Iterator3D itb, Iterator3D ite, OutputIterator result );
116 
117  // ------------------------- Internals ------------------------------------
118  protected:
119 
120  RealVector2D Estimate2DTangent ( TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, const Point2D & point );
121  template < typename OutputIterator >
122  OutputIterator Estimate2DTangent ( TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, OutputIterator result );
123 
124  // ------------------------- Private Datas --------------------------------
125  private:
126  Iterator3D myBegin;
127  Iterator3D myEnd;
133  }; // end of class LambdaMST3DBy2DEstimator
134 
135 
137  {
138  public:
139  // ----------------------- Types ------------------------------
142  enum MAIN_AXIS {X = 0, Y = 1, Z = 2};
143 
144  // ----------------------- Interface --------------------------------------
145  Vector3D operator() ( MAIN_AXIS mainAxis, const Vector2D & v0, const Vector2D & v1 ) const;
146  };
147 
148  //-------------------------------------------------------------------------------------------
149 
150  // Template class LambdaMST3D
155  template <
156  typename Iterator3D, typename LambdaFunctor = functors::Lambda64Function, int CONNECTIVITY = 8 >
158  public LambdaMST3DBy2DEstimator < Iterator3D, TangentFromDSS3DBy2DFunctor, LambdaFunctor, CONNECTIVITY >
159  {
161 
162  public:
167  };
168 }// namespace DGtal
169 
171 // Includes inline functions
172 #include "DGtal/geometry/curves/estimation/LambdaMST3DBy2D.ih"
173 
174 // //
176 
177 #endif // !defined LAMBDAMST3DBy2D_h
178 
179 #undef LAMBDAMST3DBy2D_RECURSES
180 #endif // else defined(LAMBDAMST3DBy2D_RECURSES)
DGtal::LambdaMST3DBy2DEstimator::RealVector3D
PointVector< 3, double > RealVector3D
Definition: LambdaMST3DBy2D.h:67
DGtal::LambdaMST3DBy2DEstimator
Definition: LambdaMST3DBy2D.h:63
DGtal::LambdaMST2D
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST2D.h:170
DGtal::functors::Projector
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
Definition: BasicPointFunctors.h:107
DGtal::LambdaMST3DBy2DEstimator::tXZ
TCurve2D tXZ
Definition: LambdaMST3DBy2D.h:130
DGtal::LambdaMST3DBy2DEstimator::LambdaMST3DBy2DEstimator
LambdaMST3DBy2DEstimator()
DGtal::ArithmeticalDSSComputer
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Definition: ArithmeticalDSSComputer.h:87
DGtal::LambdaMST3DBy2DEstimator::myProjXZ
Projector2d myProjXZ
Definition: LambdaMST3DBy2D.h:132
DGtal::LambdaMST3DBy2D::Super
LambdaMST3DBy2DEstimator< Iterator3D, TangentFromDSS3DBy2DFunctor, LambdaFunctor, CONNECTIVITY > Super
Definition: LambdaMST3DBy2D.h:160
DGtal::LambdaMST3DBy2DEstimator::Segmentation2D
SaturatedSegmentation< SegmentComputer2D > Segmentation2D
Definition: LambdaMST3DBy2D.h:73
DGtal::LambdaMST3DBy2DEstimator::init
void init(Iterator3D itB, Iterator3D itE, MAIN_AXIS axis)
DGtal::LambdaMST3DBy2DEstimator::eval
OutputIterator eval(Iterator3D itb, Iterator3D ite, OutputIterator result)
Functor
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
Definition: testConvexHull2DReverse.cpp:51
DGtal::LambdaMST3DBy2DEstimator::Estimate2DTangent
OutputIterator Estimate2DTangent(TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, OutputIterator result)
DGtal::LambdaMST3DBy2DEstimator::myBegin
Iterator3D myBegin
Definition: LambdaMST3DBy2D.h:126
DGtal::TangentFromDSS3DBy2DFunctor::Y
@ Y
Definition: LambdaMST3DBy2D.h:142
DGtal::LambdaMST3DBy2DEstimator::MAIN_AXIS
Functor::MAIN_AXIS MAIN_AXIS
Definition: LambdaMST3DBy2D.h:74
DGtal::LambdaMST3DBy2DEstimator::TCurve2D
std::vector< Point2D > TCurve2D
Definition: LambdaMST3DBy2D.h:71
DGtal::LambdaMST3DBy2DEstimator::SegmentComputer2D
ArithmeticalDSSComputer< typename TCurve2D::const_iterator, int, CONNECTIVITY > SegmentComputer2D
Definition: LambdaMST3DBy2D.h:72
DGtal::LambdaMST3DBy2DEstimator::RealVector2D
PointVector< 2, double > RealVector2D
Definition: LambdaMST3DBy2D.h:70
DGtal::TangentFromDSS3DBy2DFunctor::Vector2D
PointVector< 2, double > Vector2D
Definition: LambdaMST3DBy2D.h:141
DGtal::TangentFromDSS3DBy2DFunctor
Definition: LambdaMST3DBy2D.h:137
DGtal::LambdaMST3DBy2DEstimator::Projector2d
functors::Projector< SpaceND< 2, int > > Projector2d
Definition: LambdaMST3DBy2D.h:79
DGtal::LambdaMST3DBy2DEstimator::myEnd
Iterator3D myEnd
Definition: LambdaMST3DBy2D.h:127
DGtal::LambdaMST3DBy2DEstimator::tYZ
TCurve2D tYZ
Definition: LambdaMST3DBy2D.h:130
DGtal::LambdaMST3DBy2DEstimator::Point3D
PointVector< 3, int > Point3D
Definition: LambdaMST3DBy2D.h:68
DGtal::functors::Lambda64Function
Definition: FunctorsLambdaMST.h:69
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::TangentFromDSS3DBy2DFunctor::X
@ X
Definition: LambdaMST3DBy2D.h:142
DGtal::TangentFromDSS3DBy2DFunctor::MAIN_AXIS
MAIN_AXIS
Definition: LambdaMST3DBy2D.h:142
DGtal::LambdaMST3DBy2DEstimator::myProjXY
Projector2d myProjXY
projectors
Definition: LambdaMST3DBy2D.h:132
DGtal::LambdaMST3DBy2DEstimator::myFunctor
Functor myFunctor
Definition: LambdaMST3DBy2D.h:128
DGtal::LambdaMST3DBy2D
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST3DBy2D.h:159
DGtal::LambdaMST3DBy2DEstimator::Point2D
PointVector< 2, int > Point2D
Definition: LambdaMST3DBy2D.h:69
DGtal::LambdaMST3DBy2DEstimator::Estimate2DTangent
RealVector2D Estimate2DTangent(TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, const Point2D &point)
DGtal::TangentFromDSS3DBy2DFunctor::Vector3D
PointVector< 3, double > Vector3D
Definition: LambdaMST3DBy2D.h:140
DGtal::LambdaMST3DBy2DEstimator::myProjYZ
Projector2d myProjYZ
Definition: LambdaMST3DBy2D.h:132
DGtal::LambdaMST3DBy2DEstimator::isValid
bool isValid() const
DGtal::TangentFromDSS3DBy2DFunctor::Z
@ Z
Definition: LambdaMST3DBy2D.h:142
DGtal::PointVector< 3, double >
DGtal::TangentFromDSS3DBy2DFunctor::operator()
Vector3D operator()(MAIN_AXIS mainAxis, const Vector2D &v0, const Vector2D &v1) const
DGtal::LambdaMST3DBy2DEstimator::eval
RealVector3D eval(const Point3D &point)
DGtal::SaturatedSegmentation
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
Definition: SaturatedSegmentation.h:154
DGtal::LambdaMST3DBy2DEstimator::myAxis
MAIN_AXIS myAxis
Definition: LambdaMST3DBy2D.h:129
DGtal::LambdaMST3DBy2DEstimator::TEstimator
LambdaMST2D< Segmentation2D, LambdaFunctor > TEstimator
Definition: LambdaMST3DBy2D.h:78
DGtal::LambdaMST3DBy2DEstimator::tXY
TCurve2D tXY
Definition: LambdaMST3DBy2D.h:130
DGtal::LambdaMST3DBy2D::LambdaMST3DBy2D
LambdaMST3DBy2D()
Definition: LambdaMST3DBy2D.h:166