54 #include <QGraphicsPathItem>
56 #include <QPainterPath>
59 #include <QtAlgorithms>
61 #include "../vgeometry/vabstractcurve.h"
62 #include "../vgeometry/vgeometrydef.h"
63 #include "../vgeometry/vpointf.h"
64 #include "../vgeometry/vspline.h"
65 #include "../vgeometry/vsplinepoint.h"
66 #include "../vpatterndb/vcontainer.h"
67 #include "../vwidgets/vcontrolpointspline.h"
68 #include "../visualization.h"
76 newCurveSegment(nullptr),
78 isLeftMousePressed(false),
79 pointIsSelected(false),
97 const int size = pathPoints.size();
99 for (
int i = 0; i < size; ++i)
112 const int lastPoint = preLastPoint + 1;
117 static_cast<QPointF
>(spl.
GetP2()),
118 static_cast<QPointF
>(spl.
GetP1()));
120 static_cast<QPointF
>(spl.
GetP3()),
121 static_cast<QPointF
>(spl.
GetP4()));
125 Creating(
static_cast<QPointF
>(pathPoints.at(size-1).P()), size);
140 "Press <b>ENTER</b> to finish tool creation");
185 if (
static_cast<quint32
>(
points.size() - 1) >= i &&
points.isEmpty() ==
false)
187 return points.at(
static_cast<int>(i));
199 controlPoint1->hide();
205 controlPoint1->hide();
209 controlPoint2->hide();
222 int preLastPoint = 0;
226 lastPoint = (size - 1) * 2;
227 preLastPoint = lastPoint - 1;
258 ctrlLine.setAngle(ctrlLine.angle()+180);
281 path[size-1].SetLength2(0,
"0");
298 path[size-1].SetLength1(0,
"0");
299 path[size-1].SetLength2(0,
"0");
318 path[size-1].SetLength2(0,
"0");
virtual QPainterPath GetPath() const Q_DECL_OVERRIDE
GetPath return QPainterPath which reprezent spline path.
virtual QVector< DirectionArrow > DirectionArrows() const Q_DECL_OVERRIDE
virtual QPainterPath GetPath() const
The VContainer class container of all variables.
The VControlPointSpline class control spline point.
The VPointF class keep data of point.
The VSplinePath class keep information about splinePath.
virtual VSpline GetSpline(qint32 index) const Q_DECL_OVERRIDE
GetSpline return spline by index.
virtual qint32 CountPoints() const Q_DECL_OVERRIDE
CountPoints return count of points.
virtual QVector< VSplinePoint > GetSplinePath() const Q_DECL_OVERRIDE
GetSplinePath return list with spline points.
virtual qint32 CountSubSpl() const Q_DECL_OVERRIDE
CountSubSpl return count of simple splines.
VSpline class that implements the spline.
virtual qreal GetC2Length() const Q_DECL_OVERRIDE
virtual VPointF GetP4() const Q_DECL_OVERRIDE
GetP4 return last spline point.
QString GetC1LengthFormula() const
virtual qreal GetStartAngle() const Q_DECL_OVERRIDE
GetAngle1 return first angle control line.
virtual VPointF GetP1() const Q_DECL_OVERRIDE
GetP1 return first spline point.
virtual VPointF GetP2() const Q_DECL_OVERRIDE
GetP2 return first control point.
QString GetStartAngleFormula() const
virtual qreal GetC1Length() const Q_DECL_OVERRIDE
virtual VPointF GetP3() const Q_DECL_OVERRIDE
GetP3 return second control point.
QString GetC2LengthFormula() const
void ToolTip(const QString &toolTip)
void DrawPoint(QGraphicsEllipseItem *point, const QPointF &pos, const QColor &color, Qt::PenStyle style=Qt::SolidLine)
void DrawPath(VCurvePathItem *pathItem, const QPainterPath &path, const QColor &color, Qt::PenStyle style=Qt::SolidLine, const qreal &weight=0.35, Qt::PenCapStyle cap=Qt::SquareCap)
VScaledEllipse * InitPoint(const QColor &color, QGraphicsItem *parent, qreal z=0) const
const qreal defPointRadiusPixel