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"
53 unsigned int nbok = 0;
56 trace.beginBlock (
"Testing class SimpleBoard" );
67 board.
saveSVG(
"simpleboard.svg" );
68 board.
saveFIG(
"simpleboard.fig" );
69 board.
saveEPS(
"simpleboard.eps" );
70 board.
saveTikZ(
"simpleboard.tikz" );
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;
104 trace.beginBlock (
"HyperRectDomain Iterator" );
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;
133 trace.beginBlock (
"Testing Display Image with Board " );
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" );
141#ifdef DGTAL_WITH_CAIRO
155int main(
int argc,
char** argv )
157 trace.beginBlock (
"Testing class SimpleBoard" );
158 trace.info() <<
"Args:";
159 for (
int i = 0; i < argc; ++i )
160 trace.info() <<
" " << argv[ i ];
161 trace.info() << endl;
163 bool res = testSimpleBoard() && testDomain() &&
testImage();
164 trace.emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: Implements basic operations that will be used in Point and Vector classes.
void drawRectangle(double x, double y, double width, double height, int depthValue=-1)
void saveTikZ(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveFIG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const
void fillCircle(double x, double y, double radius, int depthValue=-1)
Board & setPenColorRGBi(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void drawImage(std::string filename, double x, double y, double width, double height, int depthValue=-1, double alpha=1.0)
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Shape & scale(double sx, double sy)
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
static void draw(DGtal::Board2D &board, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Struct representing a 2D point.
bool testImage(const Image &aImage)