DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
viewer3D-3-objects.cpp
1 
30 
31 #include <iostream>
32 #include <QtGui/qapplication.h>
33 #include "DGtal/io/viewers/Viewer3D.h"
34 #include "DGtal/io/DrawWithDisplay3DModifier.h"
35 #include "DGtal/io/Color.h"
36 #include "DGtal/base/Common.h"
37 #include "DGtal/helpers/StdDefs.h"
38 #include "DGtal/shapes/Shapes.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  Viewer3D viewer;
56  viewer.show();
57 
58  Point p1( 0, 0, 0 );
59  Point p2( 10, 10 , 10 );
60  Domain domain( p1, p2 );
61 
62 
63  DigitalSet shape_set( domain );
64  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
65  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
66  viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 25));
67  viewer << shape_set;
68 
69  Object6_18 shape( dt6_18, shape_set );
70  viewer << SetMode3D( shape.className(), "DrawAdjacencies" );
71  viewer << shape;
72 
73  Object18_6 shape2( dt18_6, shape_set );
74  viewer << SetMode3D( shape2.className(), "DrawAdjacencies" );
75  //viewer << shape2;
76 
77  viewer<< Viewer3D::updateDisplay;
78  return application.exec();
79 }
80 // //
82 
83 
84 
85