Board
0.6.devel
|
#include <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 | 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 |
std::string | tikzProperties (const TransformTikZ &transform) const |
A polygonal line described by a series of 2D points.
The polyline structure.
|
inline |
Referenced by clone(), LibBoard::GouraudTriangle::flushFIG(), rotated(), scaled(), and translated().
|
inline |
|
inline |
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
References _path, and LibBoard::Path::boundingBox().
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle.
References _path, and LibBoard::Path::center().
Referenced by rotate(), rotated(), and LibBoard::Rectangle::rotated().
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, LibBoard::Image, and LibBoard::Rectangle.
References Polyline().
|
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::GouraudTriangle, LibBoard::Image, and LibBoard::Rectangle.
References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, _path, LibBoard::Shape::_penColor, LibBoard::Path::closed(), LibBoard::Path::empty(), LibBoard::Shape::filled(), LibBoard::Path::flushFIG(), LibBoard::TransformFIG::mapDepth(), LibBoard::TransformFIG::mapWidth(), and LibBoard::Path::size().
|
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.
References LibBoard::Shape::_fillColor, _path, LibBoard::Shape::_penColor, LibBoard::Path::empty(), LibBoard::Shape::filled(), LibBoard::Path::flushPostscript(), and LibBoard::Shape::postscriptProperties().
Referenced by 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::Image, and LibBoard::Rectangle.
References _path, LibBoard::Path::closed(), LibBoard::Path::empty(), LibBoard::Path::flushSVGPoints(), and LibBoard::Shape::svgProperties().
|
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::Image, and LibBoard::Rectangle.
References _path, LibBoard::Path::closed(), LibBoard::Path::empty(), LibBoard::Path::flushTikZPoints(), and LibBoard::Shape::tikzProperties().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, LibBoard::Image, and LibBoard::Rectangle.
References _name.
|
inline |
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.
References _path, and LibBoard::Path::rotate().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle.
References _path, center(), and LibBoard::Path::rotate().
angle | |
center |
Reimplemented in LibBoard::GouraudTriangle, and LibBoard::Rectangle.
References Polyline().
Polyline LibBoard::Polyline::rotated | ( | double | angle | ) | const |
angle |
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, and LibBoard::Rectangle.
References center(), and Polyline().
|
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.
References _path, and LibBoard::Path::scale().
Referenced by scale().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
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.
References _path, and LibBoard::Path::scaleAll().
Polyline LibBoard::Polyline::scaled | ( | double | sx, |
double | sy | ||
) | const |
sx | |
sy |
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, and LibBoard::Rectangle.
References Polyline().
Polyline LibBoard::Polyline::scaled | ( | double | s | ) | const |
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, and LibBoard::Rectangle.
References Polyline().
|
virtual |
Translate the shape by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
References _path, and LibBoard::Path::translate().
Polyline LibBoard::Polyline::translated | ( | double | dx, |
double | dy | ||
) | const |
dx | |
dy |
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, and LibBoard::Rectangle.
References Polyline().
|
staticprivate |
The generic name of the shape.
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::GouraudTriangle, LibBoard::Triangle, LibBoard::Image, and LibBoard::Rectangle.
Referenced by name().
|
protected |
Referenced by LibBoard::Rectangle::bottomLeft(), LibBoard::Rectangle::bottomRight(), boundingBox(), center(), flushFIG(), LibBoard::Rectangle::flushFIG(), LibBoard::Image::flushFIG(), flushPostscript(), flushSVG(), LibBoard::Rectangle::flushSVG(), LibBoard::Image::flushSVG(), flushTikZ(), LibBoard::Image::flushTikZ(), LibBoard::Rectangle::height(), operator<<(), operator[](), rotate(), scale(), scaleAll(), LibBoard::Rectangle::scaleAll(), LibBoard::Rectangle::topLeft(), LibBoard::Rectangle::topRight(), translate(), LibBoard::Triangle::Triangle(), LibBoard::Rectangle::width(), LibBoard::Rectangle::x(), and LibBoard::Rectangle::y().