Seamly2D
Code documentation
VPointF Class Reference

The VPointF class keep data of point. More...

#include <vpointf.h>

Inheritance diagram for VPointF:
Collaboration diagram for VPointF:

Public Member Functions

 VPointF ()
 VPointF creat empty point. More...
 
 VPointF (const VPointF &point)
 
 VPointF (const QPointF &point)
 
 VPointF (qreal x, qreal y, const QString &name, qreal mx, qreal my, quint32 idObject=0, const Draw &mode=Draw::Calculation)
 VPointF create new point. More...
 
 VPointF (const QPointF &point, const QString &name, qreal mx, qreal my, quint32 idObject=0, const Draw &mode=Draw::Calculation)
 VPointF create new point. More...
 
virtual ~VPointF () Q_DECL_OVERRIDE
 
VPointFoperator= (const VPointF &point)
 operator = assignment operator More...
 
void Swap (VPointF &point) Q_DECL_NOTHROW
 
 operator QPointF () const
 
VPointF Rotate (const QPointF &originPoint, qreal degrees, const QString &prefix=QString()) const
 
VPointF Flip (const QLineF &axis, const QString &prefix=QString()) const
 
VPointF Move (qreal length, qreal angle, const QString &prefix=QString()) const
 
qreal mx () const
 mx return offset name respect to x More...
 
qreal my () const
 my return offset name respect to y More...
 
void setMx (qreal mx)
 setMx set offset name respect to x More...
 
void setMy (qreal my)
 setMy set offset name respect to y More...
 
QPointF toQPointF () const
 
qreal x () const
 x return x coordinate More...
 
void setX (const qreal &value)
 setX set x coordinate More...
 
qreal y () const
 y return y coordinate More...
 
void setY (const qreal &value)
 setY set y coordinate More...
 
bool isShowPointName () const
 
void setShowPointName (bool show)
 
- 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 QPointF RotatePF (const QPointF &originPoint, const QPointF &point, qreal degrees)
 
static QPointF FlipPF (const QLineF &axis, const QPointF &point)
 
static QPointF MovePF (const QPointF &originPoint, qreal length, qreal angle)
 
- 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< VPointFDatad
 

Additional Inherited Members

- Static Public Attributes inherited from VGObject
static const double accuracyPointOnLine = (0.1555 / 25.4) * 96.0
 
- Static Protected Member Functions inherited from VGObject
static QTransform flipTransform (const QLineF &axis)
 

Detailed Description

The VPointF class keep data of point.

Definition at line 74 of file vpointf.h.

Constructor & Destructor Documentation

◆ VPointF() [1/5]

VPointF::VPointF ( )

VPointF creat empty point.

Definition at line 70 of file vpointf.cpp.

References Calculation, and Point.

◆ VPointF() [2/5]

VPointF::VPointF ( const VPointF point)

Definition at line 76 of file vpointf.cpp.

◆ VPointF() [3/5]

VPointF::VPointF ( const QPointF &  point)
explicit

Definition at line 82 of file vpointf.cpp.

◆ VPointF() [4/5]

VPointF::VPointF ( qreal  x,
qreal  y,
const QString &  name,
qreal  mx,
qreal  my,
quint32  idObject = 0,
const Draw mode = Draw::Calculation 
)

VPointF create new point.

Parameters
xx coordinate
yy coordinate
namepoint label
mxoffset name respect to x
myoffset name respect to y

Definition at line 96 of file vpointf.cpp.

References VGObject::name(), Point, and VGObject::setName().

◆ VPointF() [5/5]

VPointF::VPointF ( const QPointF &  point,
const QString &  name,
qreal  mx,
qreal  my,
quint32  idObject = 0,
const Draw mode = Draw::Calculation 
)

VPointF create new point.

Parameters
pointpoint
namepoint label
mxoffset name respect to x
myoffset name respect to y

Definition at line 111 of file vpointf.cpp.

References VGObject::name(), Point, and VGObject::setName().

◆ ~VPointF()

VPointF::~VPointF ( )
virtual

Definition at line 119 of file vpointf.cpp.

Member Function Documentation

◆ Flip()

VPointF VPointF::Flip ( const QLineF &  axis,
const QString &  prefix = QString() 
) const

◆ FlipPF()

QPointF VPointF::FlipPF ( const QLineF &  axis,
const QPointF &  point 
)
static

◆ isShowPointName()

