DGtal  1.1.0
dgtalBoard3DTo2D-3-objects.cpp
1 
37 #include <iostream>
39 #include "DGtal/io/boards/Board3DTo2D.h"
40 #include "DGtal/io/DrawWithDisplay3DModifier.h"
41 #include "DGtal/io/Color.h"
42 
43 #include "DGtal/base/Common.h"
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/shapes/Shapes.h"
46 
48 
49 using namespace std;
50 using namespace DGtal;
51 using namespace Z3i;
52 
53 
55 // Standard services - public :
56 
57 int main()
58 {
60 
61  Point p1( 0, 0, 0 );
62  Point p2( 10, 10 , 10 );
63  Domain domain( p1, p2 );
64 
65  DigitalSet shape_set( domain );
66  Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
67  Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
68  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 25));
69  board << shape_set;
70 
71  Object6_18 shape( dt6_18, shape_set );
72  board << SetMode3D( shape.className(), "DrawAdjacencies" );
73  board << shape;
74 
75  Object18_6 shape2( dt18_6, shape_set );
76  board << SetMode3D( shape2.className(), "DrawAdjacencies" );
77  //board << shape2;
78 
79  board << CameraPosition(4.000000, 4.000000, 17.578199)
80  << CameraDirection(0.000000, 0.000000, -1.000000)
81  << CameraUpVector(0.000000, 1.000000, 0.000000);
82 
83  //board << SetMode3D(board.className(), "WireFrameMode");
84  board.saveCairo("dgtalBoard3DTo2D-3-objects.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600, 400);
85 }
86 // //
88 
89 
90 
91 
DGtal::HyperRectDomain< Space >
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition: Color.h:67
DGtal::Z3i::Object18_6
Object< DT18_6, DigitalSet > Object18_6
Definition: StdDefs.h:178
DGtal::Z2i::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition: StdDefs.h:100
DGtal::Board3DTo2D
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Definition: Board3DTo2D.h:69
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::CustomColors3D
Definition: DrawWithDisplay3DModifier.h:130
DGtal::Z3i::Object6_18
Object< DT6_18, DigitalSet > Object6_18
Definition: StdDefs.h:174
DGtal::CameraDirection
CameraDirection class to set camera direction.
Definition: DrawWithBoard3DTo2DModifier.h:91
DGtal::SetMode3D
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Definition: DrawWithDisplay3DModifier.h:74
main
int main(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
DGtal::Shapes
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
Definition: DGtal/shapes/Shapes.h:72
DGtal::CameraPosition
CameraPosition class to set camera position.
Definition: DrawWithBoard3DTo2DModifier.h:71
domain
Domain domain
Definition: testProjection.cpp:88
DGtal::CameraUpVector
CameraUpVector class to set camera up-vector.
Definition: DrawWithBoard3DTo2DModifier.h:111
DGtal::Board3DTo2D::saveCairo
void saveCairo(const char *filename, CairoType type, int bWidth, int bHeight)
Point
MyPointD Point
Definition: testClone2.cpp:383