DGtal  0.9.3
testArcDrawing.cpp
1 #include "DGtal/base/Common.h"
2 #include "DGtal/helpers/StdDefs.h"
3 #include "DGtal/io/boards/Board2D.h"
4 
5 
7 
8 using namespace std;
9 using namespace DGtal;
10 using namespace Z2i;
11 
12 int main(int /*argc*/, char** /*argv*/)
13 {
14 
15 
16 
18  Board2D board;
19  board.setUnit(Board2D::UCentimeter);
20  board.drawArc(0.0, 1.0, 5.0, 0, M_PI/2.0, false);
21  board.drawArc(0.0, 1.0, 4.0, 0, M_PI/2.0, true);
22  board.drawArc(0.0, 1.0, 3.0, -0.5, M_PI/2.0-0.5, false);
23  board.drawArc(0.0, 1.0, 2.0, 0.5, M_PI/2.0+0.5, false);
24  board.saveEPS( "essai.eps" );
25  board.saveSVG( "essai.svg" );
26  board.saveTikZ( "essai.tikz" );
27 #ifdef WITH_CAIRO
28  board.saveCairo("essai.pdf", Board2D::CairoPDF);
29 #endif
30 
32  return 0;
33 }
34 
STL namespace.
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1012
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1139
void drawArc(double x, double y, double radius, double angle1, double angle2, bool neg, int depthValue=-1)
Definition: Board.cpp:461
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.
void setUnit(Unit unit)
Definition: Board.cpp:240
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1219
Aim: This class specializes a &#39;Board&#39; class so as to display DGtal objects more naturally (with <<)...
Definition: Board2D.h:70