DGtal  1.5.beta
testLambdaMST3DBy2D.cpp
1 
31 #include <iostream>
32 #include <fstream>
33 #include <vector>
34 #include <iterator>
35 #include "DGtalCatch.h"
36 #include "DGtal/base/Common.h"
37 #include "DGtal/helpers/StdDefs.h"
38 #include "DGtal/geometry/curves/estimation/LambdaMST3DBy2D.h"
39 
41 
42 using namespace std;
43 using namespace DGtal;
44 using namespace Z3i;
45 
47 
48 TEST_CASE( "LambdaMST3DBy2D test" )
49 {
50 
51  typedef vector < Point > Container;
52  typedef Container::const_iterator ConstIterator;
54 
55  // Input points
56  Container contour;
57  contour.push_back ( Point ( 18, 25, 18 ) );
58  contour.push_back ( Point ( 17, 25, 19 ) );
59  contour.push_back ( Point ( 16, 25, 20 ) );
60  contour.push_back ( Point ( 15, 25, 21 ) );
61  contour.push_back ( Point ( 14, 25, 22 ) );
62  contour.push_back ( Point ( 13, 25, 23 ) );
63  contour.push_back ( Point ( 12, 25, 24 ) );
64  contour.push_back ( Point ( 11, 25, 25 ) );
65  contour.push_back ( Point ( 10, 25, 26 ) );
66  contour.push_back ( Point ( 9, 25, 27 ) );
67  contour.push_back ( Point ( 8, 25, 28 ) );
68 
69  lmst.init ( contour.cbegin ( ), contour.cend ( ), LambdaMST3DBy2D < ConstIterator >::MAIN_AXIS::X ) ;
70  lmst.eval ( contour.front ( ) );
71 
72  lmst.init ( contour.cbegin ( ), contour.cend ( ), LambdaMST3DBy2D < ConstIterator >::MAIN_AXIS::X );
73  vector < RealVector > tangent;
74  lmst.eval ( contour.cbegin ( ), contour.cend ( ), back_insert_iterator < vector < RealVector > > ( tangent ) );
75 }
76 
void init(Iterator3D itB, Iterator3D itE, MAIN_AXIS axis)
RealVector3D eval(const Point3D &point)
Aim: Simplify creation of Lambda MST tangent estimator.
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
TEST_CASE("int container traits", "[int][traits]")