Board
0.9.4
|
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a FIG file, it is a true compound element. More...
#include <ShapeList.h>
Public Member Functions | |
Group (int depth=-1) | |
Group (const Group &other) | |
const std::string & | name () const |
Group & | rotate (double angle, const Point ¢er) |
Group & | rotate (double angle) |
Group | rotated (double angle, const Point ¢er) |
Group | rotated (double angle) |
Group & | translate (double dx, double dy) |
Group | translated (double dx, double dy) |
Group & | scale (double sx, double sy) |
Group & | scale (double s) |
Group | scaled (double sx, double sy) |
Group | scaled (double s) |
void | setClippingRectangle (float x, float y, float width, float height) |
void | setClippingPath (const std::vector< Point > &points) |
void | setClippingPath (const Path &path) |
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 |
Group & | operator= (const Group &other) |
Group * | clone () const |
Rect | boundingBox (LineWidthFlag) const |
![]() | |
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) | |
ShapeList & | clear () |
ShapeList | rotated (double angle, const Point ¢er) |
ShapeList | rotated (double angle) |
ShapeList | translated (double dx, double dy) |
ShapeList | scaled (double sx, double sy) |
ShapeList | scaled (double s) |
void | scaleAll (double s) |
virtual int | minDepth () const |
virtual int | maxDepth () const |
void | shiftDepth (int shift) |
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 |
Additional Inherited Members | |
![]() | |
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 } |
![]() | |
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... | |
![]() | |
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 |
![]() | |
std::vector< Shape * > | _shapes |
int | _nextDepth |
![]() | |
int | _depth |
Color | _penColor |
Color | _fillColor |
double | _lineWidth |
LineStyle | _lineStyle |
LineCap | _lineCap |
LineJoin | _lineJoin |
![]() | |
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 |
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a FIG file, it is a true compound element.
The Group structure.
|
virtual |
Compute the bounding box of the figure.
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::boundingBox(), and LibBoard::Path::boundingBox().
Referenced by flushFIG().
|
virtual |
|
virtual |
Write the FIG code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::Shape::bbox(), boundingBox(), LibBoard::ShapeList::flushFIG(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
|
virtual |
Write the EPS code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::flushPostscript().
|
virtual |
Write the SVG code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::flushSVG().
|
virtual |
Write the TikZ code of the shape in a stream according to a transform.
stream | The output stream. |
transform | A 2D transform to be applied. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::flushTikZ().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::ShapeList.
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::rotate(), and LibBoard::Path::rotate().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::Shape::center(), LibBoard::ShapeList::rotate(), and LibBoard::Path::rotate().
|
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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::Group::setClippingPath | ( | const std::vector< Point > & | points | ) |
void LibBoard::Group::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the group.
points | A path. |
References LibBoard::Path::pop_back().
void LibBoard::Group::setClippingRectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Define a clipping rectangle for the group.
x | |
y | |
width | |
height |
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::translate(), and LibBoard::Path::translate().