#include <Board.h>
Public Types | |
enum | PageSize { BoundingBox, A4, Letter } |
enum | Unit { PT, IN, CM, MM } |
Public Member Functions | |
Board (const Color &backgroundColor=Color::None) | |
Board (const Board &other) | |
Board & | operator= (const Board &other) |
Board & | operator<< (const Shape &shape) |
Board & | operator<< (Unit unit) |
void | clear (const Color &color=Color::None) |
void | clear (unsigned char red, unsigned char green, unsigned char blue) |
void | setUnit (Unit unit) |
void | setUnit (float factor, Unit unit) |
void | drawDot (float x, float y, int depth=-1) |
void | drawLine (float x1, float y1, float x2, float y2, int depth=-1) |
void | drawArrow (float x1, float y1, float x2, float y2, bool filled=true, int depth=-1) |
void | drawTriangle (float x1, float y1, float x2, float y2, float x3, float y3, int depth=-1) |
void | drawTriangle (const Point &p1, const Point &p2, const Point &p3, int depth=-1) |
void | fillTriangle (float x1, float y1, float x2, float y2, float x3, float 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 float x1, const float y1, const Color &color1, const float x2, const float y2, const Color &color2, const float x3, const float 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 float x1, const float y1, const float brightness1, const float x2, const float y2, const float brightness2, const float x3, const float 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 (float x, float y, float width, float height, int depth=-1) |
void | fillRectangle (float x, float y, float width, float height, int depth=-1) |
void | drawCircle (float x, float y, float radius, int depth=-1) |
void | fillCircle (float x, float y, float radius, int depth=-1) |
void | drawEllipse (float x, float y, float xRadius, float yRadius, int depth=-1) |
void | fillEllipse (float x, float y, float xRadius, float 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 (float x, float y, const char *text, int depth=-1) |
void | drawText (float x, float y, const std::string &str, int depth=-1) |
Board & | setFont (const Fonts::Font font, float fontSize) |
Board & | setFontSize (float 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 (float width) |
Board & | setLineCap (Shape::LineCap cap) |
Board & | setLineJoin (Shape::LineJoin join) |
void | backgroundColor (const Color &color) |
void | drawBoundingBox (int depth=-1) |
void | addDuplicates (const Shape &shape, unsigned int times, double dx, double dy) |
void | save (const char *filename, PageSize size=Board::BoundingBox, float margin=10.0) const |
void | save (const char *filename, float pageWidth, float pageHeight, float margin=10.0) const |
void | saveEPS (const char *filename, PageSize size=Board::BoundingBox, float margin=10.0) const |
void | saveEPS (const char *filename, float pageWidth, float pageHeight, float margin=10.0) const |
void | saveFIG (const char *filename, PageSize size=Board::BoundingBox, float margin=10.0) const |
void | saveFIG (const char *filename, float pageWidth, float pageHeight, float margin=10.0) const |
void | saveSVG (const char *filename, PageSize size=Board::BoundingBox, float margin=10.0) const |
void | saveSVG (const char *filename, float pageWidth, float pageHeight, float margin=10.0) const |
Static Public Attributes | |
static const double | Degree = 3.14159265358979323846 / 180.0 |
Protected Attributes | |
State | _state |
Color | _backgroundColor |
Classes | |
struct | State |
The Board class.
examples/arithmetic.cpp, examples/arrows.cpp, examples/ellipse.cpp, examples/example1.cpp, examples/example2.cpp, examples/example3.cpp, examples/example4.cpp, examples/graph.cpp, examples/koch.cpp, examples/logo.cpp, and examples/ruler.cpp.
LibBoard::Board::Board | ( | const Color & | backgroundColor = Color::None |
) |
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. |
The operator =
other | The object to be copied. |
References LibBoard::ShapeList::_shapes, and LibBoard::ShapeList::free().
Add a shape to the board, using the current unit factor.
shape | A shape. (Might be a list of shapes, actually!) |
Reimplemented from LibBoard::ShapeList.
References _state.
Board & LibBoard::Board::operator<< | ( | Unit | unit | ) |
void LibBoard::Board::clear | ( | const Color & | color = Color::None |
) |
Clears the board with a given background color.
color | The board background color (may be Color::None). |
References _backgroundColor.
Referenced by clear().
void LibBoard::Board::clear | ( | unsigned char | red, | |
unsigned char | green, | |||
unsigned char | blue | |||
) | [inline] |
Clears the board and set the background color from an RGB triple.
red | ||
green | ||
blue |
References clear().
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 }. |
References _state.
Referenced by operator<<().
void LibBoard::Board::setUnit | ( | float | 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 }. |
References _state.
void LibBoard::Board::drawDot | ( | float | x, | |
float | 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, and _state.
void LibBoard::Board::drawLine | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | 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, and _state.
void LibBoard::Board::drawArrow | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | y2, | |||
bool | filled = true , |
|||
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. | |
filled | Whether or not the arrow is filled. | |
depth | Depth of the line. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, and _state.
void LibBoard::Board::drawTriangle | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | y2, | |||
float | x3, | |||
float | 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, and _state.
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::Point::x, and LibBoard::Point::y.
void LibBoard::Board::fillTriangle | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | y2, | |||
float | x3, | |||
float | 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, and _state.
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, LibBoard::ShapeList::_shapes, _state, LibBoard::Point::x, and LibBoard::Point::y.
Referenced by fillGouraudTriangle().
void LibBoard::Board::fillGouraudTriangle | ( | const float | x1, | |
const float | y1, | |||
const Color & | color1, | |||
const float | x2, | |||
const float | y2, | |||
const Color & | color2, | |||
const float | x3, | |||
const float | y3, | |||
const Color & | color3, | |||
unsigned char | divisions = 3 , |
|||
int | depth = -1 | |||
) | [inline] |
Draws a triangle with Gouraud-like shaded colors.
x1 | ||
y1 | ||
color1 | ||
x2 | ||
y2 | ||
color2 | ||
x3 | ||
y3 | ||
color3 | ||
divisions | ||
depth |
References 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 | 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, LibBoard::Color::blue(), fillGouraudTriangle(), LibBoard::Color::green(), LibBoard::Color::red(), LibBoard::Point::x, and LibBoard::Point::y.
void LibBoard::Board::fillGouraudTriangle | ( | const float | x1, | |
const float | y1, | |||
const float | brightness1, | |||
const float | x2, | |||
const float | y2, | |||
const float | brightness2, | |||
const float | x3, | |||
const float | y3, | |||
const float | brightness3, | |||
unsigned char | divisions = 3 , |
|||
int | depth = -1 | |||
) | [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 |
References fillGouraudTriangle().
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::Point::x, and LibBoard::Point::y.
void LibBoard::Board::drawRectangle | ( | float | x, | |
float | y, | |||
float | width, | |||
float | height, | |||
int | depth = -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. | |
depth | Depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, and _state.
void LibBoard::Board::fillRectangle | ( | float | x, | |
float | y, | |||
float | width, | |||
float | height, | |||
int | depth = -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. | |
depth | Depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, and _state.
void LibBoard::Board::drawCircle | ( | float | x, | |
float | y, | |||
float | 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, and _state.
void LibBoard::Board::fillCircle | ( | float | x, | |
float | y, | |||
float | 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, and _state.
void LibBoard::Board::drawEllipse | ( | float | x, | |
float | y, | |||
float | xRadius, | |||
float | 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, and _state.
void LibBoard::Board::fillEllipse | ( | float | x, | |
float | y, | |||
float | xRadius, | |||
float | 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, and _state.
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, and _state.
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, and _state.
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, and _state.
void LibBoard::Board::drawText | ( | float | x, | |
float | 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, and _state.
void LibBoard::Board::drawText | ( | float | x, | |
float | 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, and _state.
Board & LibBoard::Board::setFont | ( | const Fonts::Font | font, | |
float | 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). |
References _state.
Board & LibBoard::Board::setFontSize | ( | float | fontSize | ) |
Changes the font size.
fontSize | The new font size. (The unit is 1pt = 1/72 in). |
References _state.
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.
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.
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.
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.
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.
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.
Board & LibBoard::Board::setLineWidth | ( | float | width | ) |
Changes the current line thickness (1/72 inche unit).
width | The new line thickness. |
References _state.
Board & LibBoard::Board::setLineCap | ( | Shape::LineCap | cap | ) | [inline] |
Set the line cap style.
cap | The cap-style which can be Shape::ButtCap, Shape::RoundCap or Shape::SquareCap. |
References _state.
Board & LibBoard::Board::setLineJoin | ( | Shape::LineJoin | join | ) | [inline] |
Set the line joine style.
cap | The join-style which can be Shape::MiterJoin, Shape::RoundJoin or Shape::BevelJoin. |
References _state.
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::drawBoundingBox | ( | int | depth = -1 |
) |
Draws the current drawing's bounding box as a rectangle.
depth | The depth of the rectangle. |
References LibBoard::ShapeList::_nextDepth, LibBoard::ShapeList::_shapes, _state, LibBoard::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::addDuplicates | ( | const Shape & | shape, | |
unsigned int | times, | |||
double | dx, | |||
double | dy | |||
) |
Insert duplicates of a shape, n times, starting at its current position and iterating a given translation.
shape | The shape to be duplicated. | |
dx | The x shift. | |
dy | The y shift. | |
times | The number of duplicates. |
References LibBoard::Shape::clone(), and LibBoard::Shape::translate().
void LibBoard::Board::save | ( | const char * | filename, | |
PageSize | size = Board::BoundingBox , |
|||
float | margin = 10.0 | |||
) | 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, in millimeters. |
void LibBoard::Board::save | ( | const char * | filename, | |
float | pageWidth, | |||
float | pageHeight, | |||
float | margin = 10.0 | |||
) | 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 in millimeters. | |
pageHeight | Height of the page in millimeters. | |
margin | Minimal margin around the figure in the page, in millimeters. |
void LibBoard::Board::saveEPS | ( | const char * | filename, | |
PageSize | size = Board::BoundingBox , |
|||
float | 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. |
Referenced by save().
void LibBoard::Board::saveEPS | ( | const char * | filename, | |
float | pageWidth, | |||
float | pageHeight, | |||
float | 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). | |
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::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Polyline::flushPostscript(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Transform::mapX(), LibBoard::TransformEPS::mapY(), LibBoard::TransformEPS::setBoundingBox(), LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::saveFIG | ( | const char * | filename, | |
PageSize | size = Board::BoundingBox , |
|||
float | margin = 10.0 | |||
) | 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. |
Referenced by save().
void LibBoard::Board::saveFIG | ( | const char * | filename, | |
float | pageWidth, | |||
float | pageHeight, | |||
float | margin = 10.0 | |||
) | 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 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::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Shape::depth(), LibBoard::Rectangle::flushFIG(), LibBoard::TransformFIG::setBoundingBox(), LibBoard::TransformFIG::setDepthRange(), and LibBoard::Color::valid().
void LibBoard::Board::saveSVG | ( | const char * | filename, | |
PageSize | size = Board::BoundingBox , |
|||
float | 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. |
Referenced by save().
void LibBoard::Board::saveSVG | ( | const char * | filename, | |
float | pageWidth, | |||
float | pageHeight, | |||
float | 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. | |
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::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Rectangle::flushSVG(), LibBoard::Rect::height, LibBoard::TransformSVG::setBoundingBox(), and LibBoard::Rect::width.
State LibBoard::Board::_state [protected] |
The current state.
Referenced by drawArrow(), drawBoundingBox(), drawCircle(), drawClosedPolyline(), drawDot(), drawEllipse(), drawLine(), drawPolyline(), drawRectangle(), drawText(), drawTriangle(), fillCircle(), fillEllipse(), fillGouraudTriangle(), fillPolyline(), fillRectangle(), fillTriangle(), operator<<(), setFillColor(), setFillColorRGBf(), setFillColorRGBi(), setFont(), setFontSize(), setLineCap(), setLineJoin(), setLineWidth(), setPenColor(), setPenColorRGBf(), setPenColorRGBi(), and setUnit().
Color LibBoard::Board::_backgroundColor [protected] |
The color of the background.
Referenced by backgroundColor(), clear(), saveEPS(), saveFIG(), and saveSVG().