DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
digitalSetFromPointList.cpp
Go to the documentation of this file.
1
16
29
30
31
38
39
40
42
#include "DGtal/base/Common.h"
43
#include "DGtal/io/readers/PointListReader.h"
44
#include "DGtal/io/viewers/PolyscopeViewer.h"
45
#include "DGtal/io/Color.h"
46
47
#include "DGtal/helpers/StdDefs.h"
48
#include "ConfigExamples.h"
49
51
52
using namespace
std
;
53
using namespace
DGtal
;
54
using namespace
Z3i
;
55
57
58
int
main
()
59
{
60
std::string inputFilename = examplesPath +
"samples/pointList3d.pl"
;
61
PolyscopeViewer<>
viewer;
62
// Importing the 3d set of points contained with the default index (0, 1, 2);
63
vector<Z3i::Point> vectPoints=
PointListReader<Z3i::Point>::getPointsFromFile
(inputFilename);
64
for
(
unsigned
int
i=0; i<vectPoints.size();i++){
65
viewer << vectPoints.at(i);
66
}
67
68
// Importing the 3d set of points with another index definition (0, 2, 1);
69
vector<unsigned int> vPos;
70
vPos.push_back(0);
71
vPos.push_back(2);
72
vPos.push_back(1);
73
vectPoints=
PointListReader<Z3i::Point>::getPointsFromFile
(inputFilename, vPos);
74
viewer<<
Color
(255,0,0);
75
for
(
unsigned
int
i=0; i<vectPoints.size();i++){
76
viewer << vectPoints.at(i);
77
}
78
79
viewer.
show
();
80
return
0;
81
}
82
DGtal::Color::Color
Color()
Definition
Color.h:139
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::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 >())
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
io
digitalSetFromPointList.cpp
Generated on
for DGtal by
1.18.0