File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
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
37using namespace std;
38using namespace DGtal;
39using namespace Z3i;
40
42// Standard services - public :
43
44int main( int argc, char** argv )
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// //
71
std::string drawPolygon(const std::vector< Vec > &vertices, const std::string &uname="Polygon_{i}")
Draws a polygon.
void show() override
Starts the event loop and display of elements.
Z3i this namespace gathers the standard of types for 3D imagery.
Space::RealPoint RealPoint
Definition StdDefs.h:170
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition testBits.cpp:56