Board 0.9.6
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
LibBoard::Bezier Struct Reference

A Bezier curve described by two series of 2D points (curve points and control points). More...

#include <Bezier.h>

Inheritance diagram for LibBoard::Bezier:
LibBoard::ShapeWithStyle LibBoard::Shape

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 Bezier curve described by two series of 2D points (curve points and control points).
 
 Bezier (const std::vector< Point > &points, const std::vector< Point > &controls, const Style &style)
 A cubic bezier curve.
 
 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())
 A bezier curve defined by its two extremities and two control points.
 
 Bezier (Point p0, Point control0, Point p1, Point control1, const Style &style)
 A bezier curve defined by its two extremities and two control points.
 
 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())
 A bezier curve defined by its two extremities and two control points.
 
 Bezier (double x0, double y0, double xc0, double yc0, double x1, double y1, double xc1, double yc1, const Style &style)
 A bezier curve defined by its two extremities and two control points.
 
const std::string & name () const override
 
Bezierrotate (double angle, const Point &center) override
 Rotate the Bezier curve.
 
Bezier rotated (double angle, const Point &center) const
 Rotated copy of the curve.
 
Bezierrotate (double angle) override
 Rotate the Bezier curve around its bounding box center.
 
Bezier rotated (double angle) const
 Return a rotated copy of the curve around its bounding box center.
 
Beziertranslate (double dx, double dy) override
 
Bezier translated (double dx, double dy) const
 
Bezierscale (double sx, double sy) override
 
Bezierscale (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.
 
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 Shapeaccept (CompositeShapeTransform &transform) const override
 Accept a composite shape transform.
 
virtual Shapeaccept (const CompositeShapeTransform &transform) const override
 Accept a constant composite shape transform.
 
Rect boundingBox (LineWidthFlag) const override
 Return the bounding box of the curve.
 
Bezierclone () const override
 Return a copy of the curve.
 
const Pathpath () const
 The series of points defining the curve, as a path.
 
const Pathcontrols () const
 The series of control points points defining the curve, as a path.
 
Path discretizedPath () const
 A sequence of properly spaced points approximating the curve.
 
std::vector< PointpathThroughLocalExtremums () const
 A path through local extremums.
 
Bezieroperator+= (const Bezier &other)
 Add points and crontrol points of another curve.
 
Bezier operator+ (const Bezier &other) const
 Concatenate two Bezier curves.
 
Point eval (Path::size_type interval, double t) const
 Get a point of the curve given its interval between two curve points and a position in [0..1].
 
 Bezier (const Bezier &)=default
 
 Bezier (Bezier &&)=default
 
Bezieroperator= (Bezier &&)=default
 
Bezieroperator= (const Bezier &)=default
 
 ~Bezier () 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)
 
ShapeWithStyleoperator= (const ShapeWithStyle &other)
 
 ~ShapeWithStyle ()
 
const std::string & name () const
 
Shapeclone () const =0
 
const ColorpenColor () const
 
ShapeWithStylesetPenColor (const Color &)
 
const ColorfillColor () const
 
ShapeWithStylesetFillColor (const Color &)
 
double lineWidth () const
 
ShapeWithStylesetLineWidth (double)
 
LineStyle lineStyle () const
 
ShapeWithStylesetLineStyle (LineStyle)
 
LineCap lineCap () const
 
ShapeWithStylesetLineCap (LineCap)
 
LineJoin lineJoin () const
 
ShapeWithStylesetLineJoin (LineJoin)
 
Style style () const
 
ShapeWithStylesetStyle (const Style &)
 
bool filled () const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape ()
 
virtual ~Shape ()
 
virtual const std::string & name () const
 
virtual Shapeclone () const =0
 
virtual Point center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
 
virtual Shaperotate (double angle, const Point &center)=0
 
virtual Shaperotate (double angle)=0
 
ShaperotateDeg (double angle, const Point &center)
 
ShaperotateDeg (double angle)
 
virtual Shapetranslate (double dx, double dy)=0
 
ShapemoveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
ShapemoveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
virtual Shapescale (double sx, double sy)=0
 
virtual Shapescale (double s)=0
 
Shaperesize (double width, double height, LineWidthFlag lineWidthFlag)
 
