DGtal 1.4.0
|
A line between two points. More...
#include <Board/Shapes.h>
Public Member Functions | |
Dot (double x, double y, DGtal::Color color, double lineWidth, int depth=-1) | |
const std::string & | name () const |
Point | center () const |
Dot & | rotate (double angle, const Point ¢er) |
Dot | rotated (double angle, const Point ¢er) const |
Dot & | rotate (double angle) |
Dot | rotated (double angle) const |
Dot & | translate (double dx, double dy) |
Dot | translated (double dx, double dy) const |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Dot | scaled (double sx, double sy) const |
Dot | 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 |
Dot * | clone () const |
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) |
virtual void | shiftDepth (int shift) |
const DGtal::Color & | penColor () const |
const DGtal::Color & | fillColor () const |
Protected Attributes | |
double | _x |
double | _y |
Protected Attributes inherited from LibBoard::Shape | |
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 | |
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::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 |
A line between two points.
The dot structure. This primitive ha been reported as "missing" by Manuel Peinado from Spain. Manuel also suggested that rendering a dot consists in drawing a line from a point to the same point with a roundcap style.
Definition at line 398 of file Board/Shapes.h.
|
inline |
References rotate().
Referenced by clone(), rotated(), and translated().
|
virtual |
Returns the bounding box of the figure.
Implements LibBoard::Shape.
Definition at line 379 of file Shapes.cpp.
|
virtual |
Returns the gravity center of the shape.
Implements LibBoard::Shape.
Definition at line 218 of file Shapes.cpp.
|
virtual |
Return a copy of the shape.
Implements LibBoard::Shape.
Definition at line 385 of file Shapes.cpp.
References Dot().
|
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 348 of file Shapes.cpp.
References LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, _x, _y, DGtal::Color::blue(), DGtal::Color::green(), DGtal::Color::red(), and LibBoard::Shape::setCairoDashStyle().
|
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 308 of file Shapes.cpp.
References LibBoard::Shape::_depth, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, _x, _y, 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.
Definition at line 293 of file Shapes.cpp.
References LibBoard::Shape::_penColor, _x, _y, DGtal::Color::postscript(), and LibBoard::Shape::postscriptProperties().
|
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 335 of file Shapes.cpp.
References _x, _y, 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.
Definition at line 370 of file Shapes.cpp.
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Definition at line 212 of file Shapes.cpp.
References _name.
|
virtual |
Rotates the dot around its center (actually does nothing!).
angle | The rotation angle. |
Implements LibBoard::Shape.
Definition at line 236 of file Shapes.cpp.
Rotates the dot around a given center of rotation.
angle | The rotation angle. |
center | The center of rotation. |
Implements LibBoard::Shape.
Definition at line 223 of file Shapes.cpp.
Dot LibBoard::Dot::rotated | ( | double | angle | ) | const |
Returns a copy of the dot rotated around its center (i.e. left unchanged!)
angle | The rotation angle. |
Definition at line 242 of file Shapes.cpp.
|
virtual |
Scale the shape along both axis.
s | The scale factor along both axis. |
Implements LibBoard::Shape.
Definition at line 268 of file Shapes.cpp.
|
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 262 of file Shapes.cpp.
|
virtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
Definition at line 286 of file Shapes.cpp.
Dot LibBoard::Dot::scaled | ( | double | s | ) | const |
Definition at line 280 of file Shapes.cpp.
Dot LibBoard::Dot::scaled | ( | double | sx, |
double | sy ) const |
Returns a scaled copy of the dot, i.e. the dot itself. (Dots are not actually scaled since their diameters is given by the line width.)
sx | The scale factor around the x axis. |
sy | The scale factor around the y axis. |
Definition at line 274 of file Shapes.cpp.
|
virtual |
dx | dx |
dy | dy |
Implements LibBoard::Shape.
Definition at line 248 of file Shapes.cpp.
Referenced by translated().
Dot LibBoard::Dot::translated | ( | double | dx, |
double | dy ) const |
Returns a translated copy of the dot.
dx | Shift of the first coordinate. |
dy | Shift of the second coordinate. |
Definition at line 256 of file Shapes.cpp.
References Dot(), and translate().
|
staticprivate |
|
protected |
First coordinate of the dot.
Definition at line 524 of file Board/Shapes.h.
Referenced by boundingBox(), center(), flushCairo(), flushFIG(), flushPostscript(), flushSVG(), rotate(), scaleAll(), and translate().
|
protected |
Second coordinate of the dot.
Definition at line 525 of file Board/Shapes.h.
Referenced by boundingBox(), center(), flushCairo(), flushFIG(), flushPostscript(), flushSVG(), rotate(), scaleAll(), and translate().