#include <Shapes.h>
Public Member Functions | |
Line (double x1, double y1, double x2, double y2, Color color, float lineWidth, const LineCap cap=ButtCap, const LineJoin join=MiterJoin, int depth=-1) | |
Point | center () const |
Shape & | rotate (double angle, const Point ¢er) |
Shape & | rotate (double angle) |
Shape & | translate (double dx, double dy) |
Shape & | scale (double sx, double sy) |
void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const |
Rect | boundingBox () const |
Shape * | clone () const |
Protected Attributes | |
double | _x1 |
double | _y1 |
double | _x2 |
double | _y2 |
The line structure.
BoardLib::Line::Line | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2, | |||
Color | color, | |||
float | lineWidth, | |||
const LineCap | cap = ButtCap , |
|||
const LineJoin | join = MiterJoin , |
|||
int | depth = -1 | |||
) | [inline] |
Constructs a line.
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. | |
color | The color of the line. | |
lineWidth | The line thickness. | |
depth | The depth of the line. |
Point BoardLib::Line::center | ( | ) | const [virtual] |
Returns the gravity center of the shape.
Implements BoardLib::Shape.
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. | |
center | The center of rotation. |
Implements BoardLib::Shape.
Shape & BoardLib::Line::rotate | ( | double | angle | ) | [virtual] |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements BoardLib::Shape.
Shape & BoardLib::Line::translate | ( | double | dx, | |
double | dy | |||
) | [virtual] |
Translate the shape by a given offset.
dx | The x offset. | |
dy | The y offset. |
Implements BoardLib::Shape.
Shape & BoardLib::Line::scale | ( | double | sx, | |
double | sy | |||
) | [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 BoardLib::Shape.
void BoardLib::Line::flushPostscript | ( | std::ostream & | stream, | |
const TransformEPS & | transform | |||
) | const [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 BoardLib::Shape.
Reimplemented in BoardLib::Arrow.
void BoardLib::Line::flushFIG | ( | std::ostream & | stream, | |
const TransformFIG & | transform, | |||
std::map< Color, int > & | colormap | |||
) | const [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 BoardLib::Shape.
Reimplemented in BoardLib::Arrow.
void BoardLib::Line::flushSVG | ( | std::ostream & | stream, | |
const TransformSVG & | transform | |||
) | const [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 BoardLib::Shape.
Reimplemented in BoardLib::Arrow.
Rect BoardLib::Line::boundingBox | ( | ) | const [virtual] |
Returns the bounding box of the figure.
Implements BoardLib::Shape.
Shape* BoardLib::Line::clone | ( | ) | const [inline, virtual] |
double BoardLib::Line::_x1 [protected] |
First coordinate of the start point.
double BoardLib::Line::_y1 [protected] |
Second coordinate of the start point.
double BoardLib::Line::_x2 [protected] |
First coordinate of the end point.
double BoardLib::Line::_y2 [protected] |
Second coordinate of the end point.