#include <ShapeList.h>
Public Member Functions | |
ShapeList (int depth=-1) | |
ShapeList (const ShapeList &other) | |
void | clear () |
Point | center () const |
Shape & | rotate (double angle, const Point ¢er) |
Shape & | rotate (double angle) |
Shape & | translate (double dx, double dy) |
Shape & | scale (double sx, double sy) |
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 |
Rect | boundingBox () const |
Shape * | clone () const |
ShapeList & | operator= (const ShapeList &other) |
ShapeList & | operator<< (const Shape &shape) |
Protected Member Functions | |
void | free () |
Protected Attributes | |
std::vector< Shape * > | _shapes |
int | _nextDepth |
The ShapeList structure.
Point BoardLib::ShapeList::center | ( | ) | const [virtual] |
Returns the gravity center of the shape.
Implements BoardLib::Shape.
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. | |
center | The center of rotation. |
Implements BoardLib::Shape.
Shape & BoardLib::ShapeList::rotate | ( | double | angle | ) | [virtual] |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements BoardLib::Shape.
Shape & BoardLib::ShapeList::translate | ( | double | dx, | |
double | dy | |||
) | [virtual] |
Translate the shape by a given offset.
dx | The x offset. | |
dy | The y offset. |
Implements BoardLib::Shape.
Shape & BoardLib::ShapeList::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. |
Implements BoardLib::Shape.
void BoardLib::ShapeList::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. |
Implements BoardLib::Shape.
Reimplemented in BoardLib::Group.
void BoardLib::ShapeList::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. |
Implements BoardLib::Shape.
Reimplemented in BoardLib::Group.
void BoardLib::ShapeList::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. |
Implements BoardLib::Shape.
Reimplemented in BoardLib::Group.
Rect BoardLib::ShapeList::boundingBox | ( | ) | const [virtual] |
Returns the bounding box of the figure.
Implements BoardLib::Shape.
Shape * BoardLib::ShapeList::clone | ( | ) | const [virtual] |
void BoardLib::ShapeList::free | ( | ) | [protected] |
Free the memory used by the shapes in the shape vector.
std::vector<Shape*> BoardLib::ShapeList::_shapes [protected] |
The vector of shapes.
int BoardLib::ShapeList::_nextDepth [protected] |
The depth of the next figure to be added.