DGtal  0.9.2
dgtalBoard3DTo2D-1-points.cpp
1 
29 #include <iostream>
31 #include "DGtal/io/boards/Board3DTo2D.h"
32 #include "DGtal/base/Common.h"
33 #include "DGtal/helpers/StdDefs.h"
34 
36 
37 using namespace std;
38 using namespace DGtal;
39 using namespace Z3i;
40 
41 
43 // Standard services - public :
44 
45 int main()
46 {
47 
48  Point p1( 0, 0, 0 );
49  Point p2( 5, 5 ,5 );
50  Point p3( 2, 3, 4 );
51  Domain domain( p1, p2 );
54  board << domain;
55  board << p1 << p2 << p3;
56 
57  board << CameraPosition(2.500000, 2.500000, 16.078199)
58  << CameraDirection(0.000000, 0.000000, -1.000000)
59  << CameraUpVector(0.000000, 1.000000, 0.000000);
60  board << CameraZNearFar(4.578200, 22.578199);
61 
62  board << SetMode3D(board.className(), "WireFrameMode");
63  board.saveCairo("dgtalBoard3DTo2D-1-points.png", Board3DTo2D<Space, KSpace>::CairoPNG, 600*2, 400*2);
65 }
66 // //
68 
69 
70 
71 
CameraUpVector class to set camera up-vector.
CameraZNearFar class to set near and far distance.
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.
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.