ShapescaleToWidth (double w, LineWidthFlag lineWidthFlag)
 
ShapescaleToHeight (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 Shapeaccept (CompositeShapeTransform &transform) const
 Accept a composite shape transform.
 
virtual Shapeaccept (const CompositeShapeTransform &transform) const
 Accept a constant composite shape transform.
 
 Shape (const Shape &other)
 

Static Public Member Functions

static Bezier smoothedPolyline (const std::vector< Point > &path, double roundness, const Style &style=Style::defaultStyle())
 Build a Bezier curve as a 'rounded' version of a Polyline.
 
static Bezier smoothedPolyline (const Path &path, double roundness, const Style &style=Style::defaultStyle())
 Build a Bezier curve as a 'rounded' version of a Polyline.
 
static Bezier interpolation (const Point &a, const Point &b, const Point &c, const Point &d, const Style &style=Style::defaultStyle())
 Bezier interpolation passing through 4 points.
 
- Static Public Member Functions inherited from LibBoard::ShapeWithStyle
static void setLineWidthScaling (bool)
 

Protected Attributes

Path _path
 
Path _controls
 
- Protected Attributes inherited from LibBoard::ShapeWithStyle
Style _style
 

Additional Inherited Members

- Protected Member Functions inherited from LibBoard::ShapeWithStyle
void updateLineWidth (double s)
 

Detailed Description

A Bezier curve described by two series of 2D points (curve points and control points).

The Bezier structure.

Examples
examples/bezier.cpp, and examples/rough.cpp.

Constructor & Destructor Documentation

◆ Bezier() [1/8]

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 Bezier curve described by two series of 2D points (curve points and control points).

Parameters
pointsPoints of the bezier curve (n points)
controlsControls points (2(n-1) points)
penColor
fillColor
lineWidth
lineStyle
cap
join

◆ Bezier() [2/8]

LibBoard::Bezier::Bezier ( const std::vector< Point > &  points,
const std::vector< Point > &  controls,
const Style style 
)

A cubic bezier curve.

Parameters
pointsPoints of the bezier curve (n points)
controlsControls points (2(n-1) points)
styleShape style.

◆ Bezier() [3/8]

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() 
)

A bezier curve defined by its two extremities and two control points.

Parameters
p0Start point
control0Start control point
p1End point
control1End control point
penColor
fillColor
lineWidth
lineStyle
cap
join

References _controls, and _path.

◆ Bezier() [4/8]

LibBoard::Bezier::Bezier ( Point  p0,
Point  control0,
Point  p1,
Point  control1,
const Style style 
)

A bezier curve defined by its two extremities and two control points.

Parameters
p0Start point
control0Start control point
p1End point
control1End control point
styleShape style.

References _controls, and _path.

◆ Bezier() [5/8]

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() 
)

A bezier curve defined by its two extremities and two control points.

Parameters
x0Start point (x coordinate)
y0Start point (y coordinate)
xc0Start control point (x coordinate)
yc0Start control point (y coordinate)
x1End point (x coordinate)
y1End point (y coordinate)
xc1End control point (x coordinate)
yc1End control point (y coordinate)
penColor
fillColor
lineWidth
lineStyle
cap
join

References _controls, and _path.

◆ Bezier() [6/8]

LibBoard::Bezier::Bezier ( double  x0,
double  y0,
double  xc0,
double  yc0,
double  x1,
double  y1,
double  xc1,
double  yc1,
const Style style 
)

A bezier curve defined by its two extremities and two control points.

Parameters
x0Start point (x coordinate)
y0Start point (y coordinate)
xc0Start control point (x coordinate)
yc0Start control point (y coordinate)
x1End point (x coordinate)
y1End point (y coordinate)
xc1End control point (x coordinate)
yc1End control point (y coordinate)
styleShape style.

References _controls, and _path.

◆ Bezier() [7/8]

LibBoard::Bezier::Bezier ( const Bezier )
default

◆ Bezier() [8/8]

LibBoard::Bezier::Bezier ( Bezier &&  )
default

◆ ~Bezier()

LibBoard::Bezier::~Bezier ( )
overridedefault

Member Function Documentation

◆ accept() [1/6]

