Seamly2D
Code documentation
VSplinePath Class Reference

The VSplinePath class keep information about splinePath. More...

#include <vsplinepath.h>

Inheritance diagram for VSplinePath:
Collaboration diagram for VSplinePath:

Public Member Functions

 VSplinePath (quint32 idObject=0, Draw mode=Draw::Calculation)
 VSplinePath constructor. More...
 
 VSplinePath (const QVector< VFSplinePoint > &points, qreal kCurve=1, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VSplinePath (const QVector< VSplinePoint > &points, quint32 idObject=0, Draw mode=Draw::Calculation)
 
 VSplinePath (const VSplinePath &splPath)
 VSplinePath copy constructor. More...
 
VSplinePath Rotate (const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
 
VSplinePath Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VSplinePath Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
virtual ~VSplinePath () Q_DECL_OVERRIDE
 
VSplinePointoperator[] (int indx)
 operator [] return spline point by index. More...
 
VSplinePathoperator= (const VSplinePath &path)
 operator = assignment operator. More...
 
void Swap (VSplinePath &path) Q_DECL_NOTHROW
 
void append (const VSplinePoint &point)
 append add point in the end of list points. More...
 
virtual qint32 CountSubSpl () const Q_DECL_OVERRIDE
 CountSubSpl return count of simple splines. More...
 
virtual qint32 CountPoints () const Q_DECL_OVERRIDE
 CountPoints return count of points. More...
 
virtual void Clear () Q_DECL_OVERRIDE
 Clear clear list of points. More...
 
virtual VSpline GetSpline (qint32 index) const Q_DECL_OVERRIDE
 GetSpline return spline by index. More...
 
virtual QVector< VSplinePointGetSplinePath () const Q_DECL_OVERRIDE
 GetSplinePath return list with spline points. More...
 
QVector< VFSplinePointGetFSplinePath () const
 
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
 
void UpdatePoint (qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point)
 UpdatePoint update spline point in list. More...
 
VSplinePoint GetSplinePoint (qint32 indexSpline, SplinePointPosition pos) const
 GetSplinePoint return spline point from list. More...
 
const VSplinePointat (int indx) const
 at return spline point by index. More...
 
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
 

Private Attributes

QSharedDataPointer< VSplinePathDatad
 

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

The VSplinePath class keep information about splinePath.

Definition at line 71 of file vsplinepath.h.

Constructor & Destructor Documentation

◆ VSplinePath() [1/4]

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

VSplinePath constructor.

Parameters
idObjectparent id.
modemode creation spline path.

Definition at line 74 of file vsplinepath.cpp.

References SplinePath.

◆ VSplinePath() [2/4]

◆ VSplinePath() [3/4]

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

Definition at line 110 of file vsplinepath.cpp.

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

◆ VSplinePath() [4/4]

VSplinePath::VSplinePath ( const VSplinePath splPath)

VSplinePath copy constructor.

Parameters
splPathspline path.

Definition at line 128 of file vsplinepath.cpp.

◆ ~VSplinePath()

VSplinePath::~VSplinePath ( )
virtual

Definition at line 209 of file vsplinepath.cpp.

Member Function Documentation

◆ append()

void VSplinePath::append ( const VSplinePoint point)

append add point in the end of list points.

Parameters
pointnew point.

Definition at line 217 of file vsplinepath.cpp.

References VAbstractCubicBezierPath::CreateName(), d, and VSplinePoint::P().

◆ at()

const VSplinePoint & VSplinePath::at ( int  indx) const

at return spline point by index.

Parameters
indxindex in list.
Returns
spline point.

Definition at line 350 of file vsplinepath.cpp.

References d.

Referenced by DialogSplinePath::currentPointChanged(), DialogSplinePath::SetPath(), and VToolSplinePath::UpdatePathPoints().

◆ Clear()

void VSplinePath::Clear ( )
virtual

Clear clear list of points.

Implements VAbstractCubicBezierPath.

Definition at line 483 of file vsplinepath.cpp.

References d, and VAbstractCurve::SetDuplicate().

Referenced by DialogSplinePath::SavePath().

◆ CountPoints()

◆ CountSubSpl()

qint32 VSplinePath::CountSubSpl ( ) const
virtual

CountSubSpl return count of simple splines.

Returns
count.

Implements VAbstractCubicBezierPath.

Definition at line 233 of file vsplinepath.cpp.

References d.

Referenced by Flip(), GetFSplinePath(), GetSpline(), GetSplinePoint(), LastPoint(), Move(), VisToolSplinePath::RefreshGeometry(), Rotate(), and UpdatePoint().

◆ FirstPoint()

VPointF VSplinePath::FirstPoint ( ) const
virtual

Implements VAbstractCubicBezierPath.

Definition at line 408 of file vsplinepath.cpp.

References d.

◆ Flip()

◆ GetC1Length()

qreal VSplinePath::GetC1Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 382 of file vsplinepath.cpp.

References CountPoints(), and GetSplinePath().

◆ GetC2Length()

qreal VSplinePath::GetC2Length ( ) const
virtual

Implements VAbstractBezier.

Definition at line 395 of file vsplinepath.cpp.

References CountPoints(), and GetSplinePath().

◆ GetEndAngle()

qreal VSplinePath::GetEndAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 369 of file vsplinepath.cpp.

References CountPoints(), and GetSplinePath().

◆ GetFSplinePath()

◆ GetSpline()

VSpline VSplinePath::GetSpline ( qint32  index) const
virtual

◆ GetSplinePath()

QVector< VSplinePoint > VSplinePath::GetSplinePath ( ) const
virtual

GetSplinePath return list with spline points.

Returns
list.

Implements VAbstractCubicBezierPath.

Definition at line 449 of file vsplinepath.cpp.

References d.

Referenced by GetC1Length(), GetC2Length(), GetEndAngle(), GetStartAngle(), and VisToolSplinePath::RefreshGeometry().

◆ GetSplinePoint()

VSplinePoint VSplinePath::GetSplinePoint ( qint32  indexSpline,
SplinePointPosition  pos 
) const

GetSplinePoint return spline point from list.

Parameters
indexSplinespline index in list.
posposition point in spline.
Returns
spline point.

Definition at line 300 of file vsplinepath.cpp.

References CountSubSpl(), d, and FirstPoint.

◆ GetStartAngle()

qreal VSplinePath::GetStartAngle ( ) const
virtual

Implements VAbstractCurve.

Definition at line 356 of file vsplinepath.cpp.

References CountPoints(), and GetSplinePath().

◆ LastPoint()

VPointF VSplinePath::LastPoint ( ) const
virtual

Implements VAbstractCubicBezierPath.

Definition at line 421 of file vsplinepath.cpp.

References CountSubSpl(), and d.

◆ Move()

◆ operator=()

VSplinePath & VSplinePath::operator= ( const VSplinePath path)

operator = assignment operator.

Parameters
pathspline path.
Returns
spline path.

Definition at line 322 of file vsplinepath.cpp.

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

◆ operator[]()

VSplinePoint & VSplinePath::operator[] ( int  indx)

operator [] return spline point by index.

Parameters
indxindex in list.
Returns
spline point.

Definition at line 339 of file vsplinepath.cpp.

References d.

◆ Rotate()

◆ Swap()

void VSplinePath::Swap ( VSplinePath path)

Definition at line 65 of file vsplinepath.cpp.

References VAbstractCurve::Swap().

◆ UpdatePoint()

void VSplinePath::UpdatePoint ( qint32  indexSpline,
const SplinePointPosition pos,
const VSplinePoint point 
)

UpdatePoint update spline point in list.

Parameters
indexSplinespline index in list.
posposition point in spline.
pointpoint.

Definition at line 277 of file vsplinepath.cpp.

References CountSubSpl(), d, and FirstPoint.

Member Data Documentation

◆ d


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