DGtal
1.5.beta
|
Class for EPS, FIG or SVG drawings. More...
#include <Board/Board.h>
Data Structures | |
struct | State |
Public Types | |
enum | CairoType { CairoPDF , CairoPNG , CairoPS , CairoEPS , CairoSVG } |
enum | PageSize { BoundingBox , A4 , Letter } |
enum | Unit { UPoint , UInche , UCentimeter , UMillimeter } |
Public Types inherited from LibBoard::Shape | |
enum | LineCap { ButtCap = 0 , RoundCap , SquareCap } |
enum | LineJoin { MiterJoin = 0 , RoundJoin , BevelJoin } |
enum | LineStyle { SolidStyle = 0 , DashStyle , DotStyle , DashDotStyle , DashDotDotStyle , DashDotDotDotStyle } |
Public Member Functions | |
Board (const DGtal::Color &backgroundColor=DGtal::Color::None) | |
Board (const Board &other) | |
~Board () | |
Board & | operator= (const Board &other) |
Board & | operator<< (const Shape &shape) |
Board & | operator<< (Unit unit) |
void | clear (const DGtal::Color &color=DGtal::Color::None) |
void | clear (unsigned char red, unsigned char green, unsigned char blue) |
Shape & | rotate (double angle, const Point ¢er) |
Shape & | rotate (double angle) |
Shape & | translate (double dx, double dy) |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Board | rotated (double angle, const Point ¢er) |
Board | rotated (double angle) |
Board | translated (double dx, double dy) |
Board | scaled (double sx, double sy) |
Board | scaled (double s) |
void | setUnit (Unit unit) |
void | setUnit (double factor, Unit unit) |
void | drawDot (double x, double y, int depthValue=-1) |
void | drawLine (double x1, double y1, double x2, double y2, int depthValue=-1) |
void | drawQuadraticBezierCurve (double x1, double y1, double x2, double y2, double x3, double y3, int depthValue=-1) |
void | drawArrow (double x1, double y1, double x2, double y2, bool filled=true, int depthValue=-1) |
void | drawTriangle (double x1, double y1, double x2, double y2, double x3, double y3, int depthValue=-1) |
void | drawTriangle (const Point &p1, const Point &p2, const Point &p3, int depthValue=-1) |
void | drawArc (double x, double y, double radius, double angle1, double angle2, bool neg, int depthValue=-1) |
void | fillTriangle (double x1, double y1, double x2, double y2, double x3, double y3, int depthValue=-1) |
void | fillGouraudTriangle (const Point &p1, const DGtal::Color &color1, const Point &p2, const DGtal::Color &color2, const Point &p3, const DGtal::Color &color3, unsigned char divisions=3, int depthValue=-1) |
void | fillGouraudTriangle (const double x1, const double y1, const DGtal::Color &color1, const double x2, const double y2, const DGtal::Color &color2, const double x3, const double y3, const DGtal::Color &color3, unsigned char divisions=3, int depthValue=-1) |
void | fillGouraudTriangle (const Point &p1, const float brightness1, const Point &p2, const float brightness2, const Point &p3, const float brightness3, unsigned char divisions=3, int depthValue=-1) |
void | fillGouraudTriangle (const double x1, const double y1, const float brightness1, const double x2, const double y2, const float brightness2, const double x3, const double y3, const float brightness3, unsigned char divisions=3, int depthValue=-1) |
void | fillTriangle (const Point &p1, const Point &p2, const Point &p3, int depthValue=-1) |
void | drawRectangle (double x, double y, double width, double height, int depthValue=-1) |
void | drawImage (std::string filename, double x, double y, double width, double height, int depthValue=-1, double alpha=1.0) |
void | fillRectangle (double x, double y, double width, double height, int depthValue=-1) |
void | drawCircle (double x, double y, double radius, int depthValue=-1) |
void | fillCircle (double x, double y, double radius, int depthValue=-1) |
void | drawEllipse (double x, double y, double xRadius, double yRadius, int depthValue=-1) |
void | fillEllipse (double x, double y, double xRadius, double yRadius, int depthValue=-1) |
void | drawPolyline (const std::vector< Point > &points, int depthValue=-1) |
void | drawClosedPolyline (const std::vector< Point > &points, int depthValue=-1) |
void | fillPolyline (const std::vector< Point > &points, int depthValue=-1) |
void | drawText (double x, double y, const char *text, int depthValue=-1) |
void | drawText (double x, double y, const std::string &str, int depthValue=-1) |
Board & | setFont (const Fonts::Font font, double fontSize) |
Board & | setFontSize (double fontSize) |
Board & | setPenColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255) |
Board & | setPenColorRGBf (float red, float green, float blue, float alpha=1.0f) |
Board & | setPenColor (const DGtal::Color &color) |
Board & | setFillColorRGBi (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255) |
Board & | setFillColorRGBf (float red, float green, float blue, float alpha=1.0f) |
Board & | setFillColor (const DGtal::Color &color) |
Board & | setLineWidth (double width) |
Board & | setLineStyle (Shape::LineStyle style) |
Board & | setLineCap (Shape::LineCap cap) |
Board & | setLineJoin (Shape::LineJoin join) |
void | backgroundColor (const DGtal::Color &color) |
void | drawBoundingBox (int depthValue=-1) |
void | setClippingRectangle (double x, double y, double width, double height) |
void | setClippingPath (const std::vector< Point > &points) |
void | setClippingPath (const Path &path) |
void | addDuplicates (const Shape &shape, unsigned int times, double dx, double dy, double scale=1.0) |
void | addDuplicates (const Shape &shape, unsigned int times, double dx, double dy, double scaleX, double scaleY, double angle=0.0) |
void | save (const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | save (const char *filename, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveEPS (const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveEPS (std::ostream &out, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveEPS (const char *filename, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveEPS (std::ostream &out, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveFIG (const char *filename, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const |
void | saveFIG (std::ostream &out, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const |
void | saveFIG (const char *filename, double pageWidth, double pageHeight, double margin=10.0, bool includeFIGHeader=true) const |
void | saveFIG (std::ostream &out, double pageWidth, double pageHeight, double margin=10.0, bool includeFIGHeader=true) const |
void | saveSVG (const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveSVG (std::ostream &out, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveSVG (const char *filename, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveSVG (std::ostream &out, double pageWidth, double pageHeight, double margin=10.0, std::string filename="output.svg") const |
void | saveCairo (const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveCairo (const char *filename, CairoType type, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveTikZ (const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveTikZ (std::ostream &out, PageSize size=Board::BoundingBox, double margin=10.0) const |
void | saveTikZ (const char *filename, double pageWidth, double pageHeight, double margin=10.0) const |
void | saveTikZ (std::ostream &out, double pageWidth, double pageHeight, double margin=10.0) const |
Public Member Functions inherited from LibBoard::ShapeList | |
ShapeList (int depth=-1) | |
ShapeList (const ShapeList &other) | |
~ShapeList () | |
const std::string & | name () const |
ShapeList & | clear () |
Point | center () const |
Shape & | rotate (double angle, const Point ¢er) |
ShapeList | rotated (double angle, const Point ¢er) |
Shape & | rotate (double angle) |
ShapeList | rotated (double angle) |
Shape & | translate (double dx, double dy) |
ShapeList | translated (double dx, double dy) |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
ShapeList | scaled (double sx, double sy) |
ShapeList | scaled (double s) |
void | scaleAll (double s) |
void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
void | flushCairo (cairo_t *cr, const TransformCairo &transform) const |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const |
Rect | boundingBox () const |
virtual int | minDepth () const |
virtual int | maxDepth () const |
void | shiftDepth (int shift) |
Shape * | clone () const |
ShapeList & | operator= (const ShapeList &other) |
ShapeList & | operator<< (const Shape &shape) |
ShapeList & | operator+= (const Shape &shape) |
ShapeList & | insert (const Shape &shape, int depth) |
ShapeList & | dup (unsigned int copies=1) |
template<typename T > | |
T & | last (const unsigned int position=0) |
Shape & | last (const unsigned int position=0) |
Shape & | top () |
Public Member Functions inherited from LibBoard::Shape | |
Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth) | |
virtual | ~Shape () |
bool | filled () const |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
Rect | bbox () |
Shape & | operator-- () |
Shape & | operator++ () |
int | depth () const |
virtual void | depth (int) |
const DGtal::Color & | penColor () const |
const DGtal::Color & | fillColor () const |
Static Public Attributes | |
static const double | Degree = 3.14159265358979323846 / 180.0 |
Protected Attributes | |
State | _state |
DGtal::Color | _backgroundColor |
Path | _clippingPath |
Protected Attributes inherited from LibBoard::ShapeList | |
std::vector< Shape * > | _shapes |
int | _nextDepth |
Protected Attributes inherited from LibBoard::Shape | |
int | _depth |
DGtal::Color | _penColor |
DGtal::Color | _fillColor |
double | _lineWidth |
LineStyle | _lineStyle |
LineCap | _lineCap |
LineJoin | _lineJoin |
Additional Inherited Members | |
Protected Member Functions inherited from LibBoard::ShapeList | |
void | addShape (const Shape &shape, double scaleFactor) |
void | free () |
Protected Member Functions inherited from LibBoard::Shape | |
std::string | svgProperties (const TransformSVG &transform) const |
std::string | postscriptProperties () const |
void | setCairoDashStyle (cairo_t *cr, LineStyle type) const |
std::string | tikzProperties (const TransformTikZ &transform) const |
LibBoard::Board::Board | ( | const DGtal::Color & | backgroundColor = DGtal::Color::None | ) |
Constructs a new board and sets the background color, if any.
backgroundColor | A color for the drawing's background. |
Definition at line 103 of file Board.cpp.
Referenced by rotated(), scaled(), and translated().
LibBoard::Board::Board | ( | const Board & | other | ) |
void LibBoard::Board::addDuplicates | ( | const Shape & | shape, |
unsigned int | times, | ||
double | dx, | ||
double | dy, | ||
double | scale = 1.0 |
||
) |
Insert duplicates of a shape, n times, starting at its current position and iterating given translations and scalings.
shape | The shape to be duplicated. |
times | The number of duplicates. |
dx | The x shift. |
dy | The y shift. |
scale | A scale factor between each copy. |
Definition at line 766 of file Board.cpp.
References LibBoard::Shape::clone(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().
void LibBoard::Board::addDuplicates | ( | const Shape & | shape, |
unsigned int | times, | ||
double | dx, | ||
double | dy, | ||
double | scaleX, | ||
double | scaleY, | ||
double | angle = 0.0 |
||
) |
Insert duplicates of a shape, n times, starting at its current position and iterating a given translation.
shape | The shape to be duplicated. |
times | The number of duplicates. |
dx | The x shift. |
dy | The y shift. |
scaleX | An x scale factor between each copy. |
scaleY | A y scale factor between each copy. |
angle | An angular increment. |
Definition at line 781 of file Board.cpp.
References LibBoard::Shape::clone(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().
void LibBoard::Board::backgroundColor | ( | const DGtal::Color & | color | ) |
Changes the background color of the whole drawing.
color | A color (may be Color::None). |
Definition at line 350 of file Board.cpp.
References _backgroundColor.
void LibBoard::Board::clear | ( | const DGtal::Color & | color = DGtal::Color::None | ) |
Clears the board with a given background color.
color | The board background color (may be Color::None). |
Definition at line 151 of file Board.cpp.
References _backgroundColor, and LibBoard::ShapeList::clear().
Referenced by checkCut(), checkOutputConvexHullBorder(), convexHull(), drawComplex(), exampleStandardDSS(), main(), moduleImages_example(), specificTestLatticePolytope2D(), testBoard2D(), testBoard2DCustomStyle(), testCellDrawOnBoard(), testChessboard(), testCMAP(), testDepthFirstPropagation(), testDigitalSetBoardSnippet(), testDistanceTransformation(), testDistanceTransformationBorder(), testDistanceTransformationNeg(), testDTFromSet(), testGetSetVal(), testImageAdapter(), testImplicitShape(), testKanungo2D(), testLatticePolytope2D(), testLayers(), testObjectBorder(), testSimpleExpander(), testSimplePoints2D(), and testVoronoiMap().
void LibBoard::Board::clear | ( | unsigned char | red, |
unsigned char | green, | ||
unsigned char | blue | ||
) |
Clears the board and set the background color from an RGB triple.
red | red |
green | green |
blue | blue |
void LibBoard::Board::drawArc | ( | double | x, |
double | y, | ||
double | radius, | ||
double | angle1, | ||
double | angle2, | ||
bool | neg, | ||
int | depthValue = -1 |
||
) |
Draws an arc.
x | First coordinate of the arc center. |
y | Second coordinate of the arc center. |
radius | arc radius. |
angle1 | first angle. |
angle2 | second angle. |
neg | neg |
depthValue | Depth of the arc. |
Definition at line 460 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawArrow | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
bool | filled = true , |
||
int | depthValue = -1 |
||
) |
Draws a line from (x1,y1) to (x2,y2) with an arrow at (x2,y2).
x1 | First coordinate of the first extremity. |
y1 | Second coordinate of the first extremity. |
x2 | First coordinate of the second extremity. |
y2 | Second coordinate of the second extremity. |
filled | Whether or not the arrow is filled. |
depthValue | Depth of the line. |
Definition at line 399 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by drawArithmeticalDSL(), exampleNaiveDSL(), exampleStandardDSL(), and exampleUpdate().
void LibBoard::Board::drawBoundingBox | ( | int | depthValue = -1 | ) |
Draws the current drawing's bounding box as a rectangle.
depthValue | The depth of the rectangle. |
Definition at line 709 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::ShapeList::boundingBox(), LibBoard::Board::State::fillColor, LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, LibBoard::Rect::top, LibBoard::Board::State::unit(), and LibBoard::Rect::width.
void LibBoard::Board::drawCircle | ( | double | x, |
double | y, | ||
double | radius, | ||
int | depthValue = -1 |
||
) |
Draws a circle.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
radius | Radius of the circle. |
depthValue | Depth of the circle. |
Definition at line 450 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by convexHull(), testAlphaThickSegmentFreeman(), testConvexHullCompThickness(), and testThicknessDefinitions().
void LibBoard::Board::drawClosedPolyline | ( | const std::vector< Point > & | points, |
int | depthValue = -1 |
||
) |
Draws a closed polygonal line.
points | A vector of points. |
depthValue | The depth of the polyline. |
Definition at line 530 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawDot | ( | double | x, |
double | y, | ||
int | depthValue = -1 |
||
) |
Draws a dot at coordinates (x,y).
x | First coordinate of the dot. |
y | Second coordinate of the dot. |
depthValue | Depth of the line. |
Definition at line 356 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius, | ||
int | depthValue = -1 |
||
) |
Draws an ellipse.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
xRadius | Radius of the circle. |
yRadius | Radius of the circle. |
depthValue | Depth of the circle. |
Definition at line 481 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawImage | ( | std::string | filename, |
double | x, | ||
double | y, | ||
double | width, | ||
double | height, | ||
int | depthValue = -1 , |
||
double | alpha = 1.0 |
||
) |
Draws an image.
filename | filename |
x | First coordinate of the upper left corner. |
y | Second coordinate of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
depthValue | Depth of the rectangle. |
alpha | Transparency used in the image display. |
Definition at line 427 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, and LibBoard::Board::State::unit().
Referenced by main().
void LibBoard::Board::drawLine | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
int | depthValue = -1 |
||
) |
Draws a line from (x1,y1) to (x2,y2).
x1 | First coordinate of the first extremity. |
y1 | Second coordinate of the first extremity. |
x2 | First coordinate of the second extremity. |
y2 | Second coordinate of the second extremity. |
depthValue | Depth of the line. |
Definition at line 367 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by convexHull(), main(), testAlphaThickSegmentComputerFloatingPointContour(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSpecialInit(), testConvexHullCompThickness(), and testThicknessDefinitions().
void LibBoard::Board::drawPolyline | ( | const std::vector< Point > & | points, |
int | depthValue = -1 |
||
) |
Draws a polygonal line.
points | A vector of points. |
depthValue | The depth of the polyline. |
Definition at line 510 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawQuadraticBezierCurve | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3, | ||
int | depthValue = -1 |
||
) |
Draws a quadratic Bezier curve from (x1,y1) to (x3,y3), with (x2,y2) as middle control point.
x1 | First coordinate of the first point. |
y1 | Second coordinate of the first point. |
x2 | First coordinate of the middle point. |
y2 | Second coordinate of the middle point. |
x3 | First coordinate of the last point. |
y3 | Second coordinate of the last point. |
depthValue | Depth of the line. |
Definition at line 383 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by main().
void LibBoard::Board::drawRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height, | ||
int | depthValue = -1 |
||
) |
Draws a rectangle.
x | First coordinate of the upper left corner. |
y | Second coordinate of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
depthValue | Depth of the rectangle. |
Definition at line 416 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by addColorMapSample().
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const char * | text, | ||
int | depthValue = -1 |
||
) |
Draws a string of text.
x | The first coordinates of the lower left corner. |
y | The second coordinates of the lower left corner. |
text | The text. |
depthValue | The depth of the text. |
Definition at line 692 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by addColorMapSample().
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const std::string & | str, | ||
int | depthValue = -1 |
||
) |
Draws a string of text.
x | The first coordinates of the lower left corner. |
y | The second coordinates of the lower left corner. |
str | The text. |
depthValue | The depth of the text. |
Definition at line 701 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::drawTriangle | ( | const Point & | p1, |
const Point & | p2, | ||
const Point & | p3, | ||
int | depthValue = -1 |
||
) |
Draws a triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
depthValue | Depth of the triangle. |
Definition at line 589 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, LibBoard::Board::State::unit(), LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::drawTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3, | ||
int | depthValue = -1 |
||
) |
Draws a triangle.
x1 | First coordinate of the first vertex. |
y1 | Second coordinate of the first vertex. |
x2 | First coordinate of the second vertex. |
y2 | Second coordinate of the second vertex. |
x3 | First coordinate of the third vertex. |
y3 | Second coordinate of the third vertex. |
depthValue | Depth of the triangle. |
Definition at line 570 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::fillCircle | ( | double | x, |
double | y, | ||
double | radius, | ||
int | depthValue = -1 |
||
) |
Draws a circle filled with the current pen color.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
radius | Radius of the circle. |
depthValue | Depth of the circle. |
Definition at line 470 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by main(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSegmentFreeman(), and testAlphaThickSpecialInit().
void LibBoard::Board::fillEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius, | ||
int | depthValue = -1 |
||
) |
Draws an ellipse filled with the current pen color.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
xRadius | X axis radius of the ellipse. |
yRadius | Y axis radius of the ellipse. |
depthValue | Depth of the circle. |
Definition at line 496 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::fillGouraudTriangle | ( | const double | x1, |
const double | y1, | ||
const DGtal::Color & | color1, | ||
const double | x2, | ||
const double | y2, | ||
const DGtal::Color & | color2, | ||
const double | x3, | ||
const double | y3, | ||
const DGtal::Color & | color3, | ||
unsigned char | divisions = 3 , |
||
int | depthValue = -1 |
||
) |
Draws a triangle with Gouraud-like shaded colors.
x1 | x1 |
y1 | y1 |
color1 | color1 |
x2 | x2 |
y2 | y2 |
color2 | color2 |
x3 | x3 |
y3 | y3 |
color3 | color3 |
divisions | number of subdivisions |
depthValue | depth |
void LibBoard::Board::fillGouraudTriangle | ( | const double | x1, |
const double | y1, | ||
const float | brightness1, | ||
const double | x2, | ||
const double | y2, | ||
const float | brightness2, | ||
const double | x3, | ||
const double | y3, | ||
const float | brightness3, | ||
unsigned char | divisions = 3 , |
||
int | depthValue = -1 |
||
) |
Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.
x1 | x1 |
y1 | y1 |
brightness1 | b1 |
x2 | x2 |
y2 | y2 |
brightness2 | b2 |
x3 | x3 |
y3 | y3 |
brightness3 | b3 |
divisions | number of sudivisions |
depthValue | depth |
void LibBoard::Board::fillGouraudTriangle | ( | const Point & | p1, |
const DGtal::Color & | color1, | ||
const Point & | p2, | ||
const DGtal::Color & | color2, | ||
const Point & | p3, | ||
const DGtal::Color & | color3, | ||
unsigned char | divisions = 3 , |
||
int | depthValue = -1 |
||
) |
Draws a triangle with Gouraud-like shaded colors.
p1 | p1 |
color1 | color1 |
p2 | p2 |
color2 | color2 |
p3 | p3 |
color3 | color3 |
divisions | number of triangle subdivisions. |
depthValue | The depth of the triangle. |
Definition at line 646 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::unit(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by fillGouraudTriangle().
void LibBoard::Board::fillGouraudTriangle | ( | const Point & | p1, |
const float | brightness1, | ||
const Point & | p2, | ||
const float | brightness2, | ||
const Point & | p3, | ||
const float | brightness3, | ||
unsigned char | divisions = 3 , |
||
int | depthValue = -1 |
||
) |
Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.
p1 | p1 |
brightness1 | brightness1 |
p2 | p2 |
brightness2 | brightness2 |
p3 | p3 |
brightness3 | brightness3 |
divisions | number of triangle subdivisions. |
depthValue | The depth of the triangle. |
Definition at line 663 of file Board.cpp.
References _state, DGtal::Color::blue(), fillGouraudTriangle(), DGtal::Color::green(), LibBoard::Board::State::penColor, DGtal::Color::red(), LibBoard::Board::State::unit(), LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::fillPolyline | ( | const std::vector< Point > & | points, |
int | depthValue = -1 |
||
) |
Draws a filled polygon.
points | A vector of points. |
depthValue | The depth of the polygon. |
Definition at line 550 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Referenced by main().
void LibBoard::Board::fillRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height, | ||
int | depthValue = -1 |
||
) |
Draws a rectangle filled with the current pen color.
x | First coordinate of the upper left corner. |
y | Second coordinate of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
depthValue | Depth of the rectangle. |
Definition at line 438 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
void LibBoard::Board::fillTriangle | ( | const Point & | p1, |
const Point & | p2, | ||
const Point & | p3, | ||
int | depthValue = -1 |
||
) |
Draws a filled triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
depthValue | Depth of the triangle. |
Definition at line 627 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, LibBoard::Board::State::unit(), LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::fillTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3, | ||
int | depthValue = -1 |
||
) |
Draws a filled triangle.
x1 | First coordinate of the first vertex. |
y1 | Second coordinate of the first vertex. |
x2 | First coordinate of the second vertex. |
y2 | Second coordinate of the second vertex. |
x3 | First coordinate of the third vertex. |
y3 | Second coordinate of the third vertex. |
depthValue | Depth of the triangle. |
Definition at line 608 of file Board.cpp.
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, DGtal::Color::None, LibBoard::Board::State::penColor, and LibBoard::Board::State::unit().
Add a shape to the board, using the current unit factor.
shape | A shape. (Might be a list of shapes, actually!) |
Definition at line 131 of file Board.cpp.
References _state, LibBoard::ShapeList::addShape(), and LibBoard::Board::State::unitFactor.
The operator =
other | The object to be copied. |
Definition at line 116 of file Board.cpp.
References LibBoard::ShapeList::_shapes, and LibBoard::ShapeList::free().
Referenced by DGtal::Board2D::operator=().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Definition at line 167 of file Board.cpp.
References _clippingPath, LibBoard::ShapeList::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
Definition at line 159 of file Board.cpp.
References _clippingPath, LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Board LibBoard::Board::rotated | ( | double | angle | ) |
Definition at line 214 of file Board.cpp.
References Board().
void LibBoard::Board::save | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Save the drawing in an EPS, XFIG or SVG file depending on the filename extension. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | Path of the file to be created. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1107 of file Board.cpp.
References saveEPS(), saveFIG(), saveSVG(), and saveTikZ().
void LibBoard::Board::save | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing in an EPS, XFIG or SVG file depending on the filename extension. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | Path of the file to be created. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1131 of file Board.cpp.
void LibBoard::Board::saveCairo | ( | const char * | filename, |
CairoType | type, | ||
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Save the drawing with cairo. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the file. |
type | Output type: CairoPDF, CairoPNG, CairoPS, CairoSVG. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1143 of file Board.cpp.
References _backgroundColor, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), CairoEPS, CairoPDF, CairoPNG, CairoPS, CairoSVG, LibBoard::Rect::height, DGtal::Color::None, LibBoard::shapeGreaterDepth(), LibBoard::Path::size(), surface, and LibBoard::Rect::width.
void LibBoard::Board::saveCairo | ( | const char * | filename, |
CairoType | type = CairoPNG , |
||
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing with cairo. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the file. |
type | Output type: CairoPDF, CairoPNG, CairoPS, CairoSVG. |
size | the page size. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1138 of file Board.cpp.
Referenced by alphaShape(), convexHull(), drawArithmeticalDSL(), exampleNaiveDSL(), exampleNaiveDSS(), exampleStandardDSL(), exampleStandardDSS(), exampleUpdate(), main(), testDisplay(), testExactMetricBalls(), testImageAdapter(), and testInexactMetricBalls().
void LibBoard::Board::saveEPS | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Saves the drawing in an EPS file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The EPS file name. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 811 of file Board.cpp.
References saveEPS().
void LibBoard::Board::saveEPS | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Saves the drawing in an EPS file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The EPS file name. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 804 of file Board.cpp.
Referenced by checkCut(), checkOutputConvexHullBorder(), drawingTestStabbingCircleComputer(), drawingTestStabbingLineComputer(), greedySegmentationVisualTest(), main(), SaturatedSegmentationVisualTest(), save(), saveEPS(), specificTestLatticePolytope2D(), testAlphaThickSegmentComputerFloatingPointContour(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSegmentFreeman(), testAlphaThickSpecialInit(), testAngleLinearMinimizer(), testBreadthFirstPropagation(), testCellDrawOnBoard(), testCMAP(), testComputeInterior(), testConvexHullCompThickness(), testDepthFirstPropagation(), testDigitization(), testDisplay(), testDistancePropagation(), testLatticePolytope2D(), testMultiWidth(), testPNMReader(), testSegmentation(), testSegmentationLarger(), testSurfelAdjacency(), and testThicknessDefinitions().
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Saves the drawing in an EPS format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 819 of file Board.cpp.
References _backgroundColor, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::flushPostscript(), LibBoard::Rect::height, LibBoard::Rect::left, DGtal::Color::None, LibBoard::secured_ctime(), LibBoard::TransformEPS::setBoundingBox(), LibBoard::shapeGreaterDepth(), LibBoard::Path::size(), LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Saves the drawing in EPS format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 798 of file Board.cpp.
References saveEPS().
void LibBoard::Board::saveFIG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 , |
||
bool | includeFIGHeader = true |
||
) | const |
Saves the drawing in an XFig file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The XFig file name. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
includeFIGHeader | Indicates if the header is included in the output stream. Useful to merge several XFIG figures (default true) |
Definition at line 916 of file Board.cpp.
References saveFIG().
void LibBoard::Board::saveFIG | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 , |
||
bool | includeFIGHeader = true |
||
) | const |
Saves the drawing in an XFig file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the FIG file. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
includeFIGHeader | Indicates if the header is included in the exported file. Useful to merge several XFIG figures (default true) |
Definition at line 906 of file Board.cpp.
Referenced by main(), save(), saveFIG(), and testDisplay().
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 , |
||
bool | includeFIGHeader = true |
||
) | const |
Saves the drawing in an XFig format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | out The output stream. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
includeFIGHeader | Indicates if the header is included in the output stream. Useful to merge several XFIG figures (default true) |
Definition at line 925 of file Board.cpp.
References _backgroundColor, LibBoard::ShapeList::_shapes, LibBoard::ShapeList::boundingBox(), max(), DGtal::Color::None, LibBoard::shapeGreaterDepth(), and DGtal::Color::valid().
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 , |
||
bool | includeFIGHeader = true |
||
) | const |
Saves the drawing in XFig format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
includeFIGHeader | Indicates if the header is included in the output stream. Useful to merge several XFIG figures (default true) |
Definition at line 911 of file Board.cpp.
References saveFIG().
void LibBoard::Board::saveSVG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Saves the drawing in an SVG file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The SVG file name. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1024 of file Board.cpp.
References saveSVG().
void LibBoard::Board::saveSVG | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing in an SVG file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the file. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1011 of file Board.cpp.
Referenced by alphaShape(), convexHull(), exampleNaiveDSL(), exampleNaiveDSS(), exampleStandardDSL(), exampleStandardDSS(), exampleUpdate(), main(), moduleImages_example(), save(), saveSVG(), saveVoroMap(), showGreedySegmantation(), test_linear_ring(), test_linear_structure(), test_manual_operators_2d(), testBIGINTEGERSpace(), testBoard2D(), testBoard2DCustomStyle(), testCellDrawOnBoard(), testChessboard(), testDigitalSetBoardSnippet(), testDigitalSetDraw(), testDigitization(), testDisplay(), testDistanceTransformation(), testDistanceTransformationBorder(), testDistanceTransformationNeg(), testDraw(), testDSS4drawing(), testDSS8drawing(), testDTFromSet(), testGetSetVal(), testImageAdapter(), testImplicitShape(), testKanungo2D(), testLatticePolytope2D(), testLayers(), testObjectBorder(), testPNMWriter(), testSegmentation(), testSimpleExpander(), testSimplePoints2D(), testSurfelAdjacency(), and testVoronoiMap().
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 , |
||
std::string | filename = "output.svg" |
||
) | const |
Saves the drawing in an SVG format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
filename | default filename |
Definition at line 1034 of file Board.cpp.
References _backgroundColor, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::flushSVGCommands(), LibBoard::Rect::height, DGtal::Color::None, LibBoard::shapeGreaterDepth(), LibBoard::Path::size(), and LibBoard::Rect::width.
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing in an SVG format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1017 of file Board.cpp.
References saveSVG().
void LibBoard::Board::saveTikZ | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Save the drawing in an TikZ file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the file. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1230 of file Board.cpp.
References saveTikZ().
void LibBoard::Board::saveTikZ | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing in an TikZ file. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
filename | The name of the file. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1218 of file Board.cpp.
Referenced by main(), save(), and saveTikZ().
void LibBoard::Board::saveTikZ | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 10.0 |
||
) | const |
Save the drawing in an TikZ format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
pageWidth | Width of the page in millimeters. |
pageHeight | Height of the page in millimeters. |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1238 of file Board.cpp.
References _backgroundColor, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::flushSVGCommands(), DGtal::Color::None, LibBoard::shapeGreaterDepth(), and LibBoard::Path::size().
void LibBoard::Board::saveTikZ | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 10.0 |
||
) | const |
Save the drawing in an TikZ file format through an output stream. When a size is given (not BoundingBox), the drawing is scaled (up or down) so that it fits within the dimension while keeping its aspect ratio.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
Definition at line 1224 of file Board.cpp.
References saveTikZ().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Definition at line 196 of file Board.cpp.
References _clippingPath, LibBoard::Path::center(), LibBoard::ShapeList::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Scale the shape along the x an y axis.
sx | The scale factor along the x axis. |
sy | The scale factor along the y axis. |
Implements LibBoard::Shape.
Definition at line 183 of file Board.cpp.
References _clippingPath, LibBoard::Path::center(), LibBoard::ShapeList::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by testDigitalSetDraw().
Board LibBoard::Board::scaled | ( | double | s | ) |
Board LibBoard::Board::scaled | ( | double | sx, |
double | sy | ||
) |
void LibBoard::Board::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the whole drawing.
path | A path. |
Definition at line 750 of file Board.cpp.
References _clippingPath, _state, LibBoard::Path::pop_back(), LibBoard::Path::setClosed(), LibBoard::Path::size(), and LibBoard::Board::State::unit().
void LibBoard::Board::setClippingPath | ( | const std::vector< Point > & | points | ) |
Define a clipping path for the whole drawing.
points | A path. |
Definition at line 738 of file Board.cpp.
References _clippingPath, _state, LibBoard::Path::clear(), and LibBoard::Board::State::unit().
void LibBoard::Board::setClippingRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Define a clipping rectangle for the whole drawing.
x | x |
y | y |
width | width |
height | height |
Definition at line 727 of file Board.cpp.
References _clippingPath, _state, LibBoard::Path::clear(), and LibBoard::Board::State::unit().
Board & LibBoard::Board::setFillColor | ( | const DGtal::Color & | color | ) |
Changes the current fill color.
In order to use no fill color, one may set this color to Color::None.
color | The fill color. |
Definition at line 321 of file Board.cpp.
References _state, and LibBoard::Board::State::fillColor.
Referenced by addColorMapSample(), main(), DGtal::CustomColors::setStyle(), DGtal::CustomFillColor::setStyle(), and DGtal::CustomPen::setStyle().
Board & LibBoard::Board::setFillColorRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0f |
||
) |
Changes the current fill color.
red | Red component. |
green | Green component. |
blue | Blue component. |
alpha | The opacity. |
Definition at line 314 of file Board.cpp.
References _state, LibBoard::Board::State::fillColor, and DGtal::Color::setRGBf().
Board & LibBoard::Board::setFillColorRGBi | ( | unsigned char | red, |
unsigned char | green, | ||
unsigned char | blue, | ||
unsigned char | alpha = 255 |
||
) |
Changes the current fill color.
red | Red component. |
green | Green component. |
blue | Blue component. |
alpha | The opacity. |
Definition at line 304 of file Board.cpp.
References _state, LibBoard::Board::State::fillColor, and DGtal::Color::setRGBi().
Board & LibBoard::Board::setFont | ( | const Fonts::Font | font, |
double | fontSize | ||
) |
Changes the current font and font size.
font | The name of the font. |
fontSize | The new font size. (The unit is 1pt = 1/72 in). |
Definition at line 335 of file Board.cpp.
References _state, LibBoard::Board::State::font, and LibBoard::Board::State::fontSize.
Referenced by addColorMapSample().
Board & LibBoard::Board::setFontSize | ( | double | fontSize | ) |
Board& LibBoard::Board::setLineCap | ( | Shape::LineCap | cap | ) |
Set the line cap style.
cap | The cap-style which can be Shape::ButtCap, Shape::RoundCap or Shape::SquareCap. |
Referenced by DGtal::CustomPen::setStyle().
Board& LibBoard::Board::setLineJoin | ( | Shape::LineJoin | join | ) |
Set the line joine style.
join | The join-style which can be Shape::MiterJoin, Shape::RoundJoin or Shape::BevelJoin. |
Referenced by DGtal::CustomPen::setStyle().
Board& LibBoard::Board::setLineStyle | ( | Shape::LineStyle | style | ) |
Changes the current line style.
style | The new line style. |
Referenced by DGtal::CustomPen::setStyle().
Board & LibBoard::Board::setLineWidth | ( | double | width | ) |
Changes the current line thickness (1/72 inche unit).
width | The new line thickness. |
Definition at line 328 of file Board.cpp.
References _state, and LibBoard::Board::State::lineWidth.
Referenced by DGtal::CustomPen::setStyle(), testAlphaThickSegmentComputerFloatingPointContour(), testAlphaThickSegmentConvexHullAndBox(), and testThicknessDefinitions().
Board & LibBoard::Board::setPenColor | ( | const DGtal::Color & | color | ) |
Changes the current pen color.
In order to use no pen, one may set the pen color to Color::None.
color | The pen color. |
Definition at line 297 of file Board.cpp.
References _state, and LibBoard::Board::State::penColor.
Referenced by addColorMapSample(), convexHull(), main(), DGtal::CustomColors::setStyle(), DGtal::CustomPenColor::setStyle(), DGtal::CustomPen::setStyle(), testAlphaThickSegmentComputerFloatingPointContour(), testAlphaThickSegmentConvexHullAndBox(), testAlphaThickSegmentFreeman(), testAlphaThickSpecialInit(), testConvexHullCompThickness(), testDisplay(), and testThicknessDefinitions().
Board & LibBoard::Board::setPenColorRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0f |
||
) |
Changes the current pen color.
red | Red |
green | green |
blue | blue |
alpha | alpha |
Definition at line 287 of file Board.cpp.
References _state, LibBoard::Board::State::penColor, and DGtal::Color::setRGBf().
Board & LibBoard::Board::setPenColorRGBi | ( | unsigned char | red, |
unsigned char | green, | ||
unsigned char | blue, | ||
unsigned char | alpha = 255 |
||
) |
Changes the current pen color.
red | Red component. |
green | Green component. |
blue | Blue component. |
alpha | alpha component. |
Definition at line 277 of file Board.cpp.
References _state, LibBoard::Board::State::penColor, and DGtal::Color::setRGBi().
Referenced by drawArithmeticalDSL(), and main().
void LibBoard::Board::setUnit | ( | double | factor, |
Unit | unit | ||
) |
Set the unit used by the drawSomething methods.
factor | The factor of the unit. |
unit | The unit to be used in { PT, IN, CM, MM }. |
Definition at line 258 of file Board.cpp.
References _state, UCentimeter, UInche, UMillimeter, LibBoard::Board::State::unitFactor, and UPoint.
void LibBoard::Board::setUnit | ( | Unit | unit | ) |
Set the unit used by the drawSomething methods.
unit | The unit to be used in { PT, IN, CM, MM }. |
Definition at line 239 of file Board.cpp.
References _state, UCentimeter, UInche, UMillimeter, LibBoard::Board::State::unitFactor, and UPoint.
Referenced by DGtal::Board2D::Board2D(), draw(), main(), operator<<(), testBadKeySizes(), testBoard2D(), testBoard2DCustomStyle(), testCellDrawOnBoard(), testChessboard(), testDigitalSetBoardSnippet(), testDigitization(), testDisplay(), testDisplayDT3d(), testDistanceTransformation(), testDistanceTransformationBorder(), testDistanceTransformationNeg(), testDraw(), testDSS4drawing(), testDSS8drawing(), testExactMetricBalls(), testGetSetVal(), testInexactMetricBalls(), testLayers(), testObjectBorder(), testPNMWriter(), testSetTable(), testSimpleExpander(), testSimplePoints2D(), and testSurfelAdjacency().
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
Definition at line 175 of file Board.cpp.
References _clippingPath, LibBoard::Path::translate(), and LibBoard::ShapeList::translate().
Referenced by addColorMapSample().
Board LibBoard::Board::translated | ( | double | dx, |
double | dy | ||
) |
|
protected |
The color of the background.
Definition at line 956 of file Board.h.
Referenced by backgroundColor(), clear(), saveCairo(), saveEPS(), saveFIG(), saveSVG(), and saveTikZ().
|
protected |
Definition at line 957 of file Board.h.
Referenced by rotate(), saveCairo(), saveEPS(), saveSVG(), saveTikZ(), scale(), setClippingPath(), setClippingRectangle(), and translate().
|
protected |
The current state.
Definition at line 955 of file Board.h.
Referenced by drawArc(), drawArrow(), drawBoundingBox(), drawCircle(), drawClosedPolyline(), drawDot(), drawEllipse(), drawImage(), drawLine(), drawPolyline(), drawQuadraticBezierCurve(), drawRectangle(), drawText(), drawTriangle(), fillCircle(), fillEllipse(), fillGouraudTriangle(), fillPolyline(), fillRectangle(), fillTriangle(), operator<<(), setClippingPath(), setClippingRectangle(), setFillColor(), setFillColorRGBf(), setFillColorRGBi(), setFont(), setFontSize(), setLineWidth(), setPenColor(), setPenColorRGBf(), setPenColorRGBi(), and setUnit().
|
static |