Board 0.9.6
|
A line between two points. More...
#include <Dot.h>
Public Member Functions | |
Dot (double x, double y, Color color=Style::defaultPenColor(), double lineWidth=Style::defaultLineWidth()) | |
Dot (const Point &p, Color color=Style::defaultPenColor(), double lineWidth=Style::defaultLineWidth()) | |
const std::string & | name () const override |
Point | center (LineWidthFlag flage=IgnoreLineWidth) const override |
Dot & | rotate (double angle, const Point ¢er) override |
Dot | rotated (double angle, const Point ¢er) const |
Dot & | rotate (double angle) override |
Dot | rotated (double angle) const |
Dot & | translate (double dx, double dy) override |
Dot | translated (double dx, double dy) const |
Dot & | scale (double sx, double sy) override |
Dot & | scale (double s) override |
Dot | scaled (double sx, double sy) const |
Dot | scaled (double s) const |
void | scaleAll (double s) 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. | |
virtual void | accept (const ShapeVisitor &visitor) override |
Accepts a visitor object. | |
virtual void | accept (ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. | |
virtual void | accept (const ConstShapeVisitor &visitor) const override |
Accepts a const-shape visitor object. | |
virtual Shape * | accept (CompositeShapeTransform &transform) const override |
Accept a composite shape transform. | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const override |
Accept a constant composite shape transform. | |
Rect | boundingBox (LineWidthFlag) const override |
Dot * | clone () const override |
Dot (const Dot &)=default | |
Dot (Dot &&)=default | |
Dot & | operator= (Dot &&)=default |
Dot & | operator= (const Dot &)=default |
~Dot () override=default | |
Public Member Functions inherited from LibBoard::ShapeWithStyle | |
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 |
Shape * | clone () const =0 |
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 |
Public Member Functions inherited from LibBoard::Shape | |
Shape () | |
virtual | ~Shape () |
virtual const std::string & | name () const |
virtual Shape * | clone () const =0 |
virtual Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const |
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 |
Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
virtual Shape & | scale (double sx, double sy)=0 |
virtual Shape & | scale (double s)=0 |
Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
virtual Rect | boundingBox (LineWidthFlag) const =0 |
Rect | bbox (LineWidthFlag) const |
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< Color, int > &colormap) const =0 |
virtual void | flushSVG (std::ostream &stream, const TransformSVG &transform) const =0 |
virtual void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const =0 |
virtual void | accept (ShapeVisitor &visitor) |
Accepts a visitor object. | |
virtual void | accept (const ShapeVisitor &visitor) |
Accepts a visitor object. | |
virtual void | accept (ConstShapeVisitor &visitor) const |
Accepts a const-shape visitor object. | |
virtual void | accept (const ConstShapeVisitor &visitor) const |
Accepts a const-shape visitor object. | |
virtual Shape * | accept (CompositeShapeTransform &transform) const |
Accept a composite shape transform. | |
virtual Shape * | accept (const CompositeShapeTransform &transform) const |
Accept a constant composite shape transform. | |
Shape (const Shape &other) | |
Protected Attributes | |
double | _x |
double | _y |
Protected Attributes inherited from LibBoard::ShapeWithStyle | |
Style | _style |
Additional Inherited Members | |
Static Public Member Functions inherited from LibBoard::ShapeWithStyle | |
static void | setLineWidthScaling (bool) |
Protected Member Functions inherited from LibBoard::ShapeWithStyle | |
void | updateLineWidth (double s) |
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.
|
inline |
|
inline |
|
default |
|
default |
|
overridedefault |
|
overridevirtual |
Accept a composite shape transform.
transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
References LibBoard::CompositeShapeTransform::map().
|
overridevirtual |
Accept a constant composite shape transform.
transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
References LibBoard::CompositeShapeTransform::map().
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::ConstShapeVisitor::visit().
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeVisitor::visit().
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::ConstShapeVisitor::visit().
|
overridevirtual |
Accepts a visitor object.
visitor | A visitor object. |
Reimplemented from LibBoard::Shape.
References LibBoard::ShapeVisitor::visit().
|
overridevirtual |
Returns the bounding box of the dot.
Implements LibBoard::Shape.
References _x, _y, LibBoard::IgnoreLineWidth, LibBoard::ShapeWithStyle::lineWidth(), and LibBoard::UseLineWidth.
|
overridevirtual |
Returns the center of the shape.
lineWidthFlag | Should the line width be considered when computing bounding boxes. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
|
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 _x, _y, LibBoard::ShapeWithStyle::lineCap(), LibBoard::ShapeWithStyle::lineJoin(), LibBoard::ShapeWithStyle::lineWidth(), LibBoard::TransformFIG::mapWidth(), LibBoard::Transform::mapX(), LibBoard::TransformFIG::mapY(), LibBoard::ShapeWithStyle::penColor(), LibBoard::TransformFIG::shapeDepth(), and LibBoard::Color::valid().
|
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 LibBoard::ShapeWithStyle::_style, _x, _y, LibBoard::Transform::mapX(), LibBoard::TransformEPS::mapY(), LibBoard::ShapeWithStyle::penColor(), LibBoard::Color::postscript(), and LibBoard::Style::postscriptProperties().
|
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 LibBoard::ShapeWithStyle::_style, _x, _y, LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), and LibBoard::Style::svgProperties().
|
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.
|
overridevirtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Rotates the dot around its center (actually does nothing!).
angle | The rotation angle. |
Implements LibBoard::Shape.
Rotates the dot around a given center of rotation.
angle | The rotation angle. |
center | The center of rotation. |
Implements LibBoard::Shape.
References _x, _y, center(), LibBoard::Point::get(), and LibBoard::Point::rotate().
Referenced by rotated().
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. |
|
overridevirtual |
Scale the dot, given a scaling factor.
s | Scaling factor. |
Implements LibBoard::Shape.
|
overridevirtual |
Scale the dot, given two scaling factors.
sx | Scaling factor along the x axis. |
sy | Scaling factor along the y axis. |
Implements LibBoard::Shape.
|
overridevirtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
Dot LibBoard::Dot::scaled | ( | double | s | ) | const |
Dot LibBoard::Dot::scaled | ( | double | sx, |
double | sy | ||
) | const |
|
overridevirtual |
Translate the dot by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
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. |
References translate().
|
protected |
First coordinate of the dot.
Referenced by boundingBox(), center(), flushFIG(), flushPostscript(), flushSVG(), rotate(), scaleAll(), and translate().
|
protected |
Second coordinate of the dot.
Referenced by boundingBox(), center(), flushFIG(), flushPostscript(), flushSVG(), rotate(), scaleAll(), and translate().