bool VPointF::isShowPointName ( ) const

Definition at line 259 of file vpointf.cpp.

References d.

Referenced by Flip(), Move(), VScenePoint::refreshPointGeometry(), Rotate(), and VToolDoublePoint::SaveOptions().

◆ Move()

VPointF VPointF::Move ( qreal  length,
qreal  angle,
const QString &  prefix = QString() 
) const

◆ MovePF()

QPointF VPointF::MovePF ( const QPointF &  originPoint,
qreal  length,
qreal  angle 
)
static

Definition at line 286 of file vpointf.cpp.

Referenced by VArc::Move(), Move(), and VSpline::Move().

◆ mx()

qreal VPointF::mx ( ) const

mx return offset name respect to x

Returns
offset

Definition at line 177 of file vpointf.cpp.

References d.

Referenced by Flip(), Move(), VScenePoint::refreshPointGeometry(), Rotate(), VToolDoublePoint::SaveOptions(), and setMx().

◆ my()

qreal VPointF::my ( ) const

my return offset name respect to y

Returns
offset

Definition at line 187 of file vpointf.cpp.

References d.

Referenced by Flip(), Move(), VScenePoint::refreshPointGeometry(), Rotate(), VToolDoublePoint::SaveOptions(), and setMy().

◆ operator QPointF()

VPointF::operator QPointF ( ) const
explicit

Definition at line 140 of file vpointf.cpp.

◆ operator=()

VPointF & VPointF::operator= ( const VPointF point)

operator = assignment operator

Parameters
pointpoint
Returns
point

Definition at line 128 of file vpointf.cpp.

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

◆ Rotate()

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

◆ RotatePF()

QPointF VPointF::RotatePF ( const QPointF &  originPoint,
const QPointF &  point,
qreal  degrees 
)
static

Definition at line 271 of file vpointf.cpp.

Referenced by VArc::Rotate(), Rotate(), and VSpline::Rotate().

◆ setMx()

void VPointF::setMx ( qreal  mx)

setMx set offset name respect to x

Parameters
mxoffset

Definition at line 197 of file vpointf.cpp.

References d, and mx().

Referenced by VToolCutSplinePath::Create(), and VToolDoublePoint::setPointNamePosition().

◆ setMy()

void VPointF::setMy ( qreal  my)

setMy set offset name respect to y

Parameters
myoffset

Definition at line 207 of file vpointf.cpp.

References d, and my().

Referenced by VToolCutSplinePath::Create(), and VToolDoublePoint::setPointNamePosition().

◆ setShowPointName()

◆ setX()

void VPointF::setX ( const qreal &  value)

setX set x coordinate

Parameters
valuex coordinate

Definition at line 233 of file vpointf.cpp.

References d.

Referenced by QT_WARNING_POP::BiasRotatePoint(), VEllipticalArc::GetCenter(), and QT_WARNING_POP::UnionInitParameters().

◆ setY()

void VPointF::setY ( const qreal &  value)

setY set y coordinate

Parameters
valuey coordinate

Definition at line 253 of file vpointf.cpp.

References d.

Referenced by QT_WARNING_POP::BiasRotatePoint(), VEllipticalArc::GetCenter(), and QT_WARNING_POP::UnionInitParameters().

◆ Swap()

void VPointF::Swap ( VPointF point)

Definition at line 63 of file vpointf.cpp.

References VGObject::Swap().

◆ toQPointF()

◆ x()

qreal VPointF::x ( ) const

x return x coordinate

Returns
value

Definition at line 223 of file vpointf.cpp.

References d.

Referenced by QT_WARNING_POP::BiasRotatePoint(), VToolMove::Create(), VSpline::ParamT(), QT_WARNING_POP::UnionInitParameters(), and VSplineData::VSplineData().

◆ y()

qreal VPointF::y ( ) const

y return y coordinate

Returns
value

Definition at line 243 of file vpointf.cpp.

References d.

Referenced by QT_WARNING_POP::BiasRotatePoint(), VToolMove::Create(), VSpline::ParamT(), QT_WARNING_POP::UnionInitParameters(), and VSplineData::VSplineData().

Member Data Documentation

◆ d

QSharedDataPointer<VPointFData> VPointF::d
private

Definition at line 115 of file vpointf.h.

Referenced by isShowPointName(), mx(), my(), operator=(), setMx(), setMy(), setShowPointName(), setX(), setY(), toQPointF(), x(), and y().


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