DGtal  1.5.beta
dgtalBoard3DTo2D-5-custom.cpp
1 
38 #include <iostream>
39 #include "DGtal/io/boards/Board3DTo2D.h"
40 #include "DGtal/io/DrawWithDisplay3DModifier.h"
41 #include "DGtal/base/Common.h"
42 #include "DGtal/helpers/StdDefs.h"
43 #include "DGtal/shapes/Shapes.h"
44 
46 
47 using namespace std;
48 using namespace DGtal;
49 using namespace Z3i;
50 
51 
53 // Standard services - public :
54 
55 int main()
56 {
58 
59  Point p1( -1, -1, -2 );
60  Point p2( 2, 2, 3 );
61  Domain domain( p1, p2 );
62 
63  Point p3( 1, 1, 1 );
64  Point p4( 2, -1, 3 );
65  Point p5( -1, 2, 3 );
66  Point p6( 0, 0, 0 );
67  Point p0( 0, 2, 1 );
68 
69  board << SetMode3D( p1.className(), "PavingWired" );
70  board << p1 << p2 << p3;
71 
72  //board << SetMode3D( p1.className(), "Grid" );
73  board << CustomColors3D(Color(250, 0,0),Color(250, 0,0));
74  board << p4 << p5 ;
75  board << SetMode3D( p1.className(), "Both" );
76  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 0,0, 100));
77  board << p6;
78  board << CustomColors3D(Color(250, 200,0, 100),Color(250, 200,0, 20));
79  board << p0;
80 
81  board << SetMode3D(domain.className(), "Paving");
82  board << domain;
83  board << SetMode3D(board.className(), "WireFrameMode");
84  board.saveCairo("dgtalBoard3DTo2D-5-custom-wireframe.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600*2, 400*2);
85 
86  board << SetMode3D(board.className(), "SolidMode");
87  board.saveCairo("dgtalBoard3DTo2D-5-custom.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600*2, 400*2);
88 }
89 // //
91 
92 
93 
94 
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Definition: Board3DTo2D.h:71
std::string className() const
Definition: Board3DTo2D.h:106
void saveCairo(const char *filename, CairoType type, int bWidth, int bHeight)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
std::string className() const
DGtal is the top-level namespace which contains all DGtal functions and types.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
int main(int argc, char **argv)
Domain domain