DGtal  0.9.2
dgtalBoard3DTo2D-3-objects.cpp
1 
29 #include <iostream>
31 #include "DGtal/io/boards/Board3DTo2D.h"
32 #include "DGtal/io/DrawWithDisplay3DModifier.h"
33 #include "DGtal/io/Color.h"
34 
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()
50 {
52 
53  Point p1( 0, 0, 0 );
54  Point p2( 10, 10 , 10 );
55  Domain domain( p1, p2 );
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  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 25));
61  board << shape_set;
62 
63  Object6_18 shape( dt6_18, shape_set );
64  board << SetMode3D( shape.className(), "DrawAdjacencies" );
65  board << shape;
66 
67  Object18_6 shape2( dt18_6, shape_set );
68  board << SetMode3D( shape2.className(), "DrawAdjacencies" );
69  //board << shape2;
70 
71  board << CameraPosition(4.000000, 4.000000, 17.578199)
72  << CameraDirection(0.000000, 0.000000, -1.000000)
73  << CameraUpVector(0.000000, 1.000000, 0.000000);
74 
75  //board << SetMode3D(board.className(), "WireFrameMode");
76  board.saveCairo("dgtalBoard3DTo2D-3-objects.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600, 400);
77 }
78 // //
80 
81 
82 
83 
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
CameraUpVector class to set camera up-vector.
Object< DT6_18, DigitalSet > Object6_18
Definition: StdDefs.h:174
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.
Object< DT18_6, DigitalSet > Object18_6
Definition: StdDefs.h:178
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.