DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dgtalBoard3DTo2D-2bis-sets.cpp
1 
29 
30 #include <iostream>
31 #include "DGtal/io/boards/Board3DTo2D.h"
32 #include "DGtal/io/DrawWithDisplay3DModifier.h"
33 #include "DGtal/base/Common.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/shapes/Shapes.h"
36 
38 
39 using namespace std;
40 using namespace DGtal;
41 using namespace Z3i;
42 
43 
45 // Standard services - public :
46 
47 int main()
48 {
49  Board3DTo2D board;
50 
51  Point p1( 0, 0, 0 );
52  Point p2( 10, 10 , 10 );
53  Domain domain( p1, p2 );
54 
55  DigitalSet shape_set( domain );
56  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
57  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
58 
59  shape_set.erase(Point(3,3,3));
60  shape_set.erase(Point(6,6,6));
61 
62  // example with wireframe mode
63  board << SetMode3D(board.className(), "WireFrameMode");
64 
65  board << shape_set;
66 
67  board << CameraPosition(5.000000, 5.000000, 15)
68  << CameraDirection(0.000000, 0.000000, -1.000000)
69  << CameraUpVector(0.000000, 1.000000, 0.000000);
70 
71  board.saveCairo("dgtalBoard3DTo2D-2bis-sets-wireframe.png", Board3DTo2D::CairoPNG, 600, 400);
72 }
73 // //
75 
76 
77 
78