DGtal  1.2.0
exampleNaive3DDSSComputer.cpp
Go to the documentation of this file.
1 
39 #include <iostream>
40 #include "DGtal/base/Common.h"
41 #include "DGtal/base/BasicTypes.h"
42 #include "DGtal/helpers/StdDefs.h"
43 
45 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
48 
49 
50 using namespace std;
51 using namespace DGtal;
52 
54 
55 int main()
56 {
57  using namespace Z3i;
58 
60  // Container of digital points
61  typedef std::vector<Z3::Point> Container;
62  // Iterator on the container
63  typedef Container::const_iterator ConstIterator;
64  // Naive3DDSS computer
66  // Construction of the computer
67  DSSComputer theDSSComputer;
69 
70  // Input points
71  Container contour;
72  contour.push_back(Z3::Point(18,25,18));
73  contour.push_back(Z3::Point(17,25,19));
74  contour.push_back(Z3::Point(16,25,20));
75  contour.push_back(Z3::Point(15,25,21));
76  contour.push_back(Z3::Point(14,25,22));
77  contour.push_back(Z3::Point(13,25,23));
78  contour.push_back(Z3::Point(12,25,24));
79  contour.push_back(Z3::Point(11,25,25));
80  contour.push_back(Z3::Point(10,25,26));
81  contour.push_back(Z3::Point(9,25,27));
82  contour.push_back(Z3::Point(8,25,28));
83 
85  // Add points while it is possible
86  theDSSComputer.init( contour.begin() );
87  while ( ( theDSSComputer.end() != contour.end() ) &&
88  ( theDSSComputer.extendFront() ) ) {}
90 
91  // Trace to the standard output
92  theDSSComputer.selfDisplay( cout );
93 
95  theDSSComputer.validArithmeticalDSS2d( 0 );
97 
99  DSSComputer::ArithmeticalDSSComputer2d theDSS = theDSSComputer.arithmeticalDSS2d( 0 );
101 
102 
104  DSSComputer::Point3d directionZ3;
105  DSSComputer::PointR3d intercept;
106  DSSComputer::PointR3d thikness;
107  theDSSComputer.getParameters ( directionZ3, intercept, thikness );
109 
110  return 1;
111 }
112 // //
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
void init(const ConstIterator &it)
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383