DGtal  0.9.2
dgtalBoard3DTo2D-2-sets.cpp
1 
29 #include <iostream>
31 #include "DGtal/io/boards/Board3DTo2D.h"
32 #include "DGtal/base/Common.h"
33 #include "DGtal/helpers/StdDefs.h"
34 #include "DGtal/shapes/Shapes.h"
35 
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 {
50 
51  Point p1( 0, 0, 0 );
52  Point p2( 10, 10 , 10 );
53  Domain domain( p1, p2 );
54 
55  board << domain;
56 
57  DigitalSet shape_set( domain );
58  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
59  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
60 
61  shape_set.erase(Point(3,3,3));
62  shape_set.erase(Point(6,6,6));
63  board << shape_set;
64 
65  board << CameraPosition(5.000000, 5.000000, 29.893368)
66  << CameraDirection(0.000000, 0.000000, -1.000000)
67  << CameraUpVector(0.000000, 1.000000, 0.000000);
68 
69  //board << SetMode3D(board.className(), "WireFrameMode");
70  board.saveCairo("dgtalBoard3DTo2D-2-sets.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600, 400);
71 }
72 // //
74 
75 
76 
77 
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
CameraUpVector class to set camera up-vector.
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Definition: Common.h:138
void saveCairo(const char *filename, CairoType type, int bWidth, int bHeight)
CameraDirection class to set camera direction.
STL namespace.
CameraPosition class to set camera position.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A utility class for constructing different shapes (balls, diamonds, and others).