Shape * LibBoard::Bezier::accept ( CompositeShapeTransform transform) const
overridevirtual

Accept a composite shape transform.

Parameters
transformA composite shape transform object.

Reimplemented from LibBoard::Shape.

References LibBoard::CompositeShapeTransform::map().

◆ accept() [2/6]

Shape * LibBoard::Bezier::accept ( const CompositeShapeTransform transform) const
overridevirtual

Accept a constant composite shape transform.

Parameters
transformA constant composite shape transform object..

Reimplemented from LibBoard::Shape.

References LibBoard::CompositeShapeTransform::map().

◆ accept() [3/6]

void LibBoard::Bezier::accept ( const ConstShapeVisitor visitor) const
overridevirtual

Accepts a const-shape visitor object.

Parameters
visitorA const-shape visitor object.

Reimplemented from LibBoard::Shape.

References LibBoard::ConstShapeVisitor::visit().

◆ accept() [4/6]

void LibBoard::Bezier::accept ( const ShapeVisitor visitor)
overridevirtual

Accepts a visitor object.

Parameters
visitorA visitor object.

Reimplemented from LibBoard::Shape.

References LibBoard::ShapeVisitor::visit().

◆ accept() [5/6]

void LibBoard::Bezier::accept ( ConstShapeVisitor visitor) const
overridevirtual

Accepts a const-shape visitor object.

Parameters
visitorA const-shape visitor object.

Reimplemented from LibBoard::Shape.

References LibBoard::ConstShapeVisitor::visit().

◆ accept() [6/6]

void LibBoard::Bezier::accept ( ShapeVisitor visitor)
overridevirtual

Accepts a visitor object.

Parameters
visitorA visitor object.

Reimplemented from LibBoard::Shape.

References LibBoard::ShapeVisitor::visit().

◆ boundingBox()

Rect LibBoard::Bezier::boundingBox ( LineWidthFlag  lineWidthFlag) const
overridevirtual

◆ clone()

Bezier * LibBoard::Bezier::clone ( ) const
overridevirtual

Return a copy of the curve.

Returns
a copy of the curve.

Implements LibBoard::ShapeWithStyle.

Referenced by LibBoard::RoughVisitor::map(), LibBoard::RoughVisitor::map(), and LibBoard::RoughVisitor::map().

◆ controls()

const Path & LibBoard::Bezier::controls ( ) const
inline

The series of control points points defining the curve, as a path.

Returns
The series of control points points defining the curve, as a path.

References _controls.

Referenced by LibBoard::bezierControls(), interpolation(), LibBoard::RoughVisitor::map(), operator+=(), scale(), smoothedPolyline(), and smoothedPolyline().

◆ discretizedPath()

Path LibBoard::Bezier::discretizedPath ( ) const

A sequence of properly spaced points approximating the curve.

Returns
A path of properly spaced points approximating the curve.
Examples
examples/bezier.cpp.

References _controls, _path, path(), and LibBoard::Path::points().

Referenced by main().

◆ eval()

Point LibBoard::Bezier::eval ( Path::size_type  interval,
double  t 
) const

Get a point of the curve given its interval between two curve points and a position in [0..1].

Parameters
intervalPosition of the preceding curve point.
tTime position within the interval, in [0..1].
Returns

References _controls, _path, and LibBoard::Path::size().

Referenced by pathThroughLocalExtremums().

◆ flushFIG()

void LibBoard::Bezier::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const
overridevirtual

Write the FIG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.
colormap

Implements LibBoard::Shape.

References LibBoard::Tools::unused(), and LibBoard::Tools::warning.

◆ flushPostscript()

void LibBoard::Bezier::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
overridevirtual

◆ flushSVG()

void LibBoard::Bezier::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
overridevirtual

Write the SVG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References _controls, _path, LibBoard::ShapeWithStyle::_style, LibBoard::Path::empty(), LibBoard::Tools::error, LibBoard::Transform::mapX(), LibBoard::TransformSVG::mapY(), LibBoard::Path::points(), LibBoard::Path::size(), and LibBoard::Style::svgProperties().

◆ flushTikZ()

void LibBoard::Bezier::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
overridevirtual

Write the TikZ code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References LibBoard::Tools::unused(), and LibBoard::Tools::warning.

