Board
0.9.4
|
Class for EPS, FIG or SVG drawings. More...
#include <Board.h>
Classes | |
struct | State |
Public Types | |
enum | PageSize { BoundingBox = 0, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Letter, Legal, Executive } |
enum | Unit { UPoint, UInche, UCentimeter, UMillimeter } |
enum | AspectRatioFlag { IgnoreAspectRatio, KeepAspectRatio } |
![]() | |
enum | Direction { Top, Right, Bottom, Left } |
enum | Alignment { AlignTop, AlignBottom, AlignCenter, AlignLeft, AlignRight } |
![]() | |
enum | LineCap { ButtCap = 0, RoundCap, SquareCap } |
enum | LineJoin { MiterJoin = 0, RoundJoin, BevelJoin } |
enum | LineStyle { SolidStyle = 0, DashStyle, DotStyle, DashDotStyle, DashDotDotStyle, DashDotDotDotStyle } |
enum | LineWidthFlag { IgnoreLineWidth, UseLineWidth } |
Public Member Functions | |
Board (const Color &backgroundColor=Color::Null) | |
Board (const Board &other) | |
Board & | operator= (const Board &other) |
Board & | operator<< (const Shape &shape) |
void | clear (const Color &color=Color::Null) |
void | clear (unsigned char red, unsigned char green, unsigned char blue) |
Board & | rotate (double angle, const Point ¢er) |
Board & | rotate (double angle) |
Board & | translate (double dx, double dy) |
Board & | scale (double sx, double sy) |
Board & | 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 depth=-1) |
void | drawLine (double x1, double y1, double x2, double y2, int depth=-1) |
void | drawLine (Point p, Point q, int depth=-1) |
void | drawArrow (double x1, double y1, double x2, double y2, int depth=-1) |
void | drawArrow (Point p, Point q, int depth=-1) |
void | drawTriangle (double x1, double y1, double x2, double y2, double x3, double y3, int depth=-1) |
void | drawTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1) |
void | fillTriangle (double x1, double y1, double x2, double y2, double x3, double y3, int depth=-1) |
void | fillGouraudTriangle (const Point &p1, const Color &color1, const Point &p2, const Color &color2, const Point &p3, const Color &color3, unsigned char divisions=3, int depth=-1) |
void | fillGouraudTriangle (const double x1, const double y1, const Color &color1, const double x2, const double y2, const Color &color2, const double x3, const double y3, const Color &color3, unsigned char divisions=3, int depth=-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 depth=-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 depth=-1) |
void | fillTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1) |
void | drawRectangle (double left, double top, double width, double height, int depth=-1) |
void | drawRectangle (const Rect &r, int depth=-1) |
void | fillRectangle (double left, double top, double width, double height, int depth=-1) |
void | fillRectangle (const Rect &r, int depth=-1) |
void | drawCircle (double x, double y, double radius, int depth=-1) |
void | fillCircle (double x, double y, double radius, int depth=-1) |
void | drawEllipse (double x, double y, double xRadius, double yRadius, int depth=-1) |
void | fillEllipse (double x, double y, double xRadius, double yRadius, int depth=-1) |
void | drawPolyline (const std::vector< Point > &points, int depth=-1) |
void | drawClosedPolyline (const std::vector< Point > &points, int depth=-1) |
void | fillPolyline (const std::vector< Point > &points, int depth=-1) |
void | drawText (double x, double y, const char *text, int depth=-1) |
void | drawText (Point p, const char *text, int depth=-1) |
void | drawText (double x, double y, const std::string &str, int depth=-1) |
void | drawText (Point p, const std::string &str, int depth=-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 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 Color &color) |
Board & | setLineWidth (double width) |
Board & | setLineStyle (Shape::LineStyle style) |
Board & | setLineCap (Shape::LineCap cap) |
Board & | setLineJoin (Shape::LineJoin join) |
void | backgroundColor (const Color &color) |
void | drawBoundingBox (LineWidthFlag lineWidthFlag, int depth=-1) |
void | setClippingRectangle (double x, double y, double width, double height) |
void | setClippingRectangle (const Rect &rect) |
void | setClippingPath (const std::vector< Point > &points) |
void | setClippingPath (const Path &path) |
void | addDuplicates (const Shape &shape, std::size_t times, double dx, double dy, double scale=1.0) |
void | addDuplicates (const Shape &shape, std::size_t times, double dx, double dy, double scaleX, double scaleY, double angle=0.0) |
void | save (const char *filename, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter) const |
void | save (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter) const |
void | saveEPS (std::ostream &out, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter, const std::string &title=std::string()) const |
void | saveEPS (const char *filename, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter, const std::string &title=std::string()) const |
void | saveEPS (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter, const std::string &title=std::string()) const |
void | saveEPS (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter, const std::string &title=std::string()) const |
void | saveFIG (const char *filename, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter) const |
void | saveFIG (std::ostream &out, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter) const |
void | saveFIG (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter) const |
void | saveFIG (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter) const |
void | saveSVG (const char *filename, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter) const |
void | saveSVG (std::ostream &out, PageSize size=Board::BoundingBox, double margin=0.0, Unit unit=UMillimeter) const |
void | saveSVG (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter) const |
void | saveSVG (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=UMillimeter) const |
void | saveTikZ (const char *filename, PageSize size=Board::BoundingBox, double margin=0.0) const |
void | saveTikZ (std::ostream &out, PageSize size=Board::BoundingBox, double margin=0.0) const |
void | saveTikZ (const char *filename, double pageWidth, double pageHeight, double margin=0.0) const |
void | saveTikZ (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0) const |
Color | penColor () const |
penColor More... | |
Color | fillColor () const |
fillColor More... | |
![]() | |
ShapeList (int depth=-1) | |
ShapeList (const ShapeList &other) | |
ShapeList & | operator= (const ShapeList &other) |
ShapeList (const Shape &shape, unsigned int times, double dx, double dy, double scale) | |
ShapeList (const Shape &shape, unsigned int times, double dx, double dy, double scaleX, double scaleY, double angle) | |
const std::string & | name () const |
ShapeList & | clear () |
ShapeList & | rotate (double angle, const Point ¢er) |
ShapeList | rotated (double angle, const Point ¢er) |
ShapeList & | rotate (double angle) |
ShapeList | rotated (double angle) |
ShapeList & | translate (double dx, double dy) |
ShapeList | translated (double dx, double dy) |
ShapeList & | scale (double sx, double sy) |
ShapeList & | 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< Color, int > &colormap) const |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const |
Rect | boundingBox (LineWidthFlag) const |
virtual int | minDepth () const |
virtual int | maxDepth () const |
void | shiftDepth (int shift) |
ShapeList * | clone () const |
ShapeList & | operator<< (const Shape &shape) |
ShapeList & | operator+= (const Shape &shape) |
ShapeList & | append (const Shape &shape, Direction direction, Alignment alignment, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth) |
Group & | addTiling (const Shape &shape, Point topLeftCorner, std::size_t columns, std::size_t rows, double spacing=0.0, LineWidthFlag lineWidthFlag=UseLineWidth) |
void | repeat (const Shape &shape, unsigned int times, double dx, double dy, double scaleX=1.0, double scaleY=1.0, double angle=0.0) |
ShapeList & | insert (const Shape &shape, int depth) |
ShapeList & | dup (std::size_t copies=1) |
template<typename T > | |
T & | last (const std::size_t position=0) |
Shape & | last (const std::size_t position=0) |
Shape & | top () |
virtual void | accept (ShapeVisitor &visitor) |
Accepts a visitor object. More... | |
virtual void | accept (const ShapeVisitor &visitor) |
Accepts a visitor object. More... | |
![]() | |
Shape (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth) | |
virtual | ~Shape () |
bool | filled () const |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
Rect | bbox (LineWidthFlag) const |
Shape & | operator-- () |
Shape & | operator++ () |
int | depth () const |
virtual void | depth (int) |
const Color & | penColor () const |
const Color & | fillColor () const |
Static Public Member Functions | |
static Group | makeGrid (Point topLeft, size_t columns, size_t rows, double width, double height, Color penColor, Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) |
![]() | |
static void | enableLineWidthScaling () |
static void | disableLineWidthScaling () |
static void | setLineWidthScaling (bool) |
static void | setDefaultLineWidth (double) |
static void | setDefaultPenColor (Color) |
static void | setDefaultFillColor (Color) |
static void | setDefaultLineStyle (Shape::LineStyle) |
static void | setDefaultLineCap (Shape::LineCap) |
static void | setDefaultLineJoin (Shape::LineJoin) |
static double | defaultLineWidth () |
defaultLineWidth More... | |
static Color | defaultPenColor () |
defaultPenColor More... | |
static Color | defaultFillColor () |
defaultFillColor More... | |
static Shape::LineStyle | defaultLineStyle () |
defaultLineStyle More... | |
static Shape::LineCap | defaultLineCap () |
defaultLineCap More... | |
static Shape::LineJoin | defaultLineJoin () |
defaultLineJoin More... | |
Static Public Attributes | |
static const double | Degree = 3.14159265358979323846 / 180.0 |
Static Protected Member Functions | |
static double | toMillimeter (double x, Unit unit) |
Protected Attributes | |
State | _state |
Color | _backgroundColor |
Path | _clippingPath |
![]() | |
std::vector< Shape * > | _shapes |
int | _nextDepth |
![]() | |
int | _depth |
Color | _penColor |
Color | _fillColor |
double | _lineWidth |
LineStyle | _lineStyle |
LineCap | _lineCap |
LineJoin | _lineJoin |
Additional Inherited Members | |
![]() | |
void | addShape (const Shape &shape, double scaleFactor) |
void | free () |
![]() | |
void | updateLineWidth (double s) |
std::string | svgProperties (const TransformSVG &transform) const |
std::string | postscriptProperties (const TransformEPS &transform) const |
std::string | tikzProperties (const TransformTikZ &transform) const |
![]() | |
static bool | _lineWidthScaling = true |
static double | _defaultLineWidth = 1.0 |
static Color | _defaultPenColor = Color::Black |
static Color | _defaultFillColor = Color::Null |
static Shape::LineStyle | _defaultLineStyle = Shape::SolidStyle |
static Shape::LineCap | _defaultLineCap = Shape::ButtCap |
static Shape::LineJoin | _defaultLineJoin = Shape::MiterJoin |
Class for EPS, FIG or SVG drawings.
The Board class.
LibBoard::Board::Board | ( | const Color & | backgroundColor = Color::Null | ) |
Constructs a new board and sets the background color, if any.
backgroundColor | A color for the drawing's background. |
LibBoard::Board::Board | ( | const Board & | other | ) |
Copy constructor.
other | The object to be copied. |
void LibBoard::Board::addDuplicates | ( | const Shape & | shape, |
std::size_t | 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. |
References LibBoard::Shape::clone(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().
void LibBoard::Board::addDuplicates | ( | const Shape & | shape, |
std::size_t | 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. |
References LibBoard::Shape::clone(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().
void LibBoard::Board::backgroundColor | ( | const Color & | color | ) |
Changes the background color of the whole drawing.
color | A color (may be Color::None). |
References _backgroundColor.
void LibBoard::Board::clear | ( | const Color & | color = Color::Null | ) |
Clears the board with a given background color.
color | The board background color (may be Color::None). |
References _backgroundColor.
|
inline |
Clears the board and set the background color from an RGB triple.
red | |
green | |
blue |
void LibBoard::Board::drawArrow | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
int | depth = -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. |
depth | Depth of the line. |
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, and LibBoard::Board::State::penColor.
Draws a line from p to q with an arrow at (x2,y2).
p | First extremity. |
q | Second extremity. |
depth | Depth of the line. |
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::Point::x, and LibBoard::Point::y.
void LibBoard::Board::drawBoundingBox | ( | LineWidthFlag | lineWidthFlag, |
int | depth = -1 |
||
) |
Draws the current drawing's bounding box as a rectangle.
depth | The depth of the rectangle. |
lineWidthFlag | Should the line width be considered when computing bounding boxes. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Shape::bbox(), 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, and LibBoard::Rect::width.
void LibBoard::Board::drawCircle | ( | double | x, |
double | y, | ||
double | radius, | ||
int | depth = -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. |
depth | Depth of the circle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawClosedPolyline | ( | const std::vector< Point > & | points, |
int | depth = -1 |
||
) |
Draws a closed polygonal line.
points | A vector of points. |
depth | The depth of the polyline. |
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, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawDot | ( | double | x, |
double | y, | ||
int | depth = -1 |
||
) |
Draws a dot at coordinates (x,y).
x | First coordinate of the dot. |
y | Second coordinate of the dot. |
depth | Depth of the line. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineWidth, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius, | ||
int | depth = -1 |
||
) |
Draws an ellipse.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
radius | Radius of the circle. |
depth | Depth of the circle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::fillColor, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawLine | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
int | depth = -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. |
depth | Depth of the line. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::lineWidth, and LibBoard::Board::State::penColor.
Draws a line from p to q.
p | First extremity. |
q | Second extremity. |
filled | Whether or not the arrow is filled. |
depth | Depth of the line. |
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, LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::drawPolyline | ( | const std::vector< Point > & | points, |
int | depth = -1 |
||
) |
Draws a polygonal line.
points | A vector of points. |
depth | The depth of the polyline. |
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, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawRectangle | ( | double | left, |
double | top, | ||
double | width, | ||
double | height, | ||
int | depth = -1 |
||
) |
Draws a rectangle.
left | First coordinate of the upper left corner. |
top | Second coordinate of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
depth | Depth of the rectangle. |
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, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawRectangle | ( | const Rect & | r, |
int | depth = -1 |
||
) |
Draws a rectangle.
rect | Position and size of the rectangle. |
depth | Depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, 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, and LibBoard::Rect::width.
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const char * | text, | ||
int | depth = -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. |
depth | The depth of the text. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawText | ( | Point | p, |
const char * | text, | ||
int | depth = -1 |
||
) |
Draws a string of text.
p | Position of the bottom-left corner. |
text | The text. |
depth | The depth of the text. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const std::string & | str, | ||
int | depth = -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. |
depth | The depth of the text. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawText | ( | Point | p, |
const std::string & | str, | ||
int | depth = -1 |
||
) |
Draws a string of text.
p | Position of the bottom-left corner. |
str | The text. |
depth | The depth of the text. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3, | ||
int | depth = -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. |
y3 | Second coordinate of the second vertex. |
x3 | First coordinate of the third vertex. |
y3 | Second coordinate of the third vertex. |
depth | Depth of the triangle. |
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, and LibBoard::Board::State::penColor.
void LibBoard::Board::drawTriangle | ( | const Point & | p1, |
const Point & | p2, | ||
const Point & | p3, | ||
int | depth = -1 |
||
) |
Draws a triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
depth | Depth of the triangle. |
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::Point::x, and LibBoard::Point::y.
void LibBoard::Board::fillCircle | ( | double | x, |
double | y, | ||
double | radius, | ||
int | depth = -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. |
depth | Depth of the circle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineStyle, and LibBoard::Board::State::penColor.
Color LibBoard::Board::fillColor | ( | ) | const |
void LibBoard::Board::fillEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius, | ||
int | depth = -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. |
depth | Depth of the circle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineStyle, and LibBoard::Board::State::penColor.
void LibBoard::Board::fillGouraudTriangle | ( | const Point & | p1, |
const Color & | color1, | ||
const Point & | p2, | ||
const Color & | color2, | ||
const Point & | p3, | ||
const Color & | color3, | ||
unsigned char | divisions = 3 , |
||
int | depth = -1 |
||
) |
Draws a triangle with Gouraud-like shaded colors.
p1 | |
color1 | |
p2 | |
color2 | |
p3 | |
color3 | |
divisions | number of triangle subdivisions. |
depth | The depth of the triangle. |
References LibBoard::ShapeList::_nextDepth, and LibBoard::ShapeList::_shapes.
Referenced by fillGouraudTriangle().
|
inline |
Draws a triangle with Gouraud-like shaded colors.
x1 | |
y1 | |
color1 | |
x2 | |
y2 | |
color2 | |
x3 | |
y3 | |
color3 | |
divisions | |
depth |
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 | depth = -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 | |
brightness1 | |
p2 | |
brightness2 | |
p3 | |
brightness3 | |
divisions | number of triangle subdivisions. |
depth | The depth of the triangle. |
References _state, fillGouraudTriangle(), and LibBoard::Board::State::penColor.
|
inline |
Draws a triangle with a Gouraud-like shaded color according to the current fill color and a brightness value given for each vertex.
x1 | |
y1 | |
brightness1 | |
x2 | |
y2 | |
brightness2 | |
x3 | |
y3 | |
brightness3 | |
divisions | |
depth |
void LibBoard::Board::fillPolyline | ( | const std::vector< Point > & | points, |
int | depth = -1 |
||
) |
Draws a filled polygon.
points | A vector of points. |
depth | The depth of the polygon. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, and LibBoard::Board::State::penColor.
void LibBoard::Board::fillRectangle | ( | double | left, |
double | top, | ||
double | width, | ||
double | height, | ||
int | depth = -1 |
||
) |
Draws a rectangle filled with the current pen color.
left | First coordinate of the upper left corner. |
top | Second coordinate of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
depth | Depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, and LibBoard::Board::State::penColor.
void LibBoard::Board::fillRectangle | ( | const Rect & | r, |
int | depth = -1 |
||
) |
Draws a rectangle filled with the current pen color.
rect | Position and size of the rectangle. |
depth | Depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::penColor, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::fillTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3, | ||
int | depth = -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. |
y3 | Second coordinate of the second vertex. |
x3 | First coordinate of the third vertex. |
y3 | Second coordinate of the third vertex. |
depth | Depth of the triangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, and LibBoard::Board::State::penColor.
void LibBoard::Board::fillTriangle | ( | const Point & | p1, |
const Point & | p2, | ||
const Point & | p3, | ||
int | depth = -1 |
||
) |
Draws a filled triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
depth | Depth of the triangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::lineCap, LibBoard::Board::State::lineJoin, LibBoard::Board::State::lineStyle, LibBoard::Board::State::penColor, LibBoard::Point::x, and LibBoard::Point::y.
|
static |
Build a grid with specified number of rows and columns and a given size.
topLeft | Coordinates of the top left point of the grid. |
columns | Number of columns of the grid. |
rows | Number of rows of the grid. |
width | Width of the grid. |
height | Height of the grid. |
penColor | Color of the lines. |
fillColor | Background color. |
lineWidth | Line width. |
style | Line style (default is Board::SolidStyle). |
cap | Line cap (default is Board::ButtCap). |
join | Line join (default is Board::MiterJoin). |
depth | Depth of the grid (default is -1 (auto)). |
References LibBoard::Line::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Add a shape to the board, using the current unit factor.
shape | A shape. (Might be a list of shapes, actually!) |
The operator =
other | The object to be copied. |
References LibBoard::ShapeList::_shapes, and LibBoard::ShapeList::free().
Color LibBoard::Board::penColor | ( | ) | const |
penColor
References _state, and LibBoard::Board::State::penColor.
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
References LibBoard::ShapeList::rotate(), and LibBoard::Path::rotate().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), LibBoard::ShapeList::rotate(), and LibBoard::Path::rotate().
void LibBoard::Board::save | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Save the drawing in an EPS, XFIG of 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. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
void LibBoard::Board::save | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Save the drawing in an EPS, XFIG of 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. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
References saveEPS(), saveFIG(), saveSVG(), and saveTikZ().
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Writes the drawing in a stream as 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.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
title | Document title (Postscript comment). |
void LibBoard::Board::saveEPS | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter , |
||
const std::string & | title = std::string() |
||
) | 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. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
title | Document title (Postscript comment). |
References saveEPS().
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Writes the drawing in a stream as an EPS file. 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). |
pageWidth | Width of the page. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
title | Document title (Postscript comment). |
References _backgroundColor, LibBoard::ShapeList::_shapes, LibBoard::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::boundingBox(), LibBoard::Polyline::flushPostscript(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::saveEPS | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Saves the drawing in an EPS file. 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. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
title | Document title (Postscript comment). |
References saveEPS().
void LibBoard::Board::saveFIG | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | 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. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Saves the drawing in a stream as 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.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
References saveFIG().
void LibBoard::Board::saveFIG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | 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. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
pageWidth | Width of the page. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
References saveFIG().
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Saves the drawing in a stream as an XFig file. 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). |
pageWidth | Width of the page. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
References _backgroundColor, LibBoard::ShapeList::_shapes, LibBoard::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Rectangle::flushFIG(), LibBoard::Rect::height, and LibBoard::Rect::width.
void LibBoard::Board::saveSVG | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | 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. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Saves the drawing in a stream as 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.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the margin (default value is millimeter). If size is "BoundingBox", this unit is used for the bounding box as well. |
References saveSVG().
void LibBoard::Board::saveSVG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | 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. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
pageWidth | Width of the page. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
References saveSVG().
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = UMillimeter |
||
) | const |
Saves the drawing in a stream as an SVG file. 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). |
pageWidth | Width of the page. |
pageHeight | Height of the page. |
margin | Minimal margin around the figure in the page. |
unit | The unit used to express the previous length parameters (default value is millimeter). |
References _backgroundColor, LibBoard::ShapeList::_shapes, LibBoard::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::boundingBox(), LibBoard::Rectangle::flushSVG(), LibBoard::Rect::height, and LibBoard::Rect::width.
void LibBoard::Board::saveTikZ | ( | const char * | filename, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.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. |
Referenced by save(), and saveTikZ().
void LibBoard::Board::saveTikZ | ( | std::ostream & | out, |
PageSize | size = Board::BoundingBox , |
||
double | margin = 0.0 |
||
) | const |
Save the drawing in a stream as 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.
out | The output stream. |
size | Page size (Either BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
References saveTikZ().
void LibBoard::Board::saveTikZ | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.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). |
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. |
References saveTikZ().
void LibBoard::Board::saveTikZ | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 |
||
) | const |
Save the drawing in a stream as a TikZ file. 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). |
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. |
References _backgroundColor, LibBoard::ShapeList::_shapes, LibBoard::ShapeList::boundingBox(), LibBoard::Path::boundingBox(), and LibBoard::Rectangle::flushTikZ().
|
virtual |
Scale the shape along the x an y axis.
sx | The scaling factor along the x axis. |
sy | The scaling factor along the y axis. |
Implements LibBoard::Shape.
References LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::ShapeList::scale(), LibBoard::Path::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
|
virtual |
Scale the shape along both axis.
s | The scaling factor along both axis. |
Implements LibBoard::Shape.
References LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::ShapeList::scale(), LibBoard::Path::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::setClippingPath | ( | const std::vector< Point > & | points | ) |
Define a clipping path for the whole drawing.
points | A path. |
void LibBoard::Board::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the whole drawing.
points | A path. |
References LibBoard::Path::pop_back().
void LibBoard::Board::setClippingRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Define a clipping rectangle for the whole drawing.
x | |
y | |
width | |
height |
Referenced by setClippingRectangle().
void LibBoard::Board::setClippingRectangle | ( | const Rect & | rect | ) |
Define a clipping rectangle for the whole drawing.
rect | The clipping rectangle. |
References LibBoard::Rect::height, LibBoard::Rect::left, setClippingRectangle(), LibBoard::Rect::top, and LibBoard::Rect::width.
Changes the current fill color.
In order to use no fill color, one may set this color to Color::None.
color | The fill color. |
References _state, and LibBoard::Board::State::fillColor.
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. |
References _state, and LibBoard::Board::State::fillColor.
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. |
References _state, and LibBoard::Board::State::fillColor.
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. |
References _state, LibBoard::Board::State::font, and LibBoard::Board::State::fontSize.
Board & LibBoard::Board::setFontSize | ( | double | fontSize | ) |
Changes the font size.
fontSize | The new font size. |
References _state, and LibBoard::Board::State::fontSize.
|
inline |
Set the line cap style.
cap | The cap-style which can be Shape::ButtCap, Shape::RoundCap or Shape::SquareCap. |
|
inline |
Set the line joine style.
cap | The join-style which can be Shape::MiterJoin, Shape::RoundJoin or Shape::BevelJoin. |
Board& LibBoard::Board::setLineStyle | ( | Shape::LineStyle | style | ) |
Changes the current line style.
style | The new line style. |
Board & LibBoard::Board::setLineWidth | ( | double | width | ) |
Changes the current line thickness.
width | The new line thickness. |
References _state, and LibBoard::Board::State::lineWidth.
Changes the current pen color.
In order to use no pen, one may set the pen color to Color::None.
color | The pen color. |
References _state, and LibBoard::Board::State::penColor.
Board & LibBoard::Board::setPenColorRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0f |
||
) |
Changes the current pen color.
red | Red |
green | |
blue | |
alpha |
References _state, and LibBoard::Board::State::penColor.
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. |
References _state, and LibBoard::Board::State::penColor.
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 }. |
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 }. |
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
References LibBoard::ShapeList::translate(), and LibBoard::Path::translate().
|
protected |
The color of the background.
Referenced by backgroundColor(), clear(), saveEPS(), saveFIG(), saveSVG(), and saveTikZ().
|
protected |
The current state.
Referenced by drawArrow(), drawBoundingBox(), drawCircle(), drawClosedPolyline(), drawDot(), drawEllipse(), drawLine(), drawPolyline(), drawRectangle(), drawText(), drawTriangle(), fillCircle(), fillColor(), fillEllipse(), fillGouraudTriangle(), fillPolyline(), fillRectangle(), fillTriangle(), penColor(), setFillColor(), setFillColorRGBf(), setFillColorRGBi(), setFont(), setFontSize(), setLineWidth(), setPenColor(), setPenColorRGBf(), and setPenColorRGBi().