|
Board
0.6.devel
|
#include <ShapeList.h>


Public Member Functions | |
| ShapeList (int depth=-1) | |
| ShapeList (const ShapeList &other) | |
| ~ShapeList () | |
| const std::string & | name () const |
| ShapeList & | clear () |
| Point | center () const |
| Shape & | rotate (double angle, const Point ¢er) |
| ShapeList | rotated (double angle, const Point ¢er) |
| Shape & | rotate (double angle) |
| ShapeList | rotated (double angle) |
| Shape & | translate (double dx, double dy) |
| ShapeList | translated (double dx, double dy) |
| Shape & | scale (double sx, double sy) |
| Shape & | scale (double s) |
| ShapeList | scaled (double sx, double sy) |
| ShapeList | scaled (double s) |
| void | scaleAll (double s) |
| void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const |
| void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const |
| void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
| void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const |
| Rect | boundingBox () const |
| virtual int | minDepth () const |
| virtual int | maxDepth () const |
| void | shiftDepth (int shift) |
| Shape * | clone () const |
| ShapeList & | operator= (const ShapeList &other) |
| ShapeList & | operator<< (const Shape &shape) |
| ShapeList & | operator+= (const Shape &shape) |
| ShapeList & | insert (const Shape &shape, int depth) |
| ShapeList & | dup (unsigned int copies=1) |
| template<typename T > | |
| T & | last (const unsigned int position=0) |
| Shape & | last (const unsigned int position=0) |
| Shape & | top () |
Public Member Functions inherited from LibBoard::Shape | |
| Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth) | |
| virtual | ~Shape () |
| bool | filled () const |
| Shape & | rotateDeg (double angle, const Point ¢er) |
| Shape & | rotateDeg (double angle) |
| Rect | bbox () |
| Shape & | operator-- () |
| Shape & | operator++ () |
| int | depth () const |
| virtual void | depth (int) |
| const DGtal::Color & | penColor () const |
| const DGtal::Color & | fillColor () const |
Protected Member Functions | |
| void | addShape (const Shape &shape, double scaleFactor) |
| void | free () |
Protected Member Functions inherited from LibBoard::Shape | |
| std::string | svgProperties (const TransformSVG &transform) const |
| std::string | postscriptProperties () const |
| std::string | tikzProperties (const TransformTikZ &transform) const |
Protected Attributes | |
| std::vector< Shape * > | _shapes |
| int | _nextDepth |
Protected Attributes inherited from LibBoard::Shape | |
| int | _depth |
| DGtal::Color | _penColor |
| DGtal::Color | _fillColor |
| double | _lineWidth |
| LineStyle | _lineStyle |
| LineCap | _lineCap |
| LineJoin | _lineJoin |
Static Private Attributes | |
| static const std::string | _name |
Additional Inherited Members | |
Public Types inherited from LibBoard::Shape | |
| enum | LineCap { ButtCap = 0, RoundCap, SquareCap } |
| enum | LineJoin { MiterJoin = 0, RoundJoin, BevelJoin } |
| enum | LineStyle { SolidStyle = 0, DashStyle, DotStyle, DashDotStyle, DashDotDotStyle, DashDotDotDotStyle } |
A group of shapes.
The ShapeList structure.
|
inline |
Referenced by clone(), rotated(), scaled(), and translated().
| LibBoard::ShapeList::~ShapeList | ( | ) |
References free().
|
protected |
References _nextDepth, _shapes, LibBoard::Shape::clone(), LibBoard::Shape::depth(), minDepth(), LibBoard::Shape::scaleAll(), and LibBoard::shapeGreaterDepth().
Referenced by LibBoard::Board::operator<<().
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _shapes.
Referenced by LibBoard::Group::boundingBox(), LibBoard::Board::drawBoundingBox(), LibBoard::Board::saveEPS(), LibBoard::Board::saveFIG(), LibBoard::Board::saveSVG(), and LibBoard::Board::saveTikZ().
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
References _shapes.
Referenced by rotate(), LibBoard::Board::rotate(), LibBoard::Group::rotate(), rotated(), scale(), LibBoard::Board::scale(), and LibBoard::Group::scale().
| ShapeList & LibBoard::ShapeList::clear | ( | ) |
References _nextDepth, _shapes, and free().
Referenced by LibBoard::Board::clear().
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group.
References ShapeList().
| ShapeList & LibBoard::ShapeList::dup | ( | unsigned int | copies = 1 | ) |
Duplicates the last inserted shape.
| copies | The number of copies. |
References _shapes, and LibBoard::warning.
|
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 LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _shapes, and LibBoard::shapeGreaterDepth().
|
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 LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _shapes, and LibBoard::shapeGreaterDepth().
|
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 LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _shapes, and LibBoard::shapeGreaterDepth().
|
virtual |
Writes the TikZ code of the shape in a stream according to a transform.
| stream | The output stream. |
| transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _shapes, and LibBoard::shapeGreaterDepth().
|
protected |
Free the memory used by the shapes in the shape vector.
References _shapes.
Referenced by clear(), LibBoard::Board::operator=(), operator=(), and ~ShapeList().
Insert the shape at a given depth. If the shape is ShapeList or a Board, then all shapes above it will be shifted.
| shape | |
| depth |
References LibBoard::warning.
| T & LibBoard::ShapeList::last | ( | const unsigned int | position = 0 | ) |
Return the last inserted shape with its actual type, if specified (otherwise, a Shape &).
| position | The position. 0 is the last inserted shape, 1 is the one before, etc. |
| Shape& LibBoard::ShapeList::last | ( | const unsigned int | position = 0 | ) |
|
virtual |
References _shapes, and maxDepth().
Referenced by maxDepth(), and LibBoard::TransformFIG::setDepthRange().
|
virtual |
References _shapes, and minDepth().
Referenced by addShape(), minDepth(), operator<<(), and LibBoard::TransformFIG::setDepthRange().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Group.
References _name.
Adds a shape to the list of shape, always preserving the shape's depth.
| shape |
References _shapes, and LibBoard::Shape::clone().
Adds a shape to the shape list. If the shape has no given depth or is a compound shape (ShapeList) then it is placed on top of the shapes stack. Otherwise, the shape depth is left unchanged.
| shape |
Reimplemented in LibBoard::Board.
References _nextDepth, _shapes, LibBoard::Shape::clone(), LibBoard::Shape::depth(), minDepth(), and LibBoard::shapeGreaterDepth().
Rotate the shape around a given center of rotation.
| angle | The rotation angle in radian. |
| center | The center of rotation. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group, and LibBoard::Board.
References _shapes.
|
virtual |
Rotate the shape around its center.
| angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group, and LibBoard::Board.
Reimplemented in LibBoard::Group, and LibBoard::Board.
References rotate().
| ShapeList LibBoard::ShapeList::rotated | ( | double | angle | ) |
Reimplemented in LibBoard::Group, and LibBoard::Board.
References center(), and ShapeList().
|
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 LibBoard::Shape.
Reimplemented in LibBoard::Group, and LibBoard::Board.
References _shapes, center(), translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by scale().
|
virtual |
Scale the shape along both axis.
| s | The scale factor along both axis. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group, and LibBoard::Board.
References scale().
|
virtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
| s | The scaling factor. |
Implements LibBoard::Shape.
References _shapes.
| ShapeList LibBoard::ShapeList::scaled | ( | double | sx, |
| double | sy | ||
| ) |
Reimplemented in LibBoard::Group, and LibBoard::Board.
References ShapeList().
| ShapeList LibBoard::ShapeList::scaled | ( | double | s | ) |
Reimplemented in LibBoard::Group, and LibBoard::Board.
References ShapeList().
|
virtual |
Reimplemented from LibBoard::Shape.
References _shapes.
| Shape & LibBoard::ShapeList::top | ( | ) |
Convenience function that simply calls last(0).
| position |
|
virtual |
Translate the shape by a given offset.
| dx | The x offset. |
| dy | The y offset. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Group, and LibBoard::Board.
References _shapes.
Referenced by scale().
| ShapeList LibBoard::ShapeList::translated | ( | double | dx, |
| double | dy | ||
| ) |
Reimplemented in LibBoard::Group, and LibBoard::Board.
References ShapeList().
|
staticprivate |
The generic name of the shape.
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Group.
Referenced by name().
|
protected |
The depth of the next figure to be added.
Referenced by addShape(), clear(), LibBoard::Board::drawArc(), LibBoard::Board::drawArrow(), LibBoard::Board::drawBoundingBox(), LibBoard::Board::drawCircle(), LibBoard::Board::drawClosedPolyline(), LibBoard::Board::drawDot(), LibBoard::Board::drawEllipse(), LibBoard::Board::drawImage(), LibBoard::Board::drawLine(), LibBoard::Board::drawPolyline(), LibBoard::Board::drawRectangle(), LibBoard::Board::drawText(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillCircle(), LibBoard::Board::fillEllipse(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillPolyline(), LibBoard::Board::fillRectangle(), LibBoard::Board::fillTriangle(), and operator<<().
|
protected |
The vector of shapes.
Referenced by addShape(), boundingBox(), center(), clear(), LibBoard::Board::drawArc(), LibBoard::Board::drawArrow(), LibBoard::Board::drawBoundingBox(), LibBoard::Board::drawCircle(), LibBoard::Board::drawClosedPolyline(), LibBoard::Board::drawDot(), LibBoard::Board::drawEllipse(), LibBoard::Board::drawImage(), LibBoard::Board::drawLine(), LibBoard::Board::drawPolyline(), LibBoard::Board::drawRectangle(), LibBoard::Board::drawText(), LibBoard::Board::drawTriangle(), dup(), LibBoard::Board::fillCircle(), LibBoard::Board::fillEllipse(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillPolyline(), LibBoard::Board::fillRectangle(), LibBoard::Board::fillTriangle(), flushFIG(), flushPostscript(), flushSVG(), flushTikZ(), free(), maxDepth(), minDepth(), operator+=(), operator<<(), LibBoard::Board::operator=(), operator=(), rotate(), LibBoard::Board::saveEPS(), LibBoard::Board::saveFIG(), LibBoard::Board::saveSVG(), LibBoard::Board::saveTikZ(), scale(), scaleAll(), ShapeList(), shiftDepth(), and translate().