DGtal  0.9.2
dgtalBoard2D-1-points.cpp
1 
30 #include <iostream>
32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/boards/Board2D.h"
34 #include "DGtal/helpers/StdDefs.h"
36 
37 using namespace std;
38 using namespace DGtal;
39 using namespace DGtal::Z2i;
40 
42 
43 int main()
44 {
45  trace.beginBlock ( "Example dgtalBoard2D-1-points" );
46 
47  Point p1( -3, -2 );
48  Point p2( 7, 3 );
49  Point p3( 0, 0 );
50  Domain domain( p1, p2 );
51 
52  Board2D board;
53  board << domain << p1 << p2 << p3;
54 
55  board.saveSVG("dgtalBoard2D-1-points.svg");
56  board.saveEPS("dgtalBoard2D-1-points.eps");
57  board.saveTikZ("dgtalBoard2D-1-points.tikz");
58 
59 #ifdef WITH_CAIRO
60  board.saveCairo("dgtalBoard2D-1-points-cairo.pdf", Board2D::CairoPDF);
61  board.saveCairo("dgtalBoard2D-1-points-cairo.png", Board2D::CairoPNG);
62  board.saveCairo("dgtalBoard2D-1-points-cairo.ps", Board2D::CairoPS);
63  board.saveCairo("dgtalBoard2D-1-points-cairo.svg", Board2D::CairoSVG);
64 #endif
65 
66  trace.endBlock();
67  return 0;
68 }
69 // //
void beginBlock(const std::string &keyword="")
Trace trace
Definition: Common.h:130
STL namespace.
double endBlock()
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1139
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1219
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:1012
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...
Definition: Board2D.h:70