DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
exampleArithDSS3d.cpp
Go to the documentation of this file.
1
16
28
44
45
46
47
48
#include <iostream>
49
50
#include "DGtal/io/viewers/PolyscopeViewer.h"
51
52
#include "DGtal/io/readers/PointListReader.h"
53
54
#include "DGtal/base/Common.h"
55
#include "DGtal/helpers/StdDefs.h"
56
#include "ConfigExamples.h"
57
58
#include "DGtal/geometry/curves/StandardDSS6Computer.h"
59
#include "DGtal/geometry/curves/GreedySegmentation.h"
60
61
62
using namespace
std
;
63
using namespace
DGtal
;
64
using namespace
Z3i
;
65
66
67
// Standard services - public :
68
69
int
main
()
70
{
71
72
typedef
PointVector<3,int>
Point
;
73
typedef
std::vector<Point>::iterator
Iterator
;
74
typedef
StandardDSS6Computer<Iterator,int,4>
SegmentComputer
;
75
typedef
GreedySegmentation<SegmentComputer>
Decomposition;
76
77
string
inputFilename = examplesPath +
"samples/sinus.dat"
;
78
vector<Point> sequence =
PointListReader<Point>::getPointsFromFile
(inputFilename);
79
80
81
SegmentComputer
algo;
82
Decomposition theDecomposition(sequence.begin(), sequence.end(), algo);
83
85
//display
86
Point
p;
87
88
#ifdef DGTAL_WITH_POLYSCOPE_VIEWER
89
90
PolyscopeViewer
viewer;
91
viewer.
allowReuseList
=
true
;
// groups segments
92
viewer.
drawAsGrid
();
93
#endif
94
95
unsigned
int
c = 0;
96
Decomposition::SegmentComputerIterator i = theDecomposition.begin();
97
for
( ; i != theDecomposition.end(); ++i) {
98
SegmentComputer
currentSegmentComputer(*i);
99
#ifdef DGTAL_WITH_POLYSCOPE_VIEWER
100
viewer.
drawAsBalls
();
101
viewer << currentSegmentComputer;
102
viewer.
defaultStyle
();
103
viewer << currentSegmentComputer;
104
#endif
105
c++;
106
}
107
108
109
#ifdef DGTAL_WITH_POLYSCOPE_VIEWER
110
viewer.
show
();
111
#endif
112
113
}
DGtal::Display3D::allowReuseList
bool allowReuseList
Definition
Display3D.h:749
DGtal::Display3D::drawAsGrid
void drawAsGrid(bool toggle=true)
DGtal::Display3D::drawAsBalls
void drawAsBalls()
DGtal::Display3D::defaultStyle
void defaultStyle()
DGtal::GreedySegmentation
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
Definition
GreedySegmentation.h:150
DGtal::Iterator
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition
PointVector.h:593
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:57
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:73
DGtal::Point
DGtal::StandardDSS6Computer
Aim: Dynamic recognition of a 3d-digital straight segment (DSS).
Definition
StandardDSS6Computer.h:77
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
std
STL namespace.
DGtal::PointListReader::getPointsFromFile
static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
SegmentComputer
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
Definition
testArithmeticalDSSComputerOnSurfels.cpp:55
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
geometry
curves
exampleArithDSS3d.cpp
Generated on
for DGtal by
1.18.0