DGtal  0.9.2
viewer3D-3-objects.cpp
1 
30 #include <iostream>
32 
33 #include "DGtal/base/Common.h"
34 #include "DGtal/io/DrawWithDisplay3DModifier.h"
35 #include "DGtal/io/Color.h"
36 #include "DGtal/helpers/StdDefs.h"
37 #include "DGtal/shapes/Shapes.h"
38 #include "DGtal/io/viewers/Viewer3D.h"
39 
41 
42 using namespace std;
43 using namespace DGtal;
44 using namespace Z3i;
45 
46 
48 // Standard services - public :
49 
50 int main( int argc, char** argv )
51 {
52 
53  QApplication application(argc,argv);
54 
55  typedef Viewer3D<> MyViewer;
56  MyViewer viewer;
57  viewer.show();
58 
59  Point p1( 0, 0, 0 );
60  Point p2( 10, 10 , 10 );
61  Domain domain( p1, p2 );
62 
63 
64  DigitalSet shape_set( domain );
65  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
66  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
67  viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 25));
68  viewer << shape_set;
69 
70  Object6_18 shape( dt6_18, shape_set );
71  viewer << SetMode3D( shape.className(), "DrawAdjacencies" );
72  viewer << shape;
73 
74  Object18_6 shape2( dt18_6, shape_set );
75  viewer << SetMode3D( shape2.className(), "DrawAdjacencies" );
76  //viewer << shape2;
77 
78  viewer<< MyViewer::updateDisplay;
79  return application.exec();
80 }
81 // //
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
Object< DT6_18, DigitalSet > Object6_18
Definition: StdDefs.h:174
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.
Object< DT18_6, DigitalSet > Object18_6
Definition: StdDefs.h:178
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.