◆ interpolation()

Bezier LibBoard::Bezier::interpolation ( const Point a,
const Point b,
const Point c,
const Point d,
const Style style = Style::defaultStyle() 
)
static

Bezier interpolation passing through 4 points.

Parameters
a
b
c
d
style
Returns
A Bezier interpolation passing through the 4 points a, b, c, d

References controls(), and LibBoard::ShapeWithStyle::style().

Referenced by main(), LibBoard::RoughVisitor::map(), LibBoard::RoughVisitor::map(), and LibBoard::RoughVisitor::map().

◆ name()

const std::string & LibBoard::Bezier::name ( ) const
overridevirtual

The generic name of the shape (e.g., Circle, Rectangle, etc.)

Returns
The generic name of the shape

Reimplemented from LibBoard::Shape.

◆ operator+()

Bezier LibBoard::Bezier::operator+ ( const Bezier other) const

Concatenate two Bezier curves.

Parameters
otherA Bezier curve.
Returns
A new Bezier curve, concatenation of this curve with other.

◆ operator+=()

Bezier & LibBoard::Bezier::operator+= ( const Bezier other)

Add points and crontrol points of another curve.

Parameters
otherA Bezier curve.
Returns
This Bezier curve, appended.

References _controls, _path, LibBoard::Path::back(), controls(), LibBoard::Path::front(), LibBoard::Point::norm(), LibBoard::Point::normalised(), path(), LibBoard::Path::points(), and LibBoard::Path::push_back().

◆ operator=() [1/2]

Bezier & LibBoard::Bezier::operator= ( Bezier &&  )
default

◆ operator=() [2/2]

Bezier & LibBoard::Bezier::operator= ( const Bezier )
default

◆ path()

const Path & LibBoard::Bezier::path ( ) const
inline

The series of points defining the curve, as a path.

Returns
The series of points defining the curve, as a path.

References _path.

Referenced by LibBoard::bezierControls(), boundingBox(), discretizedPath(), LibBoard::RoughVisitor::map(), operator+=(), smoothedPolyline(), and smoothedPolyline().

◆ pathThroughLocalExtremums()

std::vector< Point > LibBoard::Bezier::pathThroughLocalExtremums ( ) const

A path through local extremums.

Returns
A path through local extremums.
Examples
examples/bezier.cpp.

References _controls, _path, LibBoard::Tools::almostEqual(), LibBoard::Path::back(), eval(), LibBoard::Path::points(), LibBoard::Tools::solveQuadratic(), LibBoard::Point::x, and LibBoard::Point::y.

Referenced by boundingBox(), and main().

◆ resized()

Bezier LibBoard::Bezier::resized ( double  w,
double  h,
LineWidthFlag  lineWidthFlag 
) const

Returns a resized copy of the Bezier.

Parameters
wWidth of the new Bezier.
hHeight of the new Bezier.
lineWidthFlagShould the line width be considered when computing bounding boxes.
Returns
A resized copy of the Bezier.

References LibBoard::Shape::resize().

◆ rotate() [1/2]

Bezier & LibBoard::Bezier::rotate ( double  angle)
overridevirtual

Rotate the Bezier curve around its bounding box center.

Parameters
angleThe rotation angle.
Returns
The curve itself.

Implements LibBoard::Shape.

References _controls, _path, LibBoard::Shape::center(), and LibBoard::Path::rotate().

◆ rotate() [2/2]

Bezier & LibBoard::Bezier::rotate ( double  angle,
const Point center 
)
overridevirtual

Rotate the Bezier curve.

Parameters
angleThe rotation angle.
centerCenter of the rotation.
Returns
The curve itself.

Implements LibBoard::Shape.

References _controls, _path, LibBoard::Shape::center(), and LibBoard::Path::rotate().

Referenced by rotated(), and rotated().

◆ rotated() [1/2]

Bezier LibBoard::Bezier::rotated ( double  angle) const

Return a rotated copy of the curve around its bounding box center.

Parameters
angleThe rotation angle.
Returns
A rotated copy of the curve.

References LibBoard::Shape::center(), and rotate().

◆ rotated() [2/2]

Bezier LibBoard::Bezier::rotated ( double  angle,
const Point center 
) const

