Board 0.9.6
|
Class for EPS, FIG or SVG drawings. More...
#include <Board.h>
Classes | |
struct | State |
Public Types | |
enum class | AspectRatio { Ignore , Preserve } |
The AspectRatio enum. More... | |
Public Types inherited from LibBoard::ShapeList | |
typedef std::vector< Shape * >::size_type | size_type |
Public Member Functions | |
Board (const Color &backgroundColor=Color::Null) | |
Board (const Board &other) | |
~Board () override | |
Board & | operator= (const Board &other) |
Board & | operator<< (const Shape &shape) |
template<typename S > | |
Board & | operator<< (const std::vector< S > &shapes) |
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) override |
Rotate the board by an angle around a point. | |
Board & | rotate (double angle) override |
Rotate the board by an angle around the center of its bounding box. | |
Board & | translate (double dx, double dy) override |
Translate the board by a given vector. | |
Board & | scale (double sx, double sy) override |
Scale the board in the x and y direction. | |
Board & | scale (double s) override |
Scale the board. | |
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 | drawDot (double x, double y) |
void | drawLine (double x1, double y1, double x2, double y2) |
void | drawLine (Point p, Point q) |
void | drawArrow (double x1, double y1, double x2, double y2, Arrow::ExtremityType type=Arrow::ExtremityType::Plain) |
void | drawArrow (Point p, Point q, Arrow::ExtremityType type=Arrow::ExtremityType::Plain) |
void | drawTriangle (double x1, double y1, double x2, double y2, double x3, double y3) |
void | drawTriangle (const Point &p1, const Point &p2, const Point &p3) |
void | fillTriangle (double x1, double y1, double x2, double y2, double x3, double y3) |
void | fillGouraudTriangle (const Point &p1, const Color &color1, const Point &p2, const Color &color2, const Point &p3, const Color &color3, unsigned char divisions=3) |
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) |
void | fillGouraudTriangle (const Point &p1, const float brightness1, const Point &p2, const float brightness2, const Point &p3, const float brightness3, unsigned char divisions=3) |
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) |
void | fillTriangle (const Point &p1, const Point &p2, const Point &p3) |
void | drawRectangle (double left, double top, double width, double height) |
void | drawRectangle (const Rect &rect) |
void | fillRectangle (double left, double top, double width, double height) |
void | fillRectangle (const Rect &rect) |
void | drawCircle (double x, double y, double radius) |
void | fillCircle (double x, double y, double radius) |
void | drawEllipse (double x, double y, double xRadius, double yRadius) |
void | fillEllipse (double x, double y, double xRadius, double yRadius) |
void | drawPolyline (const std::vector< Point > &points) |
void | drawClosedPolyline (const std::vector< Point > &points) |
void | fillPolyline (const std::vector< Point > &points) |
void | drawText (double x, double y, const char *text) |
void | drawText (Point p, const char *text) |
void | drawText (double x, double y, const std::string &text) |
void | drawText (Point p, const std::string &str) |
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 & | setFillColorHSV (float hue, float saturation, float value, float alpha=1.0f) |
Board & | setFillColor (const Color &color) |
Board & | setLineWidth (double width) |
Board & | setLineStyle (LineStyle style) |
Board & | setLineCap (LineCap cap) |
Board & | setLineJoin (LineJoin join) |
void | setBackgroundColor (const Color &color) |
void | drawBoundingBox (LineWidthFlag lineWidthFlag) |
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=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | save (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveEPS (std::ostream &out, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const |
void | saveEPS (const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const |
void | saveEPS (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const |
void | saveEPS (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter, const std::string &title=std::string()) const |
void | saveFIG (const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveFIG (std::ostream &out, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveFIG (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveFIG (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveSVG (const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveSVG (std::ostream &out, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveSVG (const char *filename, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveSVG (std::ostream &out, double pageWidth, double pageHeight, double margin=0.0, Unit unit=Unit::Millimeter) const |
void | saveTikZ (const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0) const |
void | saveTikZ (std::ostream &out, PageSize size=PageSize::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 |
const Color & | penColor () const |
penColor | |
const Color & | fillColor () const |
fillColor | |
const Style & | style () const |
Public Member Functions inherited from LibBoard::ShapeList | |
ShapeList () | |
ShapeList (const ShapeList &other) | |
ShapeList & | operator= (const ShapeList &other) |
ShapeList (ShapeList &&other) | |
ShapeList & | operator= (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) | |
template<typename S > | |
ShapeList (const std::vector< S > &shapes) | |
~ShapeList () override | |
const std::string & | name () const override |
ShapeList & | clear () |
ShapeList & | rotate (double angle, const Point ¢er) override |
ShapeList | rotated (double angle, const Point ¢er) |
ShapeList & | rotate (double angle) override |
ShapeList | rotated (double angle) |
ShapeList & | translate (double dx, double dy) override |
ShapeList | translated (double dx, double dy) |
ShapeList & | scale (double sx, double sy) override |
ShapeList & | scale (double s) override |
ShapeList | scaled (double sx, double sy) const |
ShapeList | scaled (double s) const |
void | scaleAll (double s) override |
void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const override |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const override |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const override |
Rect | boundingBox (LineWidthFlag) const override |
ShapeList * | clone () const override |
ShapeList & | push_back (Shape *shape) |
ShapeList & | operator<< (const Shape &shape) |
template<typename S > | |
ShapeList & | operator<< (const std::vector< S > &shapes) |
ShapeList & | operator+= (const Shape &shape) |
ShapeList & | append (const Shape &shape, Direction direction=Direction::Right, Alignment alignment=Alignment::Center, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth) |
void | addRepeated (const Shape &shape, unsigned int times, double dx, double dy, double scaleX=1.0, double scaleY=1.0, double angle=0.0) |
ShapeList & | duplicateLast (std::size_t copies=1) |
template<typename T > | |
T & | last (const std::size_t position=0) |
Shape & | last (const std::size_t position=0) |
template<typename T > | |
T & | topLevelFindLast (std::size_t position=0) |
Shape & | top () |
void | accept (ShapeVisitor &visitor) override |
Accepts a visitor object. | |
void | accept (const ShapeVisitor &visitor) override |
Accepts a visitor object. | |
void | accept (ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. | |
void | accept (const ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. | |
Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. | |
Shape * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. | |
TopLevelIterator | begin () |
begin | |
TopLevelIterator | end () |
end | |
TopLevelConstIterator | begin () const |
begin | |
TopLevelConstIterator | cbegin () const |
cbegin | |
TopLevelConstIterator | end () const |
end | |
TopLevelConstIterator | cend () const |
cend | |
DepthFirstIterator | depthFirstBegin () |
depthFirstBegin | |
DepthFirstIterator | depthFirstEnd () |
depthFirstEnd | |
BreadthFirstIterator | breadthFirstBegin () |
breadthFirstBegin | |
BreadthFirstIterator | breadthFirstEnd () |
breadthFirstEnd | |
std::size_t | deepSize () const |
Recursively counts the number of shapes in the list. | |
std::size_t | size () const |
The number of shapes in the list (at top level). | |
Public Member Functions inherited from LibBoard::Shape | |
Shape () | |
virtual | ~Shape () |
virtual const std::string & | name () const |
virtual Shape * | clone () const =0 |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
virtual Shape & | rotate (double angle, const Point ¢er)=0 |
virtual Shape & | rotate (double angle)=0 |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
virtual Shape & | translate (double dx, double dy)=0 |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
virtual Shape & | scale (double sx, double sy)=0 |
virtual Shape & | scale (double s)=0 |
Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
virtual Rect | boundingBox (LineWidthFlag) const =0 |
Rect | bbox (LineWidthFlag) const |
virtual void | scaleAll (double s)=0 |
virtual void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const =0 |
virtual void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const =0 |
virtual void | flushSVG (std::ostream &stream, const TransformSVG &transform) const =0 |
virtual void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const =0 |
virtual void | accept (ShapeVisitor &visitor) |
Accepts a visitor object. | |
virtual void | accept (const ShapeVisitor &visitor) |
Accepts a visitor object. | |
virtual void | accept (ConstShapeVisitor &visitor) const |
Accepts a const-shape visitor object. | |
virtual void | accept (const ConstShapeVisitor &visitor) const |
Accepts a const-shape visitor object. | |
virtual Shape * | accept (CompositeShapeTransform &transform) const |
Accept a composite shape transform. | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const |
Accept a constant composite shape transform. | |
Shape (const Shape &other) | |
Static Public Member Functions | |
static void | enableLineWidthScaling () |
static void | disableLineWidthScaling () |
static void | setLineWidthScaling (bool) |
static Rect | pageRect (PageSize size, Unit unit) |
Standard page size as a rectangle Rect(0,0,width,height) | |
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 |
Protected Attributes inherited from LibBoard::ShapeList | |
std::vector< Shape * > | _shapes |
Additional Inherited Members | |
Protected Member Functions inherited from LibBoard::ShapeList | |
void | addShape (const Shape &shape, double scaleFactor) |
void | deleteShapes () |
Class for EPS, FIG or SVG drawings.
The Board class.
|
strong |
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. |
|
override |
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(), scale(), LibBoard::Shape::scale(), and LibBoard::Shape::translate().
Referenced by main().
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::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, and LibBoard::ShapeList::clear().
|
inline |
Clears the board and set the background color from an RGB triple.
red | |
green | |
blue |
References LibBoard::ShapeList::clear().
|
static |
Globally disable linewidth scaling when using scale functions.
References LibBoard::ShapeWithStyle::setLineWidthScaling().
Referenced by main().
void LibBoard::Board::drawArrow | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
Arrow::ExtremityType | type = Arrow::ExtremityType::Plain |
||
) |
Draws a line from (x1,y1) to (x2,y2) with an arrow at (x2,y2) using current style parameters.
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. |
type | The arrow extremity type. |
References LibBoard::ShapeList::_shapes, _state, and LibBoard::Board::State::style.
Referenced by drawLine(), and main().
void LibBoard::Board::drawArrow | ( | Point | p, |
Point | q, | ||
Arrow::ExtremityType | type = Arrow::ExtremityType::Plain |
||
) |
Draws a line from p to q with an arrow at (x2,y2).
p | First extremity. |
q | Second extremity. |
type | The arrow extremity type. |
References LibBoard::ShapeList::_shapes, _state, and LibBoard::Board::State::style.
void LibBoard::Board::drawBoundingBox | ( | LineWidthFlag | lineWidthFlag | ) |
Draws the current drawing's bounding box as a rectangle.
lineWidthFlag | Should the line width be considered when computing bounding boxes. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Shape::bbox(), LibBoard::ShapeList::boundingBox(), LibBoard::Polyline::clone(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::rectangle(), LibBoard::Board::State::style, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::drawCircle | ( | double | x, |
double | y, | ||
double | radius | ||
) |
Draws a circle.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
radius | Radius of the circle. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::circle(), LibBoard::Ellipse::clone(), LibBoard::Style::fillColor, LibBoard::Style::lineStyle, LibBoard::Style::lineWidth, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Referenced by main().
void LibBoard::Board::drawClosedPolyline | ( | const std::vector< Point > & | points | ) |
Draws a closed polygonal line.
points | A vector of points. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, and LibBoard::Board::State::style.
void LibBoard::Board::drawDot | ( | double | x, |
double | y | ||
) |
Draws a dot at coordinates (x,y).
x | First coordinate of the dot. |
y | Second coordinate of the dot. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Style::lineWidth, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Referenced by main().
void LibBoard::Board::drawEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius | ||
) |
Draws an ellipse.
x | First coordinate of the circle's center. |
y | Second coordinate of the circle's center. |
xRadius | Radius of the circle along the x axis. |
yRadius | Radius of the circle along the y axis. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Style::fillColor, LibBoard::Style::lineStyle, LibBoard::Style::lineWidth, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Referenced by main().
void LibBoard::Board::drawLine | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Draws a line from (x1,y1) to (x2,y2) using current style parameters.
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. |
References LibBoard::ShapeList::_shapes, _state, and LibBoard::Board::State::style.
Referenced by main().
Draws a line from p to q using current style parameters.
p | First extremity. |
q | Second extremity. |
References LibBoard::ShapeList::_shapes, _state, and LibBoard::Board::State::style.
void LibBoard::Board::drawPolyline | ( | const std::vector< Point > & | points | ) |
Draws a polygonal line.
points | A vector of points. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Open, and LibBoard::Board::State::style.
Referenced by main().
void LibBoard::Board::drawRectangle | ( | const Rect & | rect | ) |
Draws a rectangle.
rect | Position and size of the rectangle. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Polyline::clone(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::rectangle(), LibBoard::Board::State::style, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::drawRectangle | ( | double | left, |
double | top, | ||
double | width, | ||
double | height | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Polyline::clone(), LibBoard::rectangle(), LibBoard::Board::State::style, and LibBoard::ShapeList::top().
Referenced by drawPixel(), main(), and main().
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const char * | text | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Style::penColor, LibBoard::Board::State::style, and text().
void LibBoard::Board::drawText | ( | double | x, |
double | y, | ||
const std::string & | text | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Style::penColor, LibBoard::Board::State::style, and text().
void LibBoard::Board::drawText | ( | Point | p, |
const char * | text | ||
) |
Draws a string of text.
p | Position of the bottom-left corner. |
text | The text. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Style::penColor, LibBoard::Board::State::style, and text().
void LibBoard::Board::drawText | ( | Point | p, |
const std::string & | str | ||
) |
Draws a string of text.
p | Position of the bottom-left corner. |
str | The text. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Board::State::font, LibBoard::Board::State::fontSize, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Draws a triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, and LibBoard::Board::State::style.
void LibBoard::Board::drawTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3 | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, and LibBoard::Board::State::style.
Referenced by main().
|
static |
Globally enable linewidth scaling when using scale functions.
References LibBoard::ShapeWithStyle::setLineWidthScaling().
Referenced by main().
void LibBoard::Board::fillCircle | ( | double | x, |
double | y, | ||
double | radius | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::circle(), LibBoard::Ellipse::clone(), LibBoard::Style::lineStyle, LibBoard::Color::Null, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Referenced by drawLine(), and main().
|
inline |
fillColor
References _state, LibBoard::Style::fillColor, and LibBoard::Board::State::style.
void LibBoard::Board::fillEllipse | ( | double | x, |
double | y, | ||
double | xRadius, | ||
double | yRadius | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Style::lineStyle, LibBoard::Color::Null, LibBoard::Style::penColor, and LibBoard::Board::State::style.
|
inline |
Draws a triangle with Gouraud-like shaded colors.
x1 | |
y1 | |
color1 | |
x2 | |
y2 | |
color2 | |
x3 | |
y3 | |
color3 | |
divisions |
References fillGouraudTriangle().
|
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 |
References fillGouraudTriangle().
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 |
||
) |
Draws a triangle with Gouraud-like shaded colors.
p1 | |
color1 | |
p2 | |
color2 | |
p3 | |
color3 | |
divisions | number of triangle subdivisions. |
References LibBoard::ShapeList::_shapes.
Referenced by fillGouraudTriangle(), fillGouraudTriangle(), fillGouraudTriangle(), and main().
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 |
||
) |
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. |
References _state, LibBoard::Color::blue(), fillGouraudTriangle(), LibBoard::Color::green(), LibBoard::Style::penColor, LibBoard::Color::red(), and LibBoard::Board::State::style.
void LibBoard::Board::fillPolyline | ( | const std::vector< Point > & | points | ) |
Draws a filled polygon.
points | A vector of points. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, LibBoard::Style::lineCap, LibBoard::Style::lineJoin, LibBoard::Style::lineStyle, LibBoard::Color::Null, LibBoard::Style::penColor, and LibBoard::Board::State::style.
void LibBoard::Board::fillRectangle | ( | const Rect & | rect | ) |
Draws a rectangle filled with the current pen color.
rect | Position and size of the rectangle. |
References fillRectangle(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Board::fillRectangle | ( | double | left, |
double | top, | ||
double | width, | ||
double | height | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::ShapeList::clone(), LibBoard::Style::fillColor, LibBoard::Style::lineWidth, LibBoard::Color::Null, LibBoard::Style::penColor, LibBoard::rectangle(), style(), LibBoard::Board::State::style, and LibBoard::ShapeList::top().
Referenced by fillRectangle().
Draws a filled triangle.
p1 | First vertex. |
p2 | Second vertex. |
p3 | Third vertex. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, LibBoard::Style::lineCap, LibBoard::Style::lineJoin, LibBoard::Style::lineStyle, LibBoard::Color::Null, LibBoard::Style::penColor, and LibBoard::Board::State::style.
void LibBoard::Board::fillTriangle | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3 | ||
) |
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. |
References LibBoard::ShapeList::_shapes, _state, LibBoard::Path::Closed, LibBoard::Style::lineCap, LibBoard::Style::lineJoin, LibBoard::Style::lineStyle, LibBoard::Color::Null, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Add a shape to the board, using the current unit factor.
shape | A shape. (Might be a list of shapes, actually!) |
References LibBoard::ShapeList::addShape().
Board & LibBoard::Board::operator<< | ( | const std::vector< S > & | shapes | ) |
Add of shapes from a vector to the shape list.
References LibBoard::ShapeList::operator<<().
The operator =
other | The object to be copied. |
References LibBoard::ShapeList::_shapes, LibBoard::ShapeList::deleteShapes(), and LibBoard::ShapeList::end().
Standard page size as a rectangle Rect(0,0,width,height)
size | Page size enum |
unit | Unit |
References LibBoard::Centimeter, LibBoard::Tools::error, LibBoard::Inch, LibBoard::Millimeter, LibBoard::Point, and LibBoard::ShapeList::size().
|
inline |
penColor
References _state, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Referenced by main().
|
overridevirtual |
Rotate the board by an angle around the center of its bounding box.
angle | Rotation angle (in radians) |
Implements LibBoard::Shape.
References _clippingPath, LibBoard::Shape::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Rotate the board by an angle around a point.
angle | Rotation angle (in radians) |
center | Rotation center |
Implements LibBoard::Shape.
References _clippingPath, LibBoard::Shape::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Board LibBoard::Board::rotated | ( | double | angle | ) |
Get a rotated copy of the Board around a specified rotation center.
angle | Rotation angle in radian |
center | Center of rotation |
References LibBoard::Shape::center(), and rotate().
void LibBoard::Board::save | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save the drawing in an EPS, XFIG of SVG file depending on the filename extension. When a size is given (not PageSize::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 LibBoard::Tools::CaseInsensitive, saveEPS(), saveFIG(), saveSVG(), saveTikZ(), and LibBoard::Tools::stringEndsWith().
void LibBoard::Board::save | ( | const char * | filename, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save the drawing in an EPS, XFIG of SVG file depending on the filename extension. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, save(), LibBoard::ShapeList::size(), and toMillimeter().
void LibBoard::Board::saveEPS | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Save 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::saveEPS | ( | const char * | filename, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Save the drawing in an EPS file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveEPS(), LibBoard::ShapeList::size(), and toMillimeter().
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Write 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. |
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, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Shape::bbox(), BOARD_VERSION_STRING, LibBoard::Rect::bottom(), LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Path::flushPostscript(), LibBoard::Polyline::flushPostscript(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Color::Null, LibBoard::TransformEPS::pageBoundingBox(), LibBoard::rectangle(), LibBoard::Rect::right(), LibBoard::Tools::secured_ctime(), LibBoard::TransformEPS::setBoundingBox(), LibBoard::Path::size(), toMillimeter(), LibBoard::Rect::top, LibBoard::UseLineWidth, and LibBoard::Rect::width.
void LibBoard::Board::saveEPS | ( | std::ostream & | out, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter , |
||
const std::string & | title = std::string() |
||
) | const |
Writes the drawing in a stream as an EPS file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveEPS(), LibBoard::ShapeList::size(), and toMillimeter().
Referenced by main(), save(), saveEPS(), saveEPS(), and saveEPS().
void LibBoard::Board::saveFIG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Saves the drawing in an XFig file. When a size is given (not PageSize::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. |
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 | ( | const char * | filename, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save the drawing in an XFig file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveFIG(), LibBoard::ShapeList::size(), and toMillimeter().
Referenced by main(), save(), saveFIG(), saveFIG(), and saveFIG().
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save 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. |
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::ShapeList::accept(), LibBoard::Shape::bbox(), BOARD_VERSION_STRING, LibBoard::ShapeList::boundingBox(), LibBoard::PenColorExtractor::colors(), LibBoard::FillColorExtractor::colors(), LibBoard::Polyline::flushFIG(), LibBoard::Rect::height, LibBoard::Color::Null, LibBoard::rectangle(), secured_sprintf, LibBoard::TransformFIG::setBoundingBox(), LibBoard::TransformFIG::setDepthMap(), toMillimeter(), LibBoard::UseLineWidth, LibBoard::Color::valid(), and LibBoard::Rect::width.
void LibBoard::Board::saveFIG | ( | std::ostream & | out, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Saves the drawing in a stream as an XFig file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveFIG(), LibBoard::ShapeList::size(), and toMillimeter().
void LibBoard::Board::saveSVG | ( | const char * | filename, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save the drawing in an SVG file. When a size is given (not PageSize::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. |
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 | ( | const char * | filename, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save the drawing in an SVG file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveSVG(), LibBoard::ShapeList::size(), and toMillimeter().
Referenced by main(), save(), saveSVG(), saveSVG(), and saveSVG().
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
double | pageWidth, | ||
double | pageHeight, | ||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Save 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. |
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, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Shape::bbox(), BOARD_VERSION_STRING, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Polyline::flushSVG(), LibBoard::Path::flushSVGCommands(), LibBoard::Rect::height, LibBoard::Color::Null, LibBoard::rectangle(), LibBoard::TransformSVG::setBoundingBox(), LibBoard::Path::size(), toMillimeter(), LibBoard::UseLineWidth, and LibBoard::Rect::width.
void LibBoard::Board::saveSVG | ( | std::ostream & | out, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 , |
||
Unit | unit = Unit::Millimeter |
||
) | const |
Saves the drawing in a stream as an SVG file. When a size is given (not PageSize::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 PageSize::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 LibBoard::BoundingBox, LibBoard::Millimeter, saveSVG(), LibBoard::ShapeList::size(), and toMillimeter().
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 PageSize::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. |
References saveTikZ().
void LibBoard::Board::saveTikZ | ( | const char * | filename, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 |
||
) | const |
Save the drawing in an TikZ file. When a size is given (not PageSize::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 PageSize::BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
References saveTikZ(), and LibBoard::ShapeList::size().
Referenced by main(), save(), saveTikZ(), saveTikZ(), and 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. |
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, _clippingPath, LibBoard::ShapeList::_shapes, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), LibBoard::Polyline::flushTikZ(), LibBoard::Path::flushTikZPoints(), LibBoard::Color::Null, LibBoard::rectangle(), LibBoard::TransformSVG::setBoundingBox(), LibBoard::Path::size(), and LibBoard::UseLineWidth.
void LibBoard::Board::saveTikZ | ( | std::ostream & | out, |
PageSize | size = PageSize::BoundingBox , |
||
double | margin = 0.0 |
||
) | const |
Save the drawing in a stream as TikZ file. When a size is given (not PageSize::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 PageSize::BoundingBox (default), A4 or Letter). |
margin | Minimal margin around the figure in the page, in millimeters. |
References saveTikZ(), and LibBoard::ShapeList::size().
|
overridevirtual |
Scale the board.
s | Scale factor |
Implements LibBoard::Shape.
References _clippingPath, LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::size(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Scale the board in the x and y direction.
sx | Scale factor in the x direction |
sy | Scale factor in the y direction |
Implements LibBoard::Shape.
References _clippingPath, LibBoard::Path::center(), LibBoard::Shape::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::size(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by addDuplicates(), main(), scaled(), and scaled().
Board LibBoard::Board::scaled | ( | double | s | ) |
Board LibBoard::Board::scaled | ( | double | sx, |
double | sy | ||
) |
void LibBoard::Board::setBackgroundColor | ( | const Color & | color | ) |
Changes the background color of the whole drawing.
color | A color (may be Color::None). |
References _backgroundColor.
void LibBoard::Board::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the whole drawing.
path | A path. |
References _clippingPath, LibBoard::Path::close(), LibBoard::Path::pop_back(), and LibBoard::Path::size().
void LibBoard::Board::setClippingPath | ( | const std::vector< Point > & | points | ) |
Define a clipping path for the whole drawing.
points | A path. |
References _clippingPath, LibBoard::Path::clear(), and LibBoard::ShapeList::end().
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.
void LibBoard::Board::setClippingRectangle | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Define a clipping rectangle for the whole drawing.
x | |
y | |
width | |
height |
References _clippingPath, and LibBoard::Path::clear().
Referenced by main(), and setClippingRectangle().
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, LibBoard::Style::fillColor, and LibBoard::Board::State::style.
Referenced by main().
Board & LibBoard::Board::setFillColorHSV | ( | float | hue, |
float | saturation, | ||
float | value, | ||
float | alpha = 1.0f |
||
) |
Changes the current fill color (HSV version)
hue | |
saturation | |
value | |
alpha |
References _state, LibBoard::Style::fillColor, LibBoard::Color::setHSV(), and LibBoard::Board::State::style.
Board & LibBoard::Board::setFillColorRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0f |
||
) |
Changes the current fill color (RGB version).
red | Red component. |
green | Green component. |
blue | Blue component. |
alpha | The opacity. |
References _state, LibBoard::Style::fillColor, LibBoard::Color::setRGBf(), and LibBoard::Board::State::style.
Referenced by main().
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, LibBoard::Style::fillColor, LibBoard::Color::setRGBi(), and LibBoard::Board::State::style.
Referenced by main().
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.
Referenced by main().
Board & LibBoard::Board::setFontSize | ( | double | fontSize | ) |
Changes the font size.
fontSize | The new font size. |
References _state, and LibBoard::Board::State::fontSize.
Set the line cap style.
cap | The cap-style. |
References _state, LibBoard::Style::lineCap, and LibBoard::Board::State::style.
Referenced by main().
Set the line join style.
join | The join-style |
References _state, LibBoard::Style::lineJoin, and LibBoard::Board::State::style.
Referenced by main().
Changes the current line style.
style | The new line style. |
References _state, LibBoard::Style::lineStyle, style(), and LibBoard::Board::State::style.
Referenced by main().
Board & LibBoard::Board::setLineWidth | ( | double | width | ) |
Changes the current line thickness.
width | The new line thickness. |
References _state, LibBoard::Style::lineWidth, and LibBoard::Board::State::style.
|
static |
Globally enable/disable linewidth scaling when using scale functions.
References LibBoard::ShapeWithStyle::setLineWidthScaling().
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, LibBoard::Style::penColor, and LibBoard::Board::State::style.
Board & LibBoard::Board::setPenColorRGBf | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha = 1.0f |
||
) |
Changes the current pen color.
red | Red component [0..1]. |
green | Green component [0..1]. |
blue | Blue component [0..1]. |
alpha | Transparency [0..1]. |
References _state, LibBoard::Style::penColor, LibBoard::Color::setRGBf(), and LibBoard::Board::State::style.
Referenced by main().
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 [0..255]. |
green | Green component [0..255]. |
blue | Blue component [0..255]. |
alpha | Transparency channel [0..255]. |
References _state, LibBoard::Style::penColor, LibBoard::Color::setRGBi(), and LibBoard::Board::State::style.
Referenced by drawLine(), main(), and main().
|
inline |
Return the current style used when drawing shapes with board methods.
References _state, and LibBoard::Board::State::style.
Referenced by fillRectangle(), main(), and setLineStyle().
|
staticprotected |
References LibBoard::Centimeter, LibBoard::Tools::error, LibBoard::Inch, LibBoard::Millimeter, and LibBoard::Point.
Referenced by save(), saveEPS(), saveEPS(), saveEPS(), saveFIG(), saveFIG(), saveFIG(), saveSVG(), saveSVG(), and saveSVG().
|
overridevirtual |
Translate the board by a given vector.
dx | Shift in the x direction |
dy | Shift in the y direction |
Implements LibBoard::Shape.
References _clippingPath, LibBoard::Path::translate(), and LibBoard::ShapeList::translate().
Referenced by translated().
Board LibBoard::Board::translated | ( | double | dx, |
double | dy | ||
) |
Get a translated copy of the Board.
dx | x shift value |
dy | y shift value |
References translate().
|
protected |
The color of the background.
Referenced by clear(), saveEPS(), saveFIG(), saveSVG(), saveTikZ(), and setBackgroundColor().
|
protected |
Referenced by rotate(), rotate(), saveEPS(), saveSVG(), saveTikZ(), scale(), scale(), setClippingPath(), setClippingPath(), setClippingRectangle(), and translate().
|
protected |
The current state.
Referenced by drawArrow(), drawArrow(), drawBoundingBox(), drawCircle(), drawClosedPolyline(), drawDot(), drawEllipse(), drawLine(), drawLine(), drawPolyline(), drawRectangle(), drawRectangle(), drawText(), drawText(), drawText(), drawText(), drawTriangle(), drawTriangle(), fillCircle(), fillColor(), fillEllipse(), fillGouraudTriangle(), fillPolyline(), fillRectangle(), fillTriangle(), fillTriangle(), penColor(), setFillColor(), setFillColorHSV(), setFillColorRGBf(), setFillColorRGBi(), setFont(), setFontSize(), setLineCap(), setLineJoin(), setLineStyle(), setLineWidth(), setPenColor(), setPenColorRGBf(), setPenColorRGBi(), and style().
|
static |
Referenced by ell(), hachures(), hachuresBis(), hachuresTer(), Koch(), main(), polygons(), rough(), and Sierpinksi().