DGtal  1.0.0
viewer3D-6-clipping.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 #include "DGtal/io/DrawWithDisplay3DModifier.h"
47 #include "DGtal/io/Color.h"
48 
50 
51 using namespace std;
52 using namespace DGtal;
53 using namespace Z3i;
54 
55 
57 // Standard services - public :
58 
59 int main( int argc, char** argv )
60 {
61 
62  QApplication application(argc,argv);
63  typedef Viewer3D<> MyViewer;
64  MyViewer viewer;
65  viewer.show();
66 
67  Point p1( 0, 0, 0 );
68  Point p2( 20, 20, 20 );
69  Domain domain(p1, p2);
70  DigitalSet shape_set( domain );
71 
72  Shapes<Domain>::addNorm2Ball( shape_set, Point( 10, 10, 10 ), 7 );
73 
74  viewer << SetMode3D( shape_set.className(), "Both" );
75  viewer << shape_set;
76  viewer << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
77  viewer << SetMode3D( p1.className(), "Paving" );
78 
79  viewer << ClippingPlane(1,0,0,-4.9);
80  viewer << ClippingPlane(0,1,0.3,-10);
81 
82  viewer << MyViewer::updateDisplay;
83  return application.exec();
84 }
85 // //
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
Domain domain
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Class for adding a Clipping plane through the Viewer3D stream. Realizes the concept CDrawableWithView...
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....