55 #include <QGraphicsLineItem>
60 #include <QSharedPointer>
64 #include "../ifc/xml/vabstractpattern.h"
65 #include "../ifc/xml/vdomdocument.h"
66 #include "../ifc/ifcdef.h"
67 #include "../vgeometry/vgobject.h"
68 #include "../vgeometry/vpointf.h"
69 #include "../vmisc/vabstractapplication.h"
70 #include "../vpatterndb/vcontainer.h"
71 #include "../../../../vabstracttool.h"
72 #include "../../../vdrawtool.h"
73 #include "../vtoolsinglepoint.h"
74 #include "../vwidgets/scalesceneitems.h"
92 const QString &lineType,
const QString &lineWeight,
93 const QString &lineColor,
const QString &formula,
const quint32 &basePointId,
94 const qreal &angle, QGraphicsItem *parent)
96 , formulaLength(formula)
98 , basePointId(basePointId)
100 , lineColor(lineColor)
107 Q_ASSERT_X(
basePointId != 0, Q_FUNC_INFO,
"basePointId == 0");
112 mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent,
true);
146 mainLine->setLine(QLineF(basePoint - point, QPointF()));
189 const QLineF line(
static_cast<QPointF
>(*first),
static_cast<QPointF
>(*second));
191 const QString toolTip = QString(
"<table>"
192 "<tr> <td><b> %6:</b> %7</td> </tr>"
193 "<tr> <td><b>%1:</b> %2 %3</td> </tr>"
194 "<tr> <td><b> %4:</b> %5°</td> </tr>"
197 .arg(
qApp->fromPixel(line.length()))
202 .arg(second->name());
286 if (value.
error() ==
false)
QString useGroupColor(quint32 toolId, QString color)
QString useGroupLineWeight(quint32 toolId, QString weight)
QString useGroupLineType(quint32 toolId, QString type)
virtual void DecrementReferens(quint32 id) const =0
The VContainer class container of all variables.
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
The VPointF class keep data of point.
void setBasicWidth(const qreal &value)
void setPointColor(const QString &value)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
virtual void refreshPointGeometry(const VPointF &point)
double ToPixel(double val, const Unit &unit)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
QColor correctColor(const QGraphicsItem *item, const QColor &color)
const QString AttrLineType
const QString AttrLineWeight
const QString AttrLineColor
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.