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 |
Group & | operator= (const Group &other) |
Group * | clone () const |
Rect | boundingBox () const |
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.
examples/arrows.cpp, examples/clipping.cpp, examples/ellipse.cpp, examples/example4.cpp, and examples/koch.cpp.
Rect LibBoard::Group::boundingBox | ( | ) | const [virtual] |
Returns the bounding box of the figure.
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::boundingBox().
Referenced by flushFIG().
Group * LibBoard::Group::clone | ( | ) | const [virtual] |
void LibBoard::Group::flushFIG | ( | std::ostream & | stream, | |
const TransformFIG & | transform, | |||
std::map< Color, int > & | colormap | |||
) | const [virtual] |
Writes 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::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
void LibBoard::Group::flushPostscript | ( | std::ostream & | stream, | |
const TransformEPS & | transform | |||
) | const [virtual] |
Writes 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.
void LibBoard::Group::flushSVG | ( | std::ostream & | stream, | |
const TransformSVG & | transform | |||
) | const [virtual] |
Writes 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.
const std::string & LibBoard::Group::name | ( | ) | const [virtual] |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::ShapeList.
Group & LibBoard::Group::rotate | ( | double | angle | ) | [virtual] |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::center(), LibBoard::Path::rotate(), and rotate().
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::Path::rotate().
Referenced by rotate().
Group & LibBoard::Group::scale | ( | double | s | ) | [virtual] |
Scale the shape along both axis.
s | The scale factor along both axis. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::center(), LibBoard::Path::center(), scale(), LibBoard::Path::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Group & LibBoard::Group::scale | ( | double | sx, | |
double | sy | |||
) | [virtual] |
Scale the shape along the x an y axis.
sx | The scale factor along the x axis. | |
sy | The scale factor along the y axis. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::ShapeList::center(), LibBoard::Path::center(), LibBoard::Path::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by scale().
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::setClippingPath | ( | const std::vector< Point > & | points | ) |
void LibBoard::Group::setClippingRectangle | ( | float | x, | |
float | y, | |||
float | width, | |||
float | height | |||
) |
Define a clipping rectangle for the group.
x | ||
y | ||
width | ||
height |
Group & LibBoard::Group::translate | ( | double | dx, | |
double | dy | |||
) | [virtual] |
Translate the shape by a given offset.
dx | The x offset. | |
dy | The y offset. |
Reimplemented from LibBoard::ShapeList.
References LibBoard::Path::translate().