DGtal 1.4.0
|
A rectangle. More...
#include <Board/Shapes.h>
Public Member Functions | |
Rectangle (double x, double y, double width, double height, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
Rectangle (const Rect &rect, DGtal::Color penColor, DGtal::Color fillColor, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
const std::string & | name () const |
double | x () const |
double | y () const |
double | width () |
double | height () |
Point | topLeft () |
Point | topRight () |
Point | bottomLeft () |
Point | bottomRight () |
Rectangle | rotated (double angle, const Point ¢er) const |
Rectangle | rotated (double angle) const |
Rectangle | translated (double dx, double dy) const |
Rectangle | scaled (double sx, double sy) const |
Rectangle | scaled (double s) const |
void | scaleAll (double s) |
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 |
Rectangle * | clone () const |
Public Member Functions inherited from LibBoard::Polyline | |
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) | |
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 | flushPostscript (std::ostream &stream, const TransformEPS &transform) const |
Rect | boundingBox () 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 | |
bool | _isRectangle |
Protected Attributes inherited from LibBoard::Polyline | |
Path | _path |
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 |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 944 of file Board/Shapes.h.
References LibBoard::Polyline::_path.
|
virtual |
Return a copy of the shape.
Reimplemented from LibBoard::Polyline.
Definition at line 1921 of file Shapes.cpp.
References Rectangle().
|
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::Polyline.
Definition at line 2010 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Polyline::_path, LibBoard::Shape::_penColor, DGtal::Color::blue(), LibBoard::Shape::filled(), LibBoard::Polyline::flushCairo(), DGtal::Color::green(), DGtal::Color::None, 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. |
Reimplemented from LibBoard::Polyline.
Definition at line 1926 of file Shapes.cpp.
References LibBoard::Shape::_depth, LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Polyline::_path, LibBoard::Shape::_penColor, LibBoard::Shape::filled(), LibBoard::Path::flushFIG(), LibBoard::Polyline::flushFIG(), and DGtal::Color::valid().
|
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::Polyline.
Definition at line 1971 of file Shapes.cpp.
References LibBoard::Polyline::_path, LibBoard::Polyline::flushSVG(), 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. |
Reimplemented from LibBoard::Polyline.
Definition at line 2071 of file Shapes.cpp.
References LibBoard::Polyline::_path, LibBoard::Polyline::flushTikZ(), and LibBoard::Shape::tikzProperties().
|
inline |
Definition at line 940 of file Board/Shapes.h.
References LibBoard::Polyline::_path.
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Polyline.
Definition at line 1879 of file Shapes.cpp.
References _name.
Rectangle LibBoard::Rectangle::rotated | ( | double | angle | ) | const |
Returns a copy of the arrow, rotated around its center.
angle | The angle of rotation. |
Definition at line 1891 of file Shapes.cpp.
References LibBoard::Polyline::center(), and Rectangle().
Returns a copy of the arrow, rotated around a given rotation center.
angle | The rotation angle. |
center | The center of rotation. |
Definition at line 1885 of file Shapes.cpp.
References Rectangle().
|
virtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Reimplemented from LibBoard::Polyline.
Definition at line 1915 of file Shapes.cpp.
References LibBoard::Polyline::_path, and LibBoard::Path::scaleAll().
Rectangle LibBoard::Rectangle::scaled | ( | double | s | ) | const |
Definition at line 1909 of file Shapes.cpp.
References Rectangle().
Rectangle LibBoard::Rectangle::scaled | ( | double | sx, |
double | sy ) const |
Returns a scaled copy of the arrow.
sx | Scale factor along the x axis. |
sy | Scale factor along the y axis. |
Definition at line 1903 of file Shapes.cpp.
References Rectangle().
|
inline |
Definition at line 941 of file Board/Shapes.h.
References LibBoard::Polyline::_path.
|
inline |
Definition at line 942 of file Board/Shapes.h.
References LibBoard::Polyline::_path.
Rectangle LibBoard::Rectangle::translated | ( | double | dx, |
double | dy ) const |
Returns a translated copy of the arrow.
dx | The shift along the x axis. |
dy | The shift along the y axis. |
Definition at line 1897 of file Shapes.cpp.
References Rectangle().
|
inline |
Definition at line 939 of file Board/Shapes.h.
References LibBoard::Polyline::_path.
|
inline |
|
inline |
|
protected |
Definition at line 1017 of file Board/Shapes.h.
|
staticprivate |
The generic name of the shape.
Definition at line 1014 of file Board/Shapes.h.
Referenced by name().