Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
viewer3D-3-objects.cpp
Go to the documentation of this file.
1
16
29
36
37
39#include <iostream>
40
41#include "DGtal/base/Common.h"
42#include "DGtal/io/Color.h"
43#include "DGtal/helpers/StdDefs.h"
44#include "DGtal/shapes/Shapes.h"
45#include "DGtal/io/viewers/PolyscopeViewer.h"
46
48
49using namespace std;
50using namespace DGtal;
51using namespace Z3i;
52
53
55// Standard services - public :
56
57int main( int argc, char** argv )
58{
60
61 // Instructs the viewer to draw adjacencies relation whenever possible
62 v.drawAdjacencies(true /* false */);
63
64 Point p1( 0, 0, 0 );
65 Point p2( 10, 10 , 10 );
66 Domain domain( p1, p2 );
67
68 DigitalSet shape_set( domain );
69 Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
70 Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
71
72 v << shape_set;
73
74 Object6_18 shape1( dt6_18, shape_set );
75 Object18_6 shape2( dt18_6, shape_set );
76
77 // Draws both the object the adjacencies
78 v << shape1;
79 v << shape2;
80
81 v.show();
82 return 0;
83}
84// //
void drawAdjacencies(bool toggle=true)
void show() override
Starts the event loop and display of elements.
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
Z3i this namespace gathers the standard of types for 3D imagery.
static const DT6_18 dt6_18
Definition StdDefs.h:194
static const DT18_6 dt18_6
Definition StdDefs.h:195
Space::Point Point
Definition StdDefs.h:168
Object< DT6_18, DigitalSet > Object6_18
Definition StdDefs.h:174
Object< DT18_6, DigitalSet > Object18_6
Definition StdDefs.h:178
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:173
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
int main()
Definition testBits.cpp:56
Domain domain