55 #include <QGuiApplication>
58 #include <QSharedPointer>
62 #include "../ifc/xml/vdomdocument.h"
63 #include "../vgeometry/vgobject.h"
64 #include "../vgeometry/vpointf.h"
65 #include "../vmisc/vabstractapplication.h"
66 #include "../vmisc/vcommonsettings.h"
67 #include "../vpatterndb/vcontainer.h"
68 #include "../visualization.h"
74 :
VisLine(data, parent), length(0), angle(0), point(nullptr)
88 if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
104 static const QString prefix =
UnitsToStr(
qApp->patternUnit(),
true);
106 "Hold <b>SHIFT</b> to constrain angle, Press <b>ENTER</b> to finish tool creation")
107 .arg(this->line().
angle())
108 .arg(
qApp->TrVars()->FormulaToUser(QString::number(
qApp->fromPixel(this->line().length())),
109 qApp->Settings()->GetOsSeparator()))
116 return QString(
"%1").arg(this->line().
angle());
128 return QString::number(
qApp->fromPixel(this->line().length()));
The VContainer class container of all variables.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
static QLineF BuildLine(const QPointF &p1, const qreal &length, const qreal &angle)
The VPointF class keep data of point.
static qreal CorrectAngle(const qreal &angle)
void DrawPoint(QGraphicsEllipseItem *point, const QPointF &pos, const QColor &color, Qt::PenStyle style=Qt::SolidLine)
static qreal FindLength(const QString &expression, const QHash< QString, QSharedPointer< VInternalVariable > > *vars)
virtual void DrawLine(VScaledLine *lineItem, const QLineF &line, const QColor &color, const qreal &lineWeight, Qt::PenStyle style=Qt::SolidLine)
VScaledEllipse * InitPoint(const QColor &color, QGraphicsItem *parent, qreal z=0) const
static qreal FindVal(const QString &expression, const QHash< QString, QSharedPointer< VInternalVariable > > *vars)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.