DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
viewer3D-6-clipping.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  Viewer3D viewer;
55  viewer.show();
56 
57  Point p1( 0, 0, 0 );
58  Point p2( 20, 20, 20 );
59  Domain domain(p1, p2);
60  DigitalSet shape_set( domain );
61 
62  Shapes<Domain>::addNorm2Ball( shape_set, Point( 10, 10, 10 ), 7 );
63 
64  viewer << SetMode3D( shape_set.className(), "Both" );
65  viewer << shape_set;
66  viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
67  viewer << SetMode3D( p1.className(), "Paving" );
68 
69  viewer << ClippingPlane(1,0,0,-4.9);
70  viewer << ClippingPlane(0,1,0.3,-10);
71 
72  viewer << Viewer3D::updateDisplay;
73  return application.exec();
74 }
75 // //
77 
78 
79 
80