DGtal
0.9.3
|
#include <Board/Shapes.h>
Public Member Functions | |
Polyline (const std::vector< Point > &points, bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
Polyline (const Path &path, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
Polyline (bool closed, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle lineStyle=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
const std::string & | name () const |
Point | center () const |
Polyline & | operator<< (const Point &p) |
Point & | operator[] (const unsigned int n) |
Polyline & | rotate (double angle, const Point ¢er) |
Polyline | rotated (double angle, const Point ¢er) const |
Polyline & | rotate (double angle) |
Polyline | rotated (double angle) const |
Polyline & | translate (double dx, double dy) |
Polyline | translated (double dx, double dy) const |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Polyline | scaled (double sx, double sy) const |
Polyline | scaled (double s) const |
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 |
Polyline * | clone () const |
![]() | |
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) |
virtual void | shiftDepth (int shift) |
const DGtal::Color & | penColor () const |
const DGtal::Color & | fillColor () const |
Protected Attributes | |
Path | _path |
![]() | |
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 | |
![]() | |
enum | LineCap { ButtCap = 0, RoundCap, SquareCap } |
enum | LineJoin { MiterJoin = 0, RoundJoin, BevelJoin } |
enum | LineStyle { SolidStyle = 0, DashStyle, DotStyle, DashDotStyle, DashDotDotStyle, DashDotDotDotStyle } |
![]() | |
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 |
A polygonal line described by a series of 2D points.
The polyline structure.
Definition at line 765 of file Board/Shapes.h.
|
inline |
Referenced by LibBoard::GouraudTriangle::flushFIG().
|
inline |
|
inline |
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Definition at line 1868 of file Shapes.cpp.
References LibBoard::Rectangle::_name.
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle.
Definition at line 1656 of file Shapes.cpp.
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1732 of file Shapes.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. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::QuadraticBezierCurve, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1810 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, DGtal::Color::blue(), LibBoard::Shape::filled(), DGtal::Color::green(), DGtal::Color::None, DGtal::Color::red(), and LibBoard::Shape::setCairoDashStyle().
Referenced by LibBoard::Rectangle::flushCairo().
|
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.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::QuadraticBezierCurve, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1761 of file Shapes.cpp.
References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::TransformFIG::mapDepth(), LibBoard::TransformFIG::mapWidth(), and DGtal::Color::valid().
Referenced by LibBoard::Rectangle::flushFIG(), and LibBoard::QuadraticBezierCurve::flushFIG().
|
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::GouraudTriangle, and LibBoard::QuadraticBezierCurve.
Definition at line 1737 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), DGtal::Color::flushPostscript(), DGtal::Color::None, and LibBoard::Shape::postscriptProperties().
Referenced by LibBoard::GouraudTriangle::flushPostscript(), and LibBoard::Board::saveEPS().
|
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::GouraudTriangle, LibBoard::QuadraticBezierCurve, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1793 of file Shapes.cpp.
References LibBoard::Shape::svgProperties().
Referenced by LibBoard::Rectangle::flushSVG(), and LibBoard::GouraudTriangle::flushSVG().
|
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::GouraudTriangle, LibBoard::QuadraticBezierCurve, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1851 of file Shapes.cpp.
References LibBoard::Shape::tikzProperties().
Referenced by LibBoard::Rectangle::flushTikZ().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::QuadraticBezierCurve, LibBoard::Triangle, LibBoard::Image, and LibBoard::Rectangle.
Definition at line 1643 of file Shapes.cpp.
References LibBoard::Shape::_name.
Add a point to the polyline.
p | point to add |
Definition at line 1649 of file Shapes.cpp.
|
inline |
Returns the n-th point of the polyline.
n | index |
Definition at line 815 of file Board/Shapes.h.
References LibBoard::Shape::boundingBox(), LibBoard::Shape::clone(), LibBoard::Shape::flushCairo(), LibBoard::Shape::flushFIG(), LibBoard::Shape::flushPostscript(), LibBoard::Shape::flushSVG(), LibBoard::Shape::flushTikZ(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), LibBoard::Shape::scaleAll(), and LibBoard::Shape::translate().
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::GouraudTriangle.
Definition at line 1661 of file Shapes.cpp.
References rotate().
Referenced by rotate(), rotated(), LibBoard::Rectangle::rotated(), and LibBoard::Triangle::rotated().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle.
Definition at line 1674 of file Shapes.cpp.
References LibBoard::Shape::center(), and rotate().
angle | angle |
center | center |
Definition at line 1668 of file Shapes.cpp.
References rotate().
Polyline LibBoard::Polyline::rotated | ( | double | angle | ) | const |
angle | angle |
Definition at line 1681 of file Shapes.cpp.
References LibBoard::Shape::center(), and rotate().
|
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 1700 of file Shapes.cpp.
References LibBoard::Shape::scale().
Referenced by scale(), scaled(), LibBoard::Rectangle::scaled(), and LibBoard::Triangle::scaled().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Definition at line 1707 of file Shapes.cpp.
References scale().
|
virtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, and LibBoard::Rectangle.
Definition at line 1726 of file Shapes.cpp.
Polyline LibBoard::Polyline::scaled | ( | double | sx, |
double | sy | ||
) | const |
sx | sx |
sy | sy |
Definition at line 1714 of file Shapes.cpp.
References scale().
Polyline LibBoard::Polyline::scaled | ( | double | s | ) | const |
Definition at line 1720 of file Shapes.cpp.
References scale().
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
Definition at line 1687 of file Shapes.cpp.
References translate().
Referenced by translate(), translated(), LibBoard::Rectangle::translated(), and LibBoard::Triangle::translated().
Polyline LibBoard::Polyline::translated | ( | double | dx, |
double | dy | ||
) | const |
dx | dx |
dy | dy |
Definition at line 1694 of file Shapes.cpp.
References translate().
|
staticprivate |
The generic name of the shape.
Definition at line 902 of file Board/Shapes.h.
Referenced by LibBoard::Arc::flushTikZ().
|
protected |
Definition at line 905 of file Board/Shapes.h.
Referenced by LibBoard::GouraudTriangle::center(), LibBoard::QuadraticBezierCurve::flushCairo(), LibBoard::GouraudTriangle::flushFIG(), LibBoard::QuadraticBezierCurve::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::QuadraticBezierCurve::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::QuadraticBezierCurve::flushTikZ(), LibBoard::GouraudTriangle::GouraudTriangle(), LibBoard::GouraudTriangle::rotate(), and LibBoard::GouraudTriangle::scaleAll().