DGtal  1.5.beta
viewer3D-3-objects.cpp
1 
39 #include <iostream>
40 
41 #include "DGtal/base/Common.h"
42 #include "DGtal/io/DrawWithDisplay3DModifier.h"
43 #include "DGtal/io/Color.h"
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/shapes/Shapes.h"
46 #include "DGtal/io/viewers/Viewer3D.h"
47 
49 
50 using namespace std;
51 using namespace DGtal;
52 using namespace Z3i;
53 
54 
56 // Standard services - public :
57 
58 int main( int argc, char** argv )
59 {
60 
61  QApplication application(argc,argv);
62 
63  typedef Viewer3D<> MyViewer;
64  MyViewer viewer;
65  viewer.show();
66 
67  Point p1( 0, 0, 0 );
68  Point p2( 10, 10 , 10 );
69  Domain domain( p1, p2 );
70 
71 
72  DigitalSet shape_set( domain );
73  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
74  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
75  viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 25));
76  viewer << shape_set;
77 
78  Object6_18 shape( dt6_18, shape_set );
79  viewer << SetMode3D( shape.className(), "DrawAdjacencies" );
80  viewer << shape;
81 
82  Object18_6 shape2( dt18_6, shape_set );
83  viewer << SetMode3D( shape2.className(), "DrawAdjacencies" );
84  //viewer << shape2;
85 
86  viewer<< MyViewer::updateDisplay;
87  return application.exec();
88 }
89 // //
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition: Object.h:120
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
DGtal is the top-level namespace which contains all DGtal functions and types.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
int main(int argc, char **argv)
MyPointD Point
Definition: testClone2.cpp:383
Domain domain