Seamly2D
Code documentation
VCubicBezierPath Class Reference

#include <vcubicbezierpath.h>

Inheritance diagram for VCubicBezierPath:
Collaboration diagram for VCubicBezierPath:

Public Member Functions

 VCubicBezierPath (quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VCubicBezierPath (const VCubicBezierPath &curve)
 
 VCubicBezierPath (const QVector< VPointF > &points, quint32 idObject=0, Draw mode=Draw::Calculation)
 
VCubicBezierPath Rotate (const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
 
VCubicBezierPath Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VCubicBezierPath Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
virtual ~VCubicBezierPath ()
 
VCubicBezierPathoperator= (const VCubicBezierPath &curve)
 
void Swap (VCubicBezierPath &curve) Q_DECL_NOTHROW
 
VPointFoperator[] (int indx)
 
const VPointFat (int indx) const
 
void append (const VPointF &point)
 
virtual qint32 CountSubSpl () const Q_DECL_OVERRIDE
 
virtual qint32 CountPoints () const Q_DECL_OVERRIDE
 
virtual void Clear () Q_DECL_OVERRIDE
 
virtual VSpline GetSpline (qint32 index) const Q_DECL_OVERRIDE
 
virtual qreal GetStartAngle () const Q_DECL_OVERRIDE
 
virtual qreal GetEndAngle () const Q_DECL_OVERRIDE
 
virtual qreal GetC1Length () const Q_DECL_OVERRIDE
 
virtual qreal GetC2Length () const Q_DECL_OVERRIDE
 
virtual QVector< VSplinePointGetSplinePath () const Q_DECL_OVERRIDE
 
QVector< VPointFGetCubicPath () const
 
virtual VPointF FirstPoint () const Q_DECL_OVERRIDE
 
virtual VPointF LastPoint () const Q_DECL_OVERRIDE
 
- Public Member Functions inherited from VAbstractCubicBezierPath
 VAbstractCubicBezierPath (const GOType &type, const quint32 &idObject=null_id, const Draw &mode=Draw::Calculation)
 
 VAbstractCubicBezierPath (const VAbstractCubicBezierPath &curve)
 
VAbstractCubicBezierPathoperator= (const VAbstractCubicBezierPath &curve)
 
virtual ~VAbstractCubicBezierPath ()
 
virtual QPainterPath GetPath () const Q_DECL_OVERRIDE
 GetPath return QPainterPath which reprezent spline path. More...
 
virtual QVector< QPointF > getPoints () const Q_DECL_OVERRIDE
 GetPathPoints return list of points what located on path. More...
 
virtual qreal GetLength () const Q_DECL_OVERRIDE
 GetLength return length of spline path. More...
 
virtual QVector< DirectionArrowDirectionArrows () const Q_DECL_OVERRIDE
 
int Segment (const QPointF &p) const
 
QPointF CutSplinePath (qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3) const
 CutSplinePath cut spline path into two. This method don't return two spline path. You must create spline paths by yourself. Example: QPointF spl1p2, spl1p3, spl2p2, spl2p3; qint32 p1 = 0, p2 = 0; QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);. More...
 
virtual QString NameForHistory (const QString &toolName) const Q_DECL_OVERRIDE
 NameForHistory helps to create name for dialog History. More...
 
- 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
 
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 ()
 
- 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
 

Static Public Member Functions

static qint32 CountSubSpl (qint32 size)
 
static qint32 SubSplOffset (qint32 subSplIndex)
 
static qint32 SubSplPointsCount (qint32 countSubSpl)
 
- 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...
 

Private Attributes

QSharedDataPointer< VCubicBezierPathDatad
 

Additional Inherited Members

- 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
 
- Protected Member Functions inherited from VAbstractCubicBezierPath
virtual void CreateName () Q_DECL_OVERRIDE
 
- Static Protected Member Functions inherited from VGObject
static QTransform flipTransform (const QLineF &axis)
 

Detailed Description

Definition at line 65 of file vcubicbezierpath.h.

Constructor & Destructor Documentation

◆ VCubicBezierPath() [1/3]

VCubicBezierPath::VCubicBezierPath ( quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)
explicit

Definition at line 73 of file vcubicbezierpath.cpp.

References CubicBezierPath.

◆ VCubicBezierPath() [2/3]

VCubicBezierPath::VCubicBezierPath ( const VCubicBezierPath curve)

Definition at line 80 of file vcubicbezierpath.cpp.

◆ VCubicBezierPath() [3/3]

VCubicBezierPath::VCubicBezierPath ( const QVector< VPointF > &  points,
quint32  idObject = 0,
Draw  mode = Draw::Calculation 
)

Definition at line 87 of file vcubicbezierpath.cpp.

References VAbstractCubicBezierPath::CreateName(), CubicBezierPath, and d.

◆ ~VCubicBezierPath()

VCubicBezierPath::~VCubicBezierPath ( )
virtual

Definition at line 161 of file vcubicbezierpath.cpp.

Member Function Documentation

◆ append()

void VCubicBezierPath::append ( const VPointF point)

Definition at line 178 of file vcubicbezierpath.cpp.

References VAbstractCubicBezierPath::CreateName(), and d.

Referenced by Flip(), Move(), and Rotate().

◆ at()

const VPointF & VCubicBezierPath::at ( int  indx) const

◆ Clear()

void VCubicBezierPath::Clear ( )
virtual

Implements VAbstractCubicBezierPath.

Definition at line 197 of file vcubicbezierpath.cpp.

References d, and VAbstractCurve::SetDuplicate().

Referenced by DialogCubicBezierPath::SavePath().

◆ CountPoints()

◆ CountSubSpl() [1/2]

◆ CountSubSpl() [2/2]

qint32 VCubicBezierPath::CountSubSpl ( qint32  size)
static

Definition at line 324 of file vcubicbezierpath.cpp.

◆ FirstPoint()

VPointF VCubicBezierPath::FirstPoint ( ) const
virtual

Implements VAbstractCubicBezierPath.

Definition at line 356 of file vcubicbezierpath.cpp.

References d.

◆ Flip()

◆ GetC1Length()

qreal VCubicBezierPath::GetC1Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 262 of file vcubicbezierpath.cpp.

References CountSubSpl(), VSpline::GetC1Length(), and GetSpline().

◆ GetC2Length()

qreal VCubicBezierPath::GetC2Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 275 of file vcubicbezierpath.cpp.

References CountSubSpl(), VSpline::GetC2Length(), and GetSpline().

◆ GetCubicPath()

QVector< VPointF > VCubicBezierPath::GetCubicPath ( ) const

Definition at line 318 of file vcubicbezierpath.cpp.

References d.

Referenced by Flip(), Move(), VisToolCubicBezierPath::RefreshGeometry(), and Rotate().

◆ GetEndAngle()

qreal VCubicBezierPath::GetEndAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 248 of file vcubicbezierpath.cpp.

References CountSubSpl(), VSpline::GetEndAngle(), and GetSpline().

◆ GetSpline()

VSpline VCubicBezierPath::GetSpline ( qint32  index) const
virtual

◆ GetSplinePath()

◆ GetStartAngle()

qreal VCubicBezierPath::GetStartAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 235 of file vcubicbezierpath.cpp.

References CountSubSpl(), GetSpline(), and VSpline::GetStartAngle().

◆ LastPoint()

VPointF VCubicBezierPath::LastPoint ( ) const
virtual

Implements VAbstractCubicBezierPath.

Definition at line 369 of file vcubicbezierpath.cpp.

References CountSubSpl(), d, and SubSplOffset().

◆ Move()

◆ operator=()

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

Definition at line 101 of file vcubicbezierpath.cpp.

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

◆ operator[]()

VPointF & VCubicBezierPath::operator[] ( int  indx)

Definition at line 166 of file vcubicbezierpath.cpp.

References d.

◆ Rotate()

VCubicBezierPath VCubicBezierPath::Rotate ( const QPointF &  originPoint,
qreal  degrees,
const QString &  prefix = QString() 
) const

◆ SubSplOffset()

qint32 VCubicBezierPath::SubSplOffset ( qint32  subSplIndex)
static

◆ SubSplPointsCount()

qint32 VCubicBezierPath::SubSplPointsCount ( qint32  countSubSpl)
static

◆ Swap()

void VCubicBezierPath::Swap ( VCubicBezierPath curve)

Definition at line 69 of file vcubicbezierpath.cpp.

References VAbstractCurve::Swap().

Member Data Documentation

◆ d

QSharedDataPointer<VCubicBezierPathData> VCubicBezierPath::d
private

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