DGtal 1.4.0
Loading...
Searching...
No Matches
io/boards/dgtalBoard2D-1-points.cpp

This simple example shows the basic usage of a Board2D to export graphical representations of dgtal objects (here, a HyperRectDomain and three points exported as SVG and EPS).

visualization of one of the resulting export.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/helpers/StdDefs.h"
using namespace std;
using namespace DGtal;
using namespace DGtal::Z2i;
int main()
{
trace.beginBlock ( "Example dgtalBoard2D-1-points" );
Point p1( -3, -2 );
Point p2( 7, 3 );
Point p3( 0, 0 );
Domain domain( p1, p2 );
Board2D board;
board << domain << p1 << p2 << p3;
board.saveSVG("dgtalBoard2D-1-points.svg");
board.saveEPS("dgtalBoard2D-1-points.eps");
board.saveTikZ("dgtalBoard2D-1-points.tikz");
#ifdef WITH_CAIRO
board.saveCairo("dgtalBoard2D-1-points-cairo.pdf", Board2D::CairoPDF);
board.saveCairo("dgtalBoard2D-1-points-cairo.png", Board2D::CairoPNG);
board.saveCairo("dgtalBoard2D-1-points-cairo.ps", Board2D::CairoPS);
board.saveCairo("dgtalBoard2D-1-points-cairo.svg", Board2D::CairoSVG);
#endif
trace.endBlock();
return 0;
}
// //
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition Board2D.h:71
void beginBlock(const std::string &keyword="")
double endBlock()
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition Board.cpp:1218
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition Board.cpp:804
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition Board.cpp:1011
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition Board.cpp:1138
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
STL namespace.
int main()
Definition testBits.cpp:56
MyPointD Point
Domain domain
HyperRectDomain< Space > Domain