Board
0.9.5
|
A line between two points. More...
#include <Line.h>
Public Member Functions | |
Line (double x1, double y1, double x2, double y2, Color color, double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Line (double x1, double y1, double x2, double y2, const Style &style) | |
Line (Point a, Point b, Color color, double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Line (Point a, Point b, const Style &style) | |
const std::string & | name () const override |
Line & | rotate (double angle, const Point ¢er) override |
Line | rotated (double angle, const Point ¢er) const |
Line & | rotate (double angle) override |
Line | rotated (double angle) const |
Line & | translate (double dx, double dy) override |
Line | translated (double dx, double dy) const |
Line & | scale (double sx, double sy) override |
Line & | scale (double s) override |
Line | scaled (double sx, double sy) const |
Line | scaled (double s) const |
void | scaleAll (double s) override |
Line | resized (double w, double h, LineWidthFlag lineWidthFlag) const |
Rect | boundingBox (LineWidthFlag) const override |
Line * | clone () const override |
void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const override |
void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override |
void | flushSVG (std::ostream &stream, const TransformSVG &transform) const override |
void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const override |
virtual void | accept (ShapeVisitor &visitor) override |
Accepts a visitor object. More... | |
virtual void | accept (const ShapeVisitor &visitor) override |
Accepts a visitor object. More... | |
virtual void | accept (ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. More... | |
virtual void | accept (const ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. More... | |
virtual Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. More... | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. More... | |
const Point & | a () const |
const Point & | b () const |
Line (const Line &other) | |
Line (Line &&)=default | |
Line & | operator= (const Line &line) |
![]() | |
ShapeWithStyle (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join) | |
ShapeWithStyle (const Style &style) | |
ShapeWithStyle (const ShapeWithStyle &other) | |
ShapeWithStyle & | operator= (const ShapeWithStyle &other) |
~ShapeWithStyle () | |
const std::string & | name () const |
const Color & | penColor () const |
ShapeWithStyle & | setPenColor (const Color &) |
const Color & | fillColor () const |
ShapeWithStyle & | setFillColor (const Color &) |
double | lineWidth () const |
ShapeWithStyle & | setLineWidth (double) |
LineStyle | lineStyle () const |
ShapeWithStyle & | setLineStyle (LineStyle) |
LineCap | lineCap () const |
ShapeWithStyle & | setLineCap (LineCap) |
LineJoin | lineJoin () const |
ShapeWithStyle & | setLineJoin (LineJoin) |
Style | style () const |
ShapeWithStyle & | setStyle (const Style &) |
bool | filled () const |
![]() | |
Shape () | |
virtual | ~Shape () |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
Shape & | rotateDeg (double angle, const Point ¢er) |
Shape & | rotateDeg (double angle) |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
Rect | bbox (LineWidthFlag) const |
Shape (const Shape &other) | |
Protected Attributes | |
Point | _a |
Point | _b |
![]() | |
Style | _style |
Additional Inherited Members | |
![]() | |
static void | setLineWidthScaling (bool) |
![]() | |
void | updateLineWidth (double s) |
A line between two points.
The line structure.
|
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. |
lineStyle | The line style. |
cap | The line cap. |
join | The line join. |
|
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. |
style | The shape style. |
|
inline |
Constructs a line.
a | First extremity. |
b | Second extremity. |
color | The color of the line. |
lineWidth | The line thickness. |
lineStyle | The line style. |
cap | The line cap. |
join | The line join. |
Constructs a line.
a | First extremity. |
b | Second extremity. |
style | The shape style. |
|
inline |
The first extremity of the line.
References _a.
Referenced by LibBoard::Arrow::flushFIG(), flushFIG(), flushPostscript(), flushSVG(), LibBoard::Arrow::flushTikZ(), and flushTikZ().
|
overridevirtual |
Accept a composite shape transform.
transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
overridevirtual |
Accept a constant composite shape transform.
transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
Reimplemented in LibBoard::Arrow.
|
inline |
The second extremity of the line.
References _b.
Referenced by LibBoard::Arrow::flushFIG(), flushFIG(), flushPostscript(), flushSVG(), LibBoard::Arrow::flushTikZ(), and flushTikZ().
|
overridevirtual |
Returns the bounding box of the line.
Implements LibBoard::Shape.
|
overridevirtual |
Return a copy of the shape.
Implements LibBoard::ShapeWithStyle.
References Line().
|
overridevirtual |
Write 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 |
Implements LibBoard::Shape.
References _a, _b, a(), b(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Write 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.
References _a, _b, a(), b(), LibBoard::Style::postscriptProperties(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Write 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.
References _a, _b, a(), b(), LibBoard::Style::svgProperties(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Write 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.
References _a, _b, a(), b(), LibBoard::Style::tikzProperties(), LibBoard::Point::x, and LibBoard::Point::y.
|
overridevirtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
Line LibBoard::Line::resized | ( | double | w, |
double | h, | ||
LineWidthFlag | lineWidthFlag | ||
) | const |
Returns a resized copy of the line.
w | Width of the new line. |
h | Height of the new line. |
lineWidthFlag | Should the line width be considered when computing bounding boxes. |
References Line().
|
overridevirtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), and rotate().
Rotate the shape around a given center of rotation.
angle | The rotation angle in radian. |
center | The center of rotation. |
Implements LibBoard::Shape.
References _a, _b, LibBoard::Shape::center(), and LibBoard::Point::rotated().
Referenced by rotate().
Line LibBoard::Line::rotated | ( | double | angle | ) | const |
Returns a copy of the line, rotated around its center.
angle | The angle of rotation. |
References _a, _b, LibBoard::Shape::center(), and LibBoard::Point::rotated().
Returns a copy of the line, rotated around a given rotation center.
angle | The rotation angle. |
center | The center of rotation. |
References _a, _b, LibBoard::Shape::center(), and LibBoard::Point::rotated().
|
overridevirtual |
Scale the line, given a scaling factor.
s | Scaling factor. |
Implements LibBoard::Shape.
References scale().
|
overridevirtual |
Scale the line, given two scaling factors.
sx | Scaling factor along the x axis. |
sy | Scaling factor along the y axis. |
Implements LibBoard::Shape.
References _a, _b, LibBoard::Shape::center(), translate(), LibBoard::Point::x, and LibBoard::Point::y.
Referenced by scale().
|
overridevirtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
References _a, _b, LibBoard::Point::x, and LibBoard::Point::y.
Line LibBoard::Line::scaled | ( | double | s | ) | const |
Returns a scaled copy of the line.
s | The scaling factor. |
References scaled().
Line LibBoard::Line::scaled | ( | double | sx, |
double | sy | ||
) | const |
|
overridevirtual |
Translate the line by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
References _a, _b, and LibBoard::Point::translate().
Referenced by scale().
Line LibBoard::Line::translated | ( | double | dx, |
double | dy | ||
) | const |
Returns a translated copy of the line.
dx | The shift along the x axis. |
dy | The shift along the y axis. |
References _a, _b, and LibBoard::Point::translate().
|
protected |
Start point.
Referenced by a(), LibBoard::Arrow::boundingBox(), boundingBox(), LibBoard::Arrow::flushFIG(), flushFIG(), LibBoard::Arrow::flushPostscript(), flushPostscript(), flushSVG(), LibBoard::Arrow::flushTikZ(), flushTikZ(), rotate(), rotated(), scale(), scaleAll(), translate(), and translated().
|
protected |
End point.
Referenced by b(), boundingBox(), LibBoard::Arrow::flushFIG(), flushFIG(), flushPostscript(), flushSVG(), LibBoard::Arrow::flushTikZ(), flushTikZ(), rotate(), rotated(), scale(), scaleAll(), translate(), and translated().