Rotated copy of the curve.

Parameters
angleA rotation angle (in radians)
centerThe center of rotation
Returns
A rotated copy of the curve
Examples
examples/bezier.cpp, and examples/rough.cpp.

References LibBoard::Shape::center(), and rotate().

Referenced by main(), and slide().

◆ scale() [1/2]

Bezier & LibBoard::Bezier::scale ( double  s)
overridevirtual

Scale the Bezier, given a scaling factor.

Parameters
sScaling factor.
Returns
A reference to the Bezier itself, once scaled.

Implements LibBoard::Shape.

References scale().

◆ scale() [2/2]

Bezier & LibBoard::Bezier::scale ( double  sx,
double  sy 
)
overridevirtual

Scale the Bezier, given two scaling factors.

Parameters
sxScaling factor along the x axis.
syScaling factor along the y axis.
Returns
A reference to the Bezier itself, once scaled.

Implements LibBoard::Shape.

References _controls, _path, LibBoard::Path::begin(), LibBoard::Path::clear(), controls(), LibBoard::Path::Open, LibBoard::Path::points(), LibBoard::Path::scale(), and LibBoard::ShapeWithStyle::updateLineWidth().

Referenced by scale(), scaled(), and scaled().

◆ scaleAll()

void LibBoard::Bezier::scaleAll ( double  s)
overridevirtual

Scales all the values (positions, dimensions, etc.) associated with the shape.

Parameters
sThe scaling factor.

Implements LibBoard::Shape.

References _controls, _path, and LibBoard::Path::scaleAll().

◆ scaled() [1/2]

Bezier LibBoard::Bezier::scaled ( double  s) const

Returns a scaled copy of the line.

Parameters
sThe scaling factor.
Returns
A scaled copy of the line.

References scale().

◆ scaled() [2/2]

Bezier LibBoard::Bezier::scaled ( double  sx,
double  sy 
) const

Returns a scaled copy of the line.

Parameters
sxThe scaling factor along the x axis.
syThe scaling factor along the y axis.
Returns
A scaled copy of the line.
Examples
examples/bezier.cpp.

References scale().

Referenced by main().

◆ smoothedPolyline() [1/2]

Bezier LibBoard::Bezier::smoothedPolyline ( const Path path,
double  roundness,
const Style style = Style::defaultStyle() 
)
static

Build a Bezier curve as a 'rounded' version of a Polyline.

Parameters
pathA path defining a polyline.
roundness
style
Returns
A bezier curve

References controls(), LibBoard::Path::isClosed(), path(), LibBoard::Path::points(), LibBoard::Path::push_back(), LibBoard::Path::size(), smoothedPolyline(), and LibBoard::ShapeWithStyle::style().

◆ smoothedPolyline() [2/2]

Bezier LibBoard::Bezier::smoothedPolyline ( const std::vector< Point > &  path,
double  roundness,
const Style style = Style::defaultStyle() 
)
static

Build a Bezier curve as a 'rounded' version of a Polyline.

Parameters
pathA sequence of points defining a polyline.
roundness
style
Returns
A bezier curve

References LibBoard::Path::back(), controls(), LibBoard::mix(), path(), LibBoard::Path::push_back(), LibBoard::Path::size(), and LibBoard::ShapeWithStyle::style().

Referenced by main(), LibBoard::RoughVisitor::map(), mustache(), and smoothedPolyline().

◆ translate()

Bezier & LibBoard::Bezier::translate ( double  dx,
double  dy 
)
overridevirtual

Translate the Bezier by a given offset.

Parameters
dxShift of the first coordinate.
dyShift of the second coordinate.
Returns
A reference to the Bezier itself.

Implements LibBoard::Shape.

References _controls, _path, and LibBoard::Path::translate().

Referenced by translated().

◆ translated()

Bezier LibBoard::Bezier::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the Bezier.

Parameters
dxShift of the first coordinate.
dyShift of the second coordinate.
Returns
A copy of the Bezier, translated.

References translate().

Member Data Documentation

◆ _controls

Path LibBoard::Bezier::_controls
protected

◆ _path

Path LibBoard::Bezier::_path
protected

The documentation for this struct was generated from the following files: