DGtal  0.9.2
dgtalBoard3D-6-clipping.cpp
1 
30 #include <iostream>
32 #include "DGtal/io/boards/Board3D.h"
33 #include "DGtal/io/DrawWithDisplay3DModifier.h"
34 #include "DGtal/io/Color.h"
35 #include "DGtal/base/Common.h"
36 #include "DGtal/helpers/StdDefs.h"
37 #include "DGtal/shapes/Shapes.h"
38 
40 
41 using namespace std;
42 using namespace DGtal;
43 using namespace Z3i;
44 
45 
47 // Standard services - public :
48 
49 int main( int /*argc*/, char** /*argv*/ )
50 {
51 
52  Board3D<> board;
53 
54  Point p1( 0, 0, 0 );
55  Point p2( 20, 20, 20 );
56  Domain domain(p1, p2);
57  DigitalSet shape_set( domain );
58 
59  Shapes<Domain>::addNorm2Ball( shape_set, Point( 10, 10, 10 ), 7 );
60 
61  board << SetMode3D( shape_set.className(), "Both" );
62  board << shape_set;
63  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
64  board << SetMode3D( p1.className(), "Paving" );
65 
66  board << ClippingPlane(1,0,0,-4.9);
67  board << ClippingPlane(0,1,0.3,-10);
68 
69  board.saveOBJ("board3D-6-clipping.obj");
70 
71 }
72 // //
74 
75 
76 
77 
78 
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
void saveOBJ(const std::string &filename, const bool isNormalized=false)
STL namespace.
The class Board3D is a type of Display3D which export the figures in the format OBJ/MTL when calling ...
Definition: Board3D.h:81
DGtal is the top-level namespace which contains all DGtal functions and types.
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
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. Realizes the concept CDrawableWithDisplay3D.