DGtal
0.9.3
|
#include <Board/Shapes.h>
Public Member Functions | |
Ellipse (double x, double y, double xRadius, double yRadius, DGtal::Color pen, DGtal::Color fill, double lineWidth, const LineStyle lineStyle=SolidStyle, int depthValue=-1) | |
const std::string & | name () const |
Point | center () const |
Ellipse & | rotate (double angle, const Point ¢er) |
Ellipse | rotated (double angle, const Point ¢er) const |
Ellipse & | rotate (double angle) |
Ellipse | rotated (double angle) const |
Ellipse & | translate (double dx, double dy) |
Ellipse | translated (double dx, double dy) const |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Ellipse | scaled (double sx, double sy) const |
Ellipse | 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 |
Ellipse * | 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 | |
Point | _center |
double | _xRadius |
double | _yRadius |
double | _angle |
bool | _circle |
![]() | |
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 |
|
inline |
Definition at line 1340 of file Board/Shapes.h.
References LibBoard::Shape::boundingBox(), LibBoard::Shape::center(), LibBoard::Shape::clone(), LibBoard::Shape::flushCairo(), LibBoard::Shape::flushFIG(), LibBoard::Shape::flushPostscript(), LibBoard::Shape::flushSVG(), LibBoard::Shape::flushTikZ(), LibBoard::Shape::name(), LibBoard::Shape::rotate(), LibBoard::Shape::scale(), LibBoard::Shape::scaleAll(), and LibBoard::Shape::translate().
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Definition at line 1292 of file Shapes.cpp.
References LibBoard::Circle::_name.
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::Circle.
Definition at line 1027 of file Shapes.cpp.
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Reimplemented in LibBoard::Circle.
Definition at line 1152 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::Arc, and LibBoard::Circle.
Definition at line 1233 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(), LibBoard::Transform::mapX(), LibBoard::TransformCairo::mapY(), DGtal::Color::None, DGtal::Color::red(), LibBoard::Transform::scale(), and LibBoard::Shape::setCairoDashStyle().
Referenced by LibBoard::Circle::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.
Definition at line 1186 of file Shapes.cpp.
References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::TransformFIG::mapDepth(), LibBoard::TransformFIG::mapWidth(), LibBoard::Transform::mapX(), LibBoard::TransformFIG::mapY(), LibBoard::Transform::scale(), and DGtal::Color::valid().
|
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::Arc.
Definition at line 1157 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::Transform::mapX(), LibBoard::TransformEPS::mapY(), DGtal::Color::None, DGtal::Color::postscript(), LibBoard::Shape::postscriptProperties(), and LibBoard::Transform::scale().
|
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::Arc, and LibBoard::Circle.
Definition at line 1214 of file Shapes.cpp.
References LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Transform::scale(), and LibBoard::Shape::svgProperties().
Referenced by LibBoard::Circle::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::Arc, and LibBoard::Circle.
Definition at line 1276 of file Shapes.cpp.
References LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Transform::scale(), and LibBoard::Shape::tikzProperties().
Referenced by LibBoard::Circle::flushTikZ().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arc, and LibBoard::Circle.
Definition at line 1021 of file Shapes.cpp.
References LibBoard::Shape::_name.
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::Circle.
Definition at line 1032 of file Shapes.cpp.
References LibBoard::Shape::rotate(), LibBoard::Point::rotated(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by rotate(), LibBoard::Circle::rotate(), and rotated().
|
virtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Circle.
Definition at line 1051 of file Shapes.cpp.
References LibBoard::Shape::center(), and rotate().
angle | angle |
center | center |
Definition at line 1045 of file Shapes.cpp.
References rotate().
Ellipse LibBoard::Ellipse::rotated | ( | double | angle | ) | const |
angle | angle |
Definition at line 1057 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.
Reimplemented in LibBoard::Circle.
Definition at line 1076 of file Shapes.cpp.
Referenced by scale(), LibBoard::Circle::scale(), and scaled().
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Reimplemented in LibBoard::Circle.
Definition at line 1126 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::Circle.
Definition at line 1144 of file Shapes.cpp.
Ellipse LibBoard::Ellipse::scaled | ( | double | sx, |
double | sy | ||
) | const |
sx | scale factor |
sy | scale factor |
Definition at line 1132 of file Shapes.cpp.
References scale().
Ellipse LibBoard::Ellipse::scaled | ( | double | s | ) | const |
Definition at line 1138 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.
Reimplemented in LibBoard::Circle.
Definition at line 1063 of file Shapes.cpp.
Referenced by translated().
Ellipse LibBoard::Ellipse::translated | ( | double | dx, |
double | dy | ||
) | const |
dx | translation along x-axis |
dy | translation along the y-axis |
Definition at line 1070 of file Shapes.cpp.
References translate().
|
protected |
Definition at line 1452 of file Board/Shapes.h.
|
protected |
Definition at line 1449 of file Board/Shapes.h.
|
protected |
Definition at line 1453 of file Board/Shapes.h.
|
staticprivate |
The generic name of the shape.
Definition at line 1446 of file Board/Shapes.h.
Referenced by LibBoard::Arrow::flushTikZ().
|
protected |
Definition at line 1450 of file Board/Shapes.h.
|
protected |
Definition at line 1451 of file Board/Shapes.h.