DGtal  1.5.beta
dgtalBoard3DTo2D-4-modes.cpp
1 
39 #include <iostream>
40 #include "DGtal/io/boards/Board3DTo2D.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(), "Grid" );
70 
71  board << p1 << p2 << p3 << p4 << p5 << p6 << p0;
72 
73  //board << SetMode3D(domain.className(), "PavingGrids");
74  board << domain;
75 
76  board << CameraPosition(0.500000, 0.500000, 11.274194)
77  << CameraDirection(0.000000, 0.000000, -1.000000)
78  << CameraUpVector(0.000000, 1.000000, 0.000000);
79 
80  //board << SetMode3D(board.className(), "WireFrameMode");
81  board.saveCairo("dgtalBoard3DTo2D-4-modes.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600, 400);
82 }
83 // //
85 
86 
87 
88 
Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection.
Definition: Board3DTo2D.h:71
void saveCairo(const char *filename, CairoType type, int bWidth, int bHeight)
DGtal is the top-level namespace which contains all DGtal functions and types.
CameraDirection class to set camera direction.
CameraPosition class to set camera position.
CameraUpVector class to set camera up-vector.
int main(int argc, char **argv)
Domain domain