DGtal  1.2.0
dgtalBoard3DTo2D-0-demo-kernel-2.cpp
1 
30 #include <iostream>
31 #include "DGtal/io/boards/Board3DTo2D.h"
32 #include "DGtal/io/DrawWithDisplay3DModifier.h"
33 #include "DGtal/base/Common.h"
34 #include "DGtal/kernel/SpaceND.h"
35 #include "DGtal/helpers/StdDefs.h"
36 #include "DGtal/kernel/domains/HyperRectDomain.h"
37 
39 
40 using namespace std;
41 using namespace DGtal;
42 
44 
45 int main()
46 {
47  typedef DGtal::SpaceND<3, DGtal::int32_t> MySpace;
48  typedef MySpace::Point MyPoint;
49  typedef HyperRectDomain<MySpace> MyDomain;
50 
51  MyPoint p1( 0, 0, 0 );
52  MyPoint p2( 5, 5 ,5 );
53  MyPoint p3( 2, 3, 4 );
54  MyDomain domain( p1, p2 );
55 
56  Board3DTo2D<> board;
57 
58  board << domain;
59  board << p1 << p2 << p3;
60 
61  board << CameraPosition(2.500000, 2.500000, 16.078199)
62  << CameraDirection(0.000000, 0.000000, -1.000000)
63  << CameraUpVector(0.000000, 1.000000, 0.000000);
64 
65  board << SetMode3D(board.className(), "WireFrameMode");
66  board.saveCairo("dgtalBoard3DTo2D-0-demo-kernel-2.png", Board3DTo2D<>::CairoPNG, 600, 400);
67 }
68 // //
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)
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
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.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
int main(int argc, char **argv)
MyPointD Point
Definition: testClone2.cpp:383
Domain domain