DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testPolygon3D.cpp
Go to the documentation of this file.
1
16
27
29
#include <iostream>
30
#include "DGtal/base/Common.h"
31
#include "DGtal/io/viewers/PolyscopeViewer.h"
32
#include "DGtal/io/Color.h"
33
#include "DGtal/helpers/StdDefs.h"
34
#include "DGtal/shapes/Shapes.h"
36
37
using namespace
std
;
38
using namespace
DGtal
;
39
using namespace
Z3i
;
40
42
// Standard services - public :
43
44
int
main
()
45
{
46
PolyscopeViewer<>
viewer;
47
trace
.
beginBlock
(
"Testing Polygon 3D display in PolyscopeViewer"
);
48
std::vector<Z3i::RealPoint> polyg1;
49
50
polyg1.push_back(
Z3i::RealPoint
(0,0,0));
51
polyg1.push_back(
Z3i::RealPoint
(0,1,0));
52
polyg1.push_back(
Z3i::RealPoint
(1,1,0));
53
54
viewer.
drawPolygon
(polyg1);
55
56
std::vector<Z3i::RealPoint> polyg2;
57
58
polyg2.push_back(
Z3i::RealPoint
(0,10,0));
59
polyg2.push_back(
Z3i::RealPoint
(0,11,0));
60
polyg2.push_back(
Z3i::RealPoint
(11,11,0));
61
62
viewer.
drawPolygon
(polyg2,
"hop"
);
63
64
trace
.
emphase
() <<
"Passed."
<< endl;
65
trace
.
endBlock
();
66
viewer.
show
();
67
return
0;
68
}
69
// //
DGtal::Display3D::drawPolygon
std::string drawPolygon(const std::vector< Vec > &vertices, const std::string &uname="Polygon_{i}")
Draws a polygon.
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::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::endBlock
double endBlock()
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::Z3i::RealPoint
Space::RealPoint RealPoint
Definition
StdDefs.h:170
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
tests
io
viewers
testPolygon3D.cpp
Generated on
for DGtal by
1.18.0