DGtal 1.3.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 |
![]() | |
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 () |
![]() | |
Shape (DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth) | |
virtual | ~Shape () |
virtual const std::string & | name () const |
virtual Shape * | clone () const =0 |
bool | filled () const |
virtual Point | center () const =0 |
virtual Shape & | rotate (double angle, const Point ¢er)=0 |
virtual Shape & | rotate (double angle)=0 |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
virtual Shape & | translate (double dx, double dy)=0 |
virtual Shape & | scale (double sx, double sy)=0 |
virtual Shape & | scale (double s)=0 |
virtual Rect | boundingBox () const =0 |
Rect | bbox () |
Shape & | operator-- () |
Shape & | operator++ () |
virtual void | scaleAll (double s)=0 |
virtual void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const =0 |
virtual void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const =0 |
virtual void | flushSVG (std::ostream &stream, const TransformSVG &transform) const =0 |
virtual void | flushCairo (cairo_t *cr, const TransformCairo &transform) const =0 |
virtual void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const =0 |
int | depth () const |
virtual void | depth (int) |
virtual void | shiftDepth (int shift) |
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 | |
![]() | |
enum | LineCap { ButtCap = 0 , RoundCap , SquareCap } |
enum | LineJoin { MiterJoin = 0 , RoundJoin , BevelJoin } |
enum | LineStyle { SolidStyle = 0 , DashStyle , DotStyle , DashDotStyle , DashDotDotStyle , DashDotDotDotStyle } |
![]() | |
void | addShape (const Shape &shape, double scaleFactor) |
void | free () |
![]() | |
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 |
![]() | |
std::vector< Shape * > | _shapes |
int | _nextDepth |
![]() | |
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.
|
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.
Reimplemented from LibBoard::ShapeList.
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.
Reimplemented from LibBoard::ShapeList.
Definition at line 690 of file ShapeList.cpp.
|
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
Definition at line 487 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::rotate(), and LibBoard::ShapeList::rotate().
Referenced by rotated().
Group LibBoard::Group::rotated | ( | double | angle | ) |
Definition at line 542 of file ShapeList.cpp.
References rotate().
Definition at line 536 of file ShapeList.cpp.
References rotate().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Reimplemented from LibBoard::ShapeList.
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. |
Reimplemented from LibBoard::ShapeList.
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.
Referenced by scaled().
Group LibBoard::Group::scaled | ( | double | s | ) |
Definition at line 560 of file ShapeList.cpp.
References scale().
Group LibBoard::Group::scaled | ( | double | sx, |
double | sy | ||
) |
Definition at line 554 of file ShapeList.cpp.
References scale().
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. |
Reimplemented from LibBoard::ShapeList.
Definition at line 503 of file ShapeList.cpp.
References _clippingPath, LibBoard::Path::translate(), and LibBoard::ShapeList::translate().
Referenced by translated().
Group LibBoard::Group::translated | ( | double | dx, |
double | dy | ||
) |
Definition at line 548 of file ShapeList.cpp.
References translate().
|
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(), scale(), setClippingPath(), setClippingRectangle(), and translate().
|
staticprivate |