DGtal 1.4.0
|
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 <Board/ShapeList.h>
Public Member Functions | |
Group (int depthValue=-1) | |
Group (const Group &other) | |
~Group () | |
const std::string & | name () const |
Shape & | rotate (double angle, const Point ¢er) |
Shape & | rotate (double angle) |
Group | rotated (double angle, const Point ¢er) |
Group | rotated (double angle) |
Shape & | translate (double dx, double dy) |
Group | translated (double dx, double dy) |
Shape & | scale (double sx, double sy) |
Shape & | 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< DGtal::Color, int > &colormap) const |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
void | flushCairo (cairo_t *cr, const TransformCairo &transform) const |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const |
Group & | operator= (const Group &other) |
Shape * | clone () const |
Rect | boundingBox () const |
Public Member Functions inherited from LibBoard::ShapeList | |
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 | flushCairo (cairo_t *cr, const TransformCairo &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 |
Private Attributes | |
Path | _clippingPath |
Static Private Attributes | |
static const std::string | _name |
static unsigned int | _clippingCount = 0 |
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 } |
Protected Member Functions inherited from LibBoard::ShapeList | |
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 |
void | setCairoDashStyle (cairo_t *cr, LineStyle type) const |
std::string | tikzProperties (const TransformTikZ &transform) const |
Protected Attributes inherited from LibBoard::ShapeList | |
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 |
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.
Definition at line 183 of file ShapeList.h.
|
inline |
Definition at line 185 of file ShapeList.h.
Referenced by clone(), rotated(), rotated(), scaled(), scaled(), and translated().
|
inline |
Definition at line 188 of file ShapeList.h.
|
inline |
Definition at line 191 of file ShapeList.h.
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Definition at line 680 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::boundingBox(), LibBoard::ShapeList::boundingBox(), and LibBoard::Path::size().
Referenced by flushFIG().
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Definition at line 690 of file ShapeList.cpp.
References Group().
|
virtual |
Writes the cairo code of the shape in a cairo drawing context according to a transform.
cr | The cairo drawing context. |
transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
Definition at line 661 of file ShapeList.cpp.
|
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. |
colormap | A colormap. |
Implements LibBoard::Shape.
Definition at line 620 of file ShapeList.cpp.
References boundingBox(), LibBoard::ShapeList::flushFIG(), LibBoard::Rect::height, LibBoard::Rect::left, LibBoard::Rect::top, and LibBoard::Rect::width.
|
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.
Definition at line 600 of file ShapeList.cpp.
References _clippingCount, _clippingPath, LibBoard::Path::flushPostscript(), LibBoard::ShapeList::flushPostscript(), and LibBoard::Path::size().
|
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.
Definition at line 637 of file ShapeList.cpp.
References _clippingCount, _clippingPath, LibBoard::ShapeList::flushSVG(), LibBoard::Path::flushSVGCommands(), and LibBoard::Path::size().
|
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.
Definition at line 670 of file ShapeList.cpp.
References LibBoard::ShapeList::flushTikZ().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Definition at line 481 of file ShapeList.cpp.
References _name.
Definition at line 696 of file ShapeList.cpp.
References LibBoard::ShapeList::operator=().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Definition at line 495 of file ShapeList.cpp.
References _clippingPath, LibBoard::ShapeList::center(), LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
Definition at line 487 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Group LibBoard::Group::rotated | ( | double | angle | ) |
Definition at line 542 of file ShapeList.cpp.
References Group().
Definition at line 536 of file ShapeList.cpp.
References Group().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Definition at line 524 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::center(), LibBoard::ShapeList::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
|
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.
Definition at line 511 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::center(), LibBoard::ShapeList::center(), LibBoard::Path::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::translate(), LibBoard::Point::x, and LibBoard::Point::y.
Group LibBoard::Group::scaled | ( | double | s | ) |
Definition at line 560 of file ShapeList.cpp.
References Group().
Group LibBoard::Group::scaled | ( | double | sx, |
double | sy ) |
Definition at line 554 of file ShapeList.cpp.
References Group().
void LibBoard::Group::setClippingPath | ( | const Path & | path | ) |
Define a clipping path for the group.
path | A path. |
Definition at line 589 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::pop_back(), LibBoard::Path::setClosed(), and LibBoard::Path::size().
void LibBoard::Group::setClippingPath | ( | const std::vector< Point > & | points | ) |
Define a clipping path for the group.
points | A path. |
Definition at line 577 of file ShapeList.cpp.
References _clippingPath, and LibBoard::Path::clear().
void LibBoard::Group::setClippingRectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height ) |
Define a clipping rectangle for the group.
x | lower corner of the rectangle |
y | lower corner of the rectangle |
width | width |
height | height |
Definition at line 567 of file ShapeList.cpp.
References _clippingPath, and LibBoard::Path::clear().
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
Definition at line 503 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::translate(), and LibBoard::ShapeList::translate().
Group LibBoard::Group::translated | ( | double | dx, |
double | dy ) |
Definition at line 548 of file ShapeList.cpp.
References Group().
|
staticprivate |
Definition at line 273 of file ShapeList.h.
Referenced by flushPostscript(), and flushSVG().
|
private |
Definition at line 272 of file ShapeList.h.
Referenced by boundingBox(), flushPostscript(), flushSVG(), rotate(), rotate(), scale(), scale(), setClippingPath(), setClippingPath(), setClippingRectangle(), and translate().
|
staticprivate |