Board
0.9.5
|
A cubice polygonal line described by a series of 2D points. More...
#include <Bezier.h>
Public Member Functions | |
Bezier (const std::vector< Point > &points, const std::vector< Point > &controls, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
A cubic bezier curve. More... | |
Bezier (const std::vector< Point > &points, const std::vector< Point > &controls, const Style &style) | |
A cubic bezier curve. More... | |
Bezier (Point p0, Point control0, Point p1, Point control1, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Bezier. More... | |
Bezier (Point p0, Point control0, Point p1, Point control1, const Style &style) | |
Bezier. More... | |
Bezier (double x0, double y0, double xc0, double yc0, double x1, double y1, double xc1, double yc1, Color penColor=Style::defaultPenColor(), Color fillColor=Style::defaultFillColor(), double lineWidth=Style::defaultLineWidth(), const LineStyle lineStyle=Style::defaultLineStyle(), const LineCap cap=Style::defaultLineCap(), const LineJoin join=Style::defaultLineJoin()) | |
Bezier. More... | |
Bezier (double x0, double y0, double xc0, double yc0, double x1, double y1, double xc1, double yc1, const Style &style) | |
Bezier. More... | |
const std::string & | name () const override |
Bezier & | rotate (double angle, const Point ¢er) override |
Rotate the Bezier curve. More... | |
Bezier | rotated (double angle, const Point ¢er) const |
Bezier & | rotate (double angle) override |
Bezier | rotated (double angle) const |
Bezier & | translate (double dx, double dy) override |
Bezier | translated (double dx, double dy) const |
Bezier & | scale (double sx, double sy) override |
Bezier & | scale (double s) override |
Bezier | scaled (double sx, double sy) const |
Bezier | scaled (double s) const |
void | scaleAll (double s) override |
Bezier | resized (double w, double h, LineWidthFlag lineWidthFlag) const |
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... | |
Rect | boundingBox (LineWidthFlag) const override |
Bezier * | clone () const override |
const Path & | path () const |
const Path & | controls () const |
Path | discretizedPath () const |
std::vector< Point > | pathThroughLocalExtremums () const |
Bezier & | operator+= (const Bezier &other) |
Bezier | operator+ (const Bezier &other) const |
Bezier (const Bezier &)=default | |
Bezier (Bezier &&)=default | |
Bezier & | operator= (Bezier &&)=default |
Bezier & | operator= (const Bezier &)=default |
Point | eval (const Point &p0, const Point &p1, const Point &p2, const Point &p3, double t) const |
Point | eval (Path::size_type interval, double t) const |
![]() | |
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) | |
Static Public Member Functions | |
static Bezier | smoothedPolyline (const std::vector< Point > &path, double roundness, const Style &style=Style::defaultStyle()) |
static Bezier | smoothedPolyline (const Path &path, double roundness, const Style &style=Style::defaultStyle()) |
static Bezier | interpolation (const Point &y0, const Point &y1, const Point &y2, const Point &y3, const Style &style=Style::defaultStyle()) |
![]() | |
static void | setLineWidthScaling (bool) |
Static Public Attributes | |
static const std::string | _name |
Protected Attributes | |
Path | _path |
Path | _controls |
![]() | |
Style | _style |
Additional Inherited Members | |
![]() | |
void | updateLineWidth (double s) |
A cubice polygonal line described by a series of 2D points.
The Bezier structure.
LibBoard::Bezier::Bezier | ( | const std::vector< Point > & | points, |
const std::vector< Point > & | controls, | ||
Color | penColor = Style::defaultPenColor() , |
||
Color | fillColor = Style::defaultFillColor() , |
||
double | lineWidth = Style::defaultLineWidth() , |
||
const LineStyle | lineStyle = Style::defaultLineStyle() , |
||
const LineCap | cap = Style::defaultLineCap() , |
||
const LineJoin | join = Style::defaultLineJoin() |
||
) |
A cubic bezier curve.
points | Points of the bezier curve (n points) |
controls | Controls points (2(n-1) points) |
penColor | |
fillColor | |
lineWidth | |
lineStyle | |
cap | |
join |
Referenced by clone(), resized(), rotated(), scaled(), and translated().
LibBoard::Bezier::Bezier | ( | const std::vector< Point > & | points, |
const std::vector< Point > & | controls, | ||
const Style & | style | ||
) |
A cubic bezier curve.
points | Points of the bezier curve (n points) |
controls | Controls points (2(n-1) points) |
style | Shape style. |
LibBoard::Bezier::Bezier | ( | Point | p0, |
Point | control0, | ||
Point | p1, | ||
Point | control1, | ||
Color | penColor = Style::defaultPenColor() , |
||
Color | fillColor = Style::defaultFillColor() , |
||
double | lineWidth = Style::defaultLineWidth() , |
||
const LineStyle | lineStyle = Style::defaultLineStyle() , |
||
const LineCap | cap = Style::defaultLineCap() , |
||
const LineJoin | join = Style::defaultLineJoin() |
||
) |
p0 | Start point |
control0 | Start control point |
p1 | End point |
control1 | End control point |
penColor | |
fillColor | |
lineWidth | |
lineStyle | |
cap | |
join |
LibBoard::Bezier::Bezier | ( | double | x0, |
double | y0, | ||
double | xc0, | ||
double | yc0, | ||
double | x1, | ||
double | y1, | ||
double | xc1, | ||
double | yc1, | ||
Color | penColor = Style::defaultPenColor() , |
||
Color | fillColor = Style::defaultFillColor() , |
||
double | lineWidth = Style::defaultLineWidth() , |
||
const LineStyle | lineStyle = Style::defaultLineStyle() , |
||
const LineCap | cap = Style::defaultLineCap() , |
||
const LineJoin | join = Style::defaultLineJoin() |
||
) |
x0 | Start point (x coordinate) |
y0 | Start point (y coordinate) |
xc0 | Start control point (x coordinate) |
yc0 | Start control point (y coordinate) |
x1 | End point (x coordinate) |
y1 | End point (y coordinate) |
xc1 | End control point (x coordinate) |
yc1 | End control point (y coordinate) |
penColor | |
fillColor | |
lineWidth | |
lineStyle | |
cap | |
join |
LibBoard::Bezier::Bezier | ( | double | x0, |
double | y0, | ||
double | xc0, | ||
double | yc0, | ||
double | x1, | ||
double | y1, | ||
double | xc1, | ||
double | yc1, | ||
const Style & | style | ||
) |
|
overridevirtual |
Accept a composite shape transform.
transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accept a constant composite shape transform.
transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
|
overridevirtual |
Accepts a const-shape visitor object.
visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
|
overridevirtual |
Compute the bounding box of the figure.
Implements LibBoard::Shape.
|
overridevirtual |
Return a copy of the shape.
Implements LibBoard::ShapeWithStyle.
References Bezier().
|
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.
|
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.
|
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.
|
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.
References _name.
Bezier LibBoard::Bezier::resized | ( | double | w, |
double | h, | ||
LineWidthFlag | lineWidthFlag | ||
) | const |
|
overridevirtual |
Rotate the shape around its center.
angle | The rotation angle in radian. |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), and LibBoard::Path::rotate().
Rotate the Bezier curve.
angle | |
center |
Implements LibBoard::Shape.
References LibBoard::Shape::center(), and LibBoard::Path::rotate().
Bezier LibBoard::Bezier::rotated | ( | double | angle | ) | const |
|
overridevirtual |
Scale the Bezier, given a scaling factor.
s | Scaling factor. |
Implements LibBoard::Shape.
References scale().
|
overridevirtual |
Scale the Bezier, given two scaling factors.
sx | Scaling factor along the x axis. |
sy | Scaling factor along the y axis. |
Implements LibBoard::Shape.
References LibBoard::Path::scale(), and scaled().
Referenced by scale().
|
overridevirtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
s | The scaling factor. |
Implements LibBoard::Shape.
References LibBoard::Path::scaleAll().
Bezier LibBoard::Bezier::scaled | ( | double | s | ) | const |
Returns a scaled copy of the line.
s | The scaling factor. |
References Bezier().
Bezier LibBoard::Bezier::scaled | ( | double | sx, |
double | sy | ||
) | const |
Returns a scaled copy of the line.
sx | The scaling factor along the x axis. |
sy | The scaling factor along the y axis. |
References Bezier().
Referenced by scale().
|
overridevirtual |
Translate the Bezier by a given offset.
dx | The x offset. |
dy | The y offset. |
Implements LibBoard::Shape.
References LibBoard::Path::translate().
Bezier LibBoard::Bezier::translated | ( | double | dx, |
double | dy | ||
) | const |
|
static |
The generic name of the shape.
Referenced by name().