DGtal 1.3.0
|
A line between two points with an arrow at one extremity. More...
#include <Board/Shapes.h>
Public Member Functions | |
Arrow (double x1, double y1, double x2, double y2, 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 |
Arrow | rotated (double angle, const Point ¢er) const |
Arrow | rotated (double angle) const |
Arrow | translated (double dx, double dy) const |
Arrow | scaled (double sx, double sy) const |
Arrow | scaled (double s) const |
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 |
Arrow * | clone () const |
Public Member Functions inherited from LibBoard::Line | |
Line (double x1, double y1, double x2, double y2, DGtal::Color color, double lineWidth, const LineStyle style=SolidStyle, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
const std::string & | name () const |
Point | center () const |
Line & | rotate (double angle, const Point ¢er) |
Line | rotated (double angle, const Point ¢er) const |
Line & | rotate (double angle) |
Line | rotated (double angle) const |
Line & | translate (double dx, double dy) |
Line | translated (double dx, double dy) const |
Shape & | scale (double sx, double sy) |
Shape & | scale (double s) |
Line | scaled (double sx, double sy) const |
Line | 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 |
Line * | 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 () |
virtual const std::string & | name () const |
virtual Shape * | clone () const =0 |
bool | filled () const |
virtual Point | center () const =0 |
virtual Shape & | rotate (double angle, const Point ¢er)=0 |
virtual Shape & | rotate (double angle)=0 |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
virtual Shape & | translate (double dx, double dy)=0 |
virtual Shape & | scale (double sx, double sy)=0 |
virtual Shape & | scale (double s)=0 |
virtual Rect | boundingBox () const =0 |
Rect | bbox () |
Shape & | operator-- () |
Shape & | operator++ () |
virtual void | scaleAll (double s)=0 |
virtual void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const =0 |
virtual void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< DGtal::Color, int > &colormap) const =0 |
virtual void | flushSVG (std::ostream &stream, const TransformSVG &transform) const =0 |
virtual void | flushCairo (cairo_t *cr, const TransformCairo &transform) const =0 |
virtual void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const =0 |
int | depth () const |
virtual void | depth (int) |
virtual void | shiftDepth (int shift) |
const DGtal::Color & | penColor () const |
const DGtal::Color & | fillColor () const |
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 |
Protected Attributes inherited from LibBoard::Line | |
double | _x1 |
double | _y1 |
double | _x2 |
double | _y2 |
Protected Attributes inherited from LibBoard::Shape | |
int | _depth |
DGtal::Color | _penColor |
DGtal::Color | _fillColor |
double | _lineWidth |
LineStyle | _lineStyle |
LineCap | _lineCap |
LineJoin | _lineJoin |
A line between two points with an arrow at one extremity.
The arrow structure.
Definition at line 665 of file Board/Shapes.h.
|
inline |
Constructs an arrow.
x1 | First coordinate of the start point. |
y1 | Second coordinate of the start point. |
x2 | First coordinate of the end point. |
y2 | Second coordinate of the end point. |
penColor | The color of the line. |
fillColor | The fill color of the sharp end. |
lineWidth | The line thickness. |
style | Line style. |
cap | Line cap. |
join | Line join. |
depth | The depth of the line. |
|
virtual |
Return a copy of the shape.
Reimplemented from LibBoard::Line.
Definition at line 788 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. |
Reimplemented from LibBoard::Line.
Definition at line 933 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, DGtal::Color::blue(), LibBoard::Shape::ButtCap, LibBoard::Shape::filled(), DGtal::Color::green(), LibBoard::Shape::MiterJoin, DGtal::Color::None, DGtal::Color::red(), LibBoard::Shape::setCairoDashStyle(), and LibBoard::Shape::SolidStyle.
|
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::Line.
Definition at line 847 of file Shapes.cpp.
References LibBoard::Shape::_depth, LibBoard::Shape::_lineCap, LibBoard::Shape::_lineJoin, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, LibBoard::Shape::filled(), 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. |
Reimplemented from LibBoard::Line.
Definition at line 793 of file Shapes.cpp.
References LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, LibBoard::Shape::filled(), 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. |
Reimplemented from LibBoard::Line.
Definition at line 880 of file Shapes.cpp.
References LibBoard::Shape::_fillColor, LibBoard::Shape::_lineStyle, LibBoard::Shape::_lineWidth, LibBoard::Shape::_penColor, LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, LibBoard::Shape::SolidStyle, DGtal::Color::svg(), and DGtal::Color::svgAlpha().
|
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::Line.
Definition at line 1002 of file Shapes.cpp.
References LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, and LibBoard::Shape::tikzProperties().
|
virtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Line.
Definition at line 733 of file Shapes.cpp.
References _name.
Arrow LibBoard::Arrow::rotated | ( | double | angle | ) | const |
Returns a copy of the arrow, rotated around its center.
angle | The angle of rotation. |
Definition at line 748 of file Shapes.cpp.
References LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, LibBoard::Line::center(), LibBoard::Point::get(), and LibBoard::Point::rotate().
Returns a copy of the arrow, rotated around a given rotation center.
angle | The rotation angle. |
center | The center of rotation. |
Definition at line 739 of file Shapes.cpp.
References LibBoard::Line::_x1, LibBoard::Line::_x2, LibBoard::Line::_y1, LibBoard::Line::_y2, LibBoard::Point::get(), and LibBoard::Point::rotate().
Arrow LibBoard::Arrow::scaled | ( | double | s | ) | const |
Arrow LibBoard::Arrow::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 769 of file Shapes.cpp.
References LibBoard::Line::center(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by scaled().
Arrow LibBoard::Arrow::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 758 of file Shapes.cpp.
|
staticprivate |