31 #include "DGtal/base/Common.h"
32 #include "DGtal/kernel/PointVector.h"
33 #include "DGtal/kernel/SpaceND.h"
34 #include "DGtal/kernel/domains/HyperRectDomain.h"
35 #include "DGtal/io/boards/Board2D.h"
36 #include "ConfigTest.h"
41 using namespace DGtal;
51 bool testSimpleBoard()
53 unsigned int nbok = 0;
67 board.
saveSVG(
"simpleboard.svg" );
68 board.
saveFIG(
"simpleboard.fig" );
69 board.
saveEPS(
"simpleboard.eps" );
70 board.
saveTikZ(
"simpleboard.tikz" );
84 Display2DFactory::draw(board, apoint, p2);
88 board.
saveSVG(
"pointsimpleboard.svg" );
89 board.
saveFIG(
"pointsimpleboard.fig" );
90 board.
saveEPS(
"pointsimpleboard.eps" );
91 board.
saveTikZ(
"pointsimpleboard.tikz" );
100 typedef TSpace::Point
Point;
109 board <<
SetMode( myDomain.className(),
"Grid" ) << myDomain;
111 board.
saveSVG(
"domain-grid.svg" );
112 board.
saveTikZ(
"domain-grid.tikz" );
115 b2 <<
SetMode( myDomain.className(),
"Paving" ) << myDomain;
117 b2.
saveSVG(
"domain-paving.svg" );
118 b2.
saveTikZ(
"domain-paving.tikz" );
131 unsigned int nbok = 0;
136 std::string filenameImage1 = testPath +
"samples/contourS.png";
137 board.
drawImage(filenameImage1, 0, 85, 185, 85);
138 board.
saveFIG(
"boardTestDisplayImage.fig");
139 board.
saveSVG(
"boardTestDisplayImage.svg");
140 board.
saveTikZ(
"boardTestDisplayImage.tikz" );
142 board.
saveCairo(
"boardTestDisplayImageCAIRO.eps", Board2D::CairoEPS );
143 board.
saveCairo(
"boardTestDisplayImageCAIRO.pdf", Board2D::CairoPDF );
144 board.
saveCairo(
"boardTestDisplayImageCAIRO.png", Board2D::CairoPNG );
155 int main(
int argc,
char** argv )
159 for (
int i = 0; i < argc; ++i )
163 bool res = testSimpleBoard() && testDomain() && testImage();
164 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
Aim: SpaceND is a utility class that defines the fundamental structure of a Digital Space in ND...
Shape & scale(double sx, double sy)
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
void drawImage(std::string filename, double x, double y, double width, double height, int depthValue=-1, double alpha=1.0)
Aim: Implements basic operations that will be used in Point and Vector classes.
void saveFIG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
Struct representing a 2D point.
void fillCircle(double x, double y, double radius, int depthValue=-1)
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void drawRectangle(double x, double y, double width, double height, int depthValue=-1)
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
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Modifier class in a Board2D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithBoard2D.
Board & setPenColorRGBi(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...