Seamly2D
Code documentation
VCubicBezier Class Reference

#include <vcubicbezier.h>

Inheritance diagram for VCubicBezier:
Collaboration diagram for VCubicBezier:

Public Member Functions

 VCubicBezier ()
 
 VCubicBezier (const VCubicBezier &curve)
 
 VCubicBezier (const VPointF &p1, const VPointF &p2, const VPointF &p3, const VPointF &p4, quint32 idObject=0, Draw mode=Draw::Calculation)
 
VCubicBezier Rotate (const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
 
VCubicBezier Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VCubicBezier Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
virtual ~VCubicBezier ()
 
VCubicBezieroperator= (const VCubicBezier &curve)
 
void Swap (VCubicBezier &curve) Q_DECL_NOTHROW
 
virtual VPointF GetP1 () const Q_DECL_OVERRIDE
 
void SetP1 (const VPointF &p)
 
virtual VPointF GetP2 () const Q_DECL_OVERRIDE
 
void SetP2 (const VPointF &p)
 
virtual VPointF GetP3 () const Q_DECL_OVERRIDE
 
void SetP3 (const VPointF &p)
 
virtual VPointF GetP4 () const Q_DECL_OVERRIDE
 
void SetP4 (const VPointF &p)
 
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE
 
virtual qreal GetEndAngle () const Q_DECL_OVERRIDE
 
virtual qreal GetLength () const Q_DECL_OVERRIDE
 GetLength return length of cubic bezier curve. More...
 
virtual QVector< QPointF > getPoints () const Q_DECL_OVERRIDE
 GetPoints return list with cubic bezier curve points. More...
 
virtual qreal GetC1Length () const Q_DECL_OVERRIDE
 
virtual qreal GetC2Length () const Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractCubicBezier
 VAbstractCubicBezier (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractCubicBezier (const VAbstractCubicBezier &curve)
 
VAbstractCubicBezieroperator= (const VAbstractCubicBezier &curve)
 
virtual ~VAbstractCubicBezier ()
 
QPointF CutSpline (qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
 CutSpline cut spline. More...
 
virtual QString NameForHistory (const QString &toolName) const Q_DECL_OVERRIDE
 
qreal GetParmT (qreal length) const
 
qreal LengthT (qreal t) const
 
- Public Member Functions inherited from VAbstractBezier
 VAbstractBezier (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractBezier (const VAbstractBezier &curve)
 
VAbstractBezieroperator= (const VAbstractBezier &curve)
 
virtual ~VAbstractBezier ()
 
- Public Member Functions inherited from VAbstractCurve
 VAbstractCurve (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractCurve (const VAbstractCurve &curve)
 
virtual ~VAbstractCurve () Q_DECL_OVERRIDE
 
VAbstractCurveoperator= (const VAbstractCurve &curve)
 
void Swap (VAbstractCurve &curve) Q_DECL_NOTHROW
 
QVector< QPointF > GetSegmentPoints (const QPointF &begin, const QPointF &end, bool reverse=false) const
 
virtual QPainterPath GetPath () const
 
qreal GetLengthByPoint (const QPointF &point) const
 
virtual QVector< QPointF > IntersectLine (const QLineF &line) const
 IntersectLine return list of points for real intersection with line. More...
 
virtual bool IsIntersectLine (const QLineF &line) const
 
bool isPointOnCurve (const QPointF &p) const
 
quint32 GetDuplicate () const
 
void SetDuplicate (quint32 number)
 
QString getLineColor () const
 
void setLineColor (const QString &color)
 
QString GetPenStyle () const
 
void SetPenStyle (const QString &penStyle)
 
QString getLineWeight () const
 getLineWeight return weight of the lines More...
 
void setLineWeight (const QString &lineWeight)
 setLineWeight set weight of the lines More...
 
QPointF getFirstPoint ()
 
QPointF getLastPoint ()
 
virtual QVector< DirectionArrowDirectionArrows () const
 
- Public Member Functions inherited from VGObject
 VGObject ()
 VGObject default constructor. More...
 
 VGObject (const GOType &type, const quint32 &idObject=0, const Draw &mode=Draw::Calculation)
 VGObject constructor. More...
 
 VGObject (const VGObject &obj)
 VGObject copy constructor. More...
 
virtual ~VGObject ()
 
VGObjectoperator= (const VGObject &obj)
 operator = assignment operator. More...
 
void Swap (VGObject &obj) Q_DECL_NOTHROW
 
quint32 getIdObject () const
 getIdObject return parent id. More...
 
void setIdObject (const quint32 &value)
 setIdObject set parent id. More...
 
virtual QString name () const
 name return name graphical object. More...
 
void setName (const QString &name)
 setName set name graphical object. More...
 
Draw getMode () const
 getMode return mode creation. More...
 
void setMode (const Draw &value)
 setMode set mode creation. More...
 
GOType getType () const
 getType return object type. More...
 
void setType (const GOType &type)
 
quint32 id () const
 id return id object. More...
 
virtual void setId (const quint32 &id)
 setId set id object. More...
 
quint32 getIdTool () const
 

Protected Member Functions

virtual QPointF GetControlPoint1 () const Q_DECL_OVERRIDE
 
virtual QPointF GetControlPoint2 () const Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from VAbstractCubicBezier
virtual void CreateName () Q_DECL_OVERRIDE
 

Private Attributes

QSharedDataPointer< VCubicBezierDatad
 

Additional Inherited Members

- Static Public Member Functions inherited from VAbstractCurve
static QVector< QPointF > GetSegmentPoints (const QVector< QPointF > &points, const QPointF &begin, const QPointF &end, bool reverse=false)
 
static bool isPointOnCurve (const QVector< QPointF > &points, const QPointF &p)
 
static qreal PathLength (const QVector< QPointF > &path)
 
static QVector< QPointF > CurveIntersectLine (const QVector< QPointF > &points, const QLineF &line)
 
static QPainterPath ShowDirection (const QVector< DirectionArrow > &arrows, qreal width)
 
- Static Public Member Functions inherited from VGObject
static QLineF BuildLine (const QPointF &p1, const qreal &length, const qreal &angle)
 
static QPointF BuildRay (const QPointF &firstPoint, const qreal &angle, const QRectF &scRect)
 
static QLineF BuildAxis (const QPointF &p, const qreal &angle, const QRectF &scRect)
 
static QLineF BuildAxis (const QPointF &p1, const QPointF &p2, const QRectF &scRect)
 
static int ContactPoints (const QPointF &p, const QPointF &center, qreal radius, QPointF &p1, QPointF &p2)
 
static QPointF LineIntersectRect (const QRectF &rec, const QLineF &line)
 LineIntersectRect find point intersection line and rect. More...
 
static int IntersectionCircles (const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2)
 
static qint32 LineIntersectCircle (const QPointF &center, qreal radius, const QLineF &line, QPointF &p1, QPointF &p2)
 LineIntersectCircle find point intersection line and circle. More...
 
static QPointF ClosestPoint (const QLineF &line, const QPointF &point)
 ClosestPoint find point projection of point onto line. More...
 
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k)
 
static void LineCoefficients (const QLineF &line, qreal *a, qreal *b, qreal *c)
 LineCoefficients coefficient for equation of segment. Segment equestion ax+by+c=0. More...
 
static bool IsPointOnLineSegment (const QPointF &t, const QPointF &p1, const QPointF &p2)
 IsPointOnLineSegment Check if the point is on the line segment. More...
 
static bool IsPointOnLineviaPDP (const QPointF &t, const QPointF &p1, const QPointF &p2)
 IsPointOnLineviaPDP use the perp dot product (PDP) way. More...
 
template<typename T >
static QVector< T > GetReversePoints (const QVector< T > &points)
 GetReversePoint return revers container of points. More...
 
static int GetLengthContour (const QVector< QPointF > &contour, const QVector< QPointF > &newPoints)
 GetLengthContour return length of contour. More...
 
- Static Public Attributes inherited from VAbstractCurve
static const qreal lengthCurveDirectionArrow = 14
 
- Static Public Attributes inherited from VGObject
static const double accuracyPointOnLine = (0.1555 / 25.4) * 96.0
 
- Static Protected Member Functions inherited from VAbstractCubicBezier
static qreal CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2)
 CalcSqDistance calculate squared distance. More...
 
static void PointBezier_r (qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4, qint16 level, QVector< qreal > &px, QVector< qreal > &py)
 PointBezier_r find spline point using four point of spline. More...
 
static QVector< QPointF > GetCubicBezierPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
 GetCubicBezierPoints return list with cubic bezier curve points. More...
 
static qreal LengthBezier (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
 LengthBezier return spline length using 4 spline point. More...
 
- Static Protected Member Functions inherited from VGObject
static QTransform flipTransform (const QLineF &axis)
 

Detailed Description

Definition at line 69 of file vcubicbezier.h.

Constructor & Destructor Documentation

◆ VCubicBezier() [1/3]

VCubicBezier::VCubicBezier ( )

Definition at line 67 of file vcubicbezier.cpp.

References CubicBezier.

◆ VCubicBezier() [2/3]

VCubicBezier::VCubicBezier ( const VCubicBezier curve)

Definition at line 73 of file vcubicbezier.cpp.

◆ VCubicBezier() [3/3]

VCubicBezier::VCubicBezier ( const VPointF p1,
const VPointF p2,
const VPointF p3,
const VPointF p4,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

Definition at line 79 of file vcubicbezier.cpp.

References VAbstractCubicBezier::CreateName(), and CubicBezier.

◆ ~VCubicBezier()

VCubicBezier::~VCubicBezier ( )
virtual

Definition at line 144 of file vcubicbezier.cpp.

Member Function Documentation

◆ Flip()

◆ GetC1Length()

qreal VCubicBezier::GetC1Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 231 of file vcubicbezier.cpp.

References GetP1(), and GetP2().

◆ GetC2Length()

qreal VCubicBezier::GetC2Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 237 of file vcubicbezier.cpp.

References GetP3(), and GetP4().

◆ GetControlPoint1()

QPointF VCubicBezier::GetControlPoint1 ( ) const
protectedvirtual

Implements VAbstractCubicBezier.

Definition at line 243 of file vcubicbezier.cpp.

References GetP2().

◆ GetControlPoint2()

QPointF VCubicBezier::GetControlPoint2 ( ) const
protectedvirtual

Implements VAbstractCubicBezier.

Definition at line 249 of file vcubicbezier.cpp.

References GetP3().

◆ GetEndAngle()

qreal VCubicBezier::GetEndAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 203 of file vcubicbezier.cpp.

References GetP3(), and GetP4().

◆ GetLength()

qreal VCubicBezier::GetLength ( ) const
virtual

GetLength return length of cubic bezier curve.

Returns
length.

Implements VAbstractCurve.

Definition at line 213 of file vcubicbezier.cpp.

References GetP1(), GetP2(), GetP3(), GetP4(), and VAbstractCubicBezier::LengthBezier().

◆ GetP1()

◆ GetP2()

◆ GetP3()

◆ GetP4()

◆ getPoints()

QVector< QPointF > VCubicBezier::getPoints ( ) const
virtual

GetPoints return list with cubic bezier curve points.

Returns
list of points.

Implements VAbstractCurve.

Definition at line 224 of file vcubicbezier.cpp.

References VAbstractCubicBezier::GetCubicBezierPoints(), GetP1(), GetP2(), GetP3(), and GetP4().

◆ GetStartAngle()

qreal VCubicBezier::GetStartAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 197 of file vcubicbezier.cpp.

References GetP1(), and GetP2().

◆ Move()

◆ operator=()

VCubicBezier & VCubicBezier::operator= ( const VCubicBezier curve)

Definition at line 87 of file vcubicbezier.cpp.

References d, and VAbstractCubicBezier::operator=().

◆ Rotate()

◆ SetP1()

void VCubicBezier::SetP1 ( const VPointF p)

Definition at line 155 of file vcubicbezier.cpp.

References d.

◆ SetP2()

void VCubicBezier::SetP2 ( const VPointF p)

Definition at line 167 of file vcubicbezier.cpp.

References d.

◆ SetP3()

void VCubicBezier::SetP3 ( const VPointF p)

Definition at line 179 of file vcubicbezier.cpp.

References d.

◆ SetP4()

void VCubicBezier::SetP4 ( const VPointF p)

Definition at line 191 of file vcubicbezier.cpp.

References d.

◆ Swap()

void VCubicBezier::Swap ( VCubicBezier curve)

Definition at line 63 of file vcubicbezier.cpp.

References VAbstractCurve::Swap().

Member Data Documentation

◆ d

QSharedDataPointer<VCubicBezierData> VCubicBezier::d
private

Definition at line 113 of file vcubicbezier.h.

Referenced by GetP1(), GetP2(), GetP3(), GetP4(), operator=(), SetP1(), SetP2(), SetP3(), and SetP4().


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