DGtal  0.9.2
dgtalBoard3DTo2D-5-custom.cpp
1 
29 #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 {
50 
51  Point p1( -1, -1, -2 );
52  Point p2( 2, 2, 3 );
53  Domain domain( p1, p2 );
54 
55  Point p3( 1, 1, 1 );
56  Point p4( 2, -1, 3 );
57  Point p5( -1, 2, 3 );
58  Point p6( 0, 0, 0 );
59  Point p0( 0, 2, 1 );
60 
61  board << SetMode3D( p1.className(), "PavingWired" );
62  board << p1 << p2 << p3;
63 
64  //board << SetMode3D( p1.className(), "Grid" );
65  board << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
66  board << p4 << p5 ;
67  board << SetMode3D( p1.className(), "Both" );
68  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 0,0, 100));
69  board << p6;
70  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
71  board << p0;
72 
73  board << SetMode3D(domain.className(), "Paving");
74  board << domain;
75  board << SetMode3D(board.className(), "WireFrameMode");
76  board.saveCairo("dgtalBoard3DTo2D-5-custom-wireframe.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600*2, 400*2);
77 
78  board << SetMode3D(board.className(), "SolidMode");
79  board.saveCairo("dgtalBoard3DTo2D-5-custom.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600*2, 400*2);
80 }
81 // //
83 
84 
85 
86 
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)
STL namespace.
std::string className() const
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
std::string className() const
Definition: Board3DTo2D.h:104
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.