55 #include <QSharedDataPointer>
83 #ifdef Q_COMPILER_RVALUE_REFS
91 virtual QString
name()
const;
101 virtual void setId(
const quint32 &
id);
105 static QLineF
BuildLine(
const QPointF &p1,
const qreal& length,
const qreal &angle);
106 static QPointF
BuildRay(
const QPointF &firstPoint,
const qreal &angle,
const QRectF &scRect);
107 static QLineF
BuildAxis(
const QPointF &p,
const qreal &angle,
const QRectF &scRect);
108 static QLineF
BuildAxis(
const QPointF &p1,
const QPointF &p2,
const QRectF &scRect);
110 static int ContactPoints (
const QPointF &p,
const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2);
112 static int IntersectionCircles(
const QPointF &c1,
double r1,
const QPointF &c2,
double r2, QPointF &p1,
114 static qint32
LineIntersectCircle(
const QPointF ¢er, qreal radius,
const QLineF &line, QPointF &p1,
116 static QPointF
ClosestPoint(
const QLineF &line,
const QPointF &point);
117 static QPointF
addVector (
const QPointF &p,
const QPointF &p1,
const QPointF &p2, qreal k);
118 static void LineCoefficients(
const QLineF &line, qreal *a, qreal *b, qreal *c);
122 template <
typename T>
130 QSharedDataPointer<VGObjectData>
d;
132 static double PerpDotProduct(
const QPointF &p1,
const QPointF &p2,
const QPointF &t);
133 static double GetEpsilon(
const QPointF &p1,
const QPointF &p2);
135 static int PointInCircle (
const QPointF &p,
const QPointF ¢er, qreal radius);
144 template <
typename T>
147 if (points.isEmpty())
153 for (qint32 i = points.size() - 1; i >= 0; --i)
155 reversePoints.replace(j, points.at(i));
158 return reversePoints;
The VGObject class keep information graphical objects.
static bool IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const QPointF &p2)
IsPointOnLineSegment Check if the point is on the line segment.
static double PerpDotProduct(const QPointF &p1, const QPointF &p2, const QPointF &t)
PerpDotProduct Calculates the area of the parallelogram of the three points. This is actually the sam...
GOType getType() const
getType return object type.
static double GetEpsilon(const QPointF &p1, const QPointF &p2)
GetEpsilon solve the floating-point accuraccy problem.
void setMode(const Draw &value)
setMode set mode creation.
void setType(const GOType &type)
void setIdObject(const quint32 &value)
setIdObject set parent id.
static QLineF BuildAxis(const QPointF &p, const qreal &angle, const QRectF &scRect)
static qint32 LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1, QPointF &p2)
LineIntersectCircle find point intersection line and circle.
VGObject()
VGObject default constructor.
static QPointF ClosestPoint(const QLineF &line, const QPointF &point)
ClosestPoint find point projection of point onto line.
virtual QString name() const
name return name graphical object.
VGObject & operator=(const VGObject &obj)
operator = assignment operator.
static QTransform flipTransform(const QLineF &axis)
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c)
LineCoefficients coefficient for equation of segment. Segment equestion ax+by+c=0.
static int IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2)
static QVector< T > GetReversePoints(const QVector< T > &points)
GetReversePoint return revers container of points.
static bool IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2)
IsPointOnLineviaPDP use the perp dot product (PDP) way.
static int PointInCircle(const QPointF &p, const QPointF ¢er, qreal radius)
static QPointF BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect)
static QLineF BuildLine(const QPointF &p1, const qreal &length, const qreal &angle)
QSharedDataPointer< VGObjectData > d
void Swap(VGObject &obj) Q_DECL_NOTHROW
quint32 getIdObject() const
getIdObject return parent id.
static QPointF LineIntersectRect(const QRectF &rec, const QLineF &line)
LineIntersectRect find point intersection line and rect.
void setName(const QString &name)
setName set name graphical object.
Draw getMode() const
getMode return mode creation.
quint32 id() const
id return id object.
virtual void setId(const quint32 &id)
setId set id object.
static QPointF addVector(const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k)
static int GetLengthContour(const QVector< QPointF > &contour, const QVector< QPointF > &newPoints)
GetLengthContour return length of contour.
static int ContactPoints(const QPointF &p, const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2)
quint32 getIdTool() const
static const double accuracyPointOnLine
Q_DECLARE_TYPEINFO(VGObject, Q_MOVABLE_TYPE)