DGtal  1.4.beta
viewer3D-2-sets.cpp
1 
39 #include <iostream>
41 
42 #include "DGtal/base/Common.h"
43 #include "DGtal/helpers/StdDefs.h"
44 #include "DGtal/shapes/Shapes.h"
45 #include "DGtal/io/viewers/Viewer3D.h"
46 
48 
49 using namespace std;
50 using namespace DGtal;
51 using namespace Z3i;
52 
53 
55 // Standard services - public :
56 
57 int main( int argc, char** argv )
58 {
59 
61  QApplication application(argc,argv);
62  typedef Viewer3D<> MyViewer;
63  MyViewer viewer;
64  viewer.show();
65 
66  Point p1( 0, 0, 0 );
67  Point p2( 10, 10 , 10 );
68  Domain domain( p1, p2 );
69  viewer << domain;
70 
71  DigitalSet shape_set( domain );
72  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
73  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
74 
75  shape_set.erase(Point(3,3,3));
76  shape_set.erase(Point(6,6,6));
77  viewer << shape_set << MyViewer::updateDisplay;
79  return application.exec();
80 }
81 // //
DGtal::HyperRectDomain< Space >
DGtal::Display3D::updateDisplay
@ updateDisplay
Definition: Display3D.h:249
DGtal::Viewer3D
Definition: Viewer3D.h:131
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
main
int main(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
DGtal::Shapes
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Definition: DGtal/shapes/Shapes.h:71
domain
Domain domain
Definition: testProjection.cpp:88
DGtal::Viewer3D::show
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition: DigitalSetByAssociativeContainer.h:89