DGtal  0.9.2
viewer3D-2-sets.cpp
1 
30 #include <iostream>
32 
33 #include "DGtal/base/Common.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/shapes/Shapes.h"
36 #include "DGtal/io/viewers/Viewer3D.h"
37 
39 
40 using namespace std;
41 using namespace DGtal;
42 using namespace Z3i;
43 
44 
46 // Standard services - public :
47 
48 int main( int argc, char** argv )
49 {
50 
52  QApplication application(argc,argv);
53  typedef Viewer3D<> MyViewer;
54  MyViewer viewer;
55  viewer.show();
56 
57  Point p1( 0, 0, 0 );
58  Point p2( 10, 10 , 10 );
59  Domain domain( p1, p2 );
60  viewer << domain;
61 
62  DigitalSet shape_set( domain );
63  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
64  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
65 
66  shape_set.erase(Point(3,3,3));
67  shape_set.erase(Point(6,6,6));
68  viewer << shape_set << MyViewer::updateDisplay;
70  return application.exec();
71 }
72 // //
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
STL namespace.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A utility class for constructing different shapes (balls, diamonds, and others).