DGtal 1.3.0
Loading...
Searching...
No Matches
dgtalBoard3DTo2D-2bis-sets.cpp
1
40#include <iostream>
41#include "DGtal/io/boards/Board3DTo2D.h"
42#include "DGtal/io/DrawWithDisplay3DModifier.h"
43#include "DGtal/base/Common.h"
44#include "DGtal/helpers/StdDefs.h"
45#include "DGtal/shapes/Shapes.h"
46
48
49using namespace std;
50using namespace DGtal;
51using namespace Z3i;
52
53
55// Standard services - public :
56
57int main()
58{
60
61 Point p1( 0, 0, 0 );
62 Point p2( 10, 10 , 10 );
63 Domain domain( p1, p2 );
64
65 DigitalSet shape_set( domain );
66 Shapes<Domain>::addNorm1Ball( shape_set, Point( 5, 5, 5 ), 2 );
67 Shapes<Domain>::addNorm2Ball( shape_set, Point( 3, 3, 3 ), 2 );
68
69 shape_set.erase(Point(3,3,3));
70 shape_set.erase(Point(6,6,6));
71
72 // example with wireframe mode
73 board << SetMode3D(board.className(), "WireFrameMode");
74
75 board << shape_set;
76
77 board << CameraPosition(5.000000, 5.000000, 15)
78 << CameraDirection(0.000000, 0.000000, -1.000000)
79 << CameraUpVector(0.000000, 1.000000, 0.000000);
80
81 board.saveCairo("dgtalBoard3DTo2D-2bis-sets-wireframe.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
std::string className() const
Definition: Board3DTo2D.h:106
void saveCairo(const char *filename, CairoType type, int bWidth, int bHeight)
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
Space::Point Point
Definition: StdDefs.h:168
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
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)
Domain domain