31 #include "../vtoolsinglepoint.h"
32 #include "../ifc/xml/vabstractpattern.h"
33 #include "../ifc/xml/vdomdocument.h"
34 #include "../ifc/ifcdef.h"
35 #include "../vgeometry/vgobject.h"
36 #include "../vgeometry/vpointf.h"
37 #include "../vmisc/vabstractapplication.h"
38 #include "../vpatterndb/vcontainer.h"
39 #include "../vwidgets/scalesceneitems.h"
40 #include "../../../vdrawtool.h"
41 #include "../../../../vabstracttool.h"
44 #include <QGraphicsLineItem>
49 #include <QSharedPointer>
69 const QString &typeLine,
const QString &lineWeight,
const QString &lineColor,
70 const quint32 &firstPointId,
const quint32 &secondPointId,
71 QGraphicsItem *parent)
73 , firstPointId(firstPointId)
74 , secondPointId(secondPointId)
77 , lineColor(lineColor)
84 Q_ASSERT_X(
firstPointId != 0, Q_FUNC_INFO,
"firstPointId == 0");
85 Q_ASSERT_X(
secondPointId != 0, Q_FUNC_INFO,
"secondPointId == 0");
92 firstLine->setFlag(QGraphicsItem::ItemStacksBehindParent,
true);
96 secondLine->setFlag(QGraphicsItem::ItemStacksBehindParent,
true);
134 firstLine->setLine(QLineF(point1 - point3, QPointF()));
137 secondLine->setLine(QLineF(point2 - point3, QPointF()));
185 const QLineF line1(
static_cast<QPointF
>(*point1),
static_cast<QPointF
>(*point3));
186 const QLineF line2(
static_cast<QPointF
>(*point2),
static_cast<QPointF
>(*point3));
188 const QString toolTip = QString(
"<table>"
190 "<td align ='right'><b>%9: </b></td>"
191 "<td align ='left'>Intersect XY</td>"
194 "<td align ='right'><b>%1: </b></td>"
195 "<td align ='left'>%5</td>"
198 "<td colspan ='2'><hr></td>"
201 "<td align ='right'><b>%1: </b></td>"
202 "<td align ='left'>Line_%3_%5</td>"
205 "<td align ='right'><b>%2: </b></td>"
206 "<td align ='left'>%6 %8</td>"
209 "<td colspan ='2'><hr></td>"
212 "<td align ='right'><b>%1: </b></td>"
213 "<td align ='left'>Line_%4_%5</td>"
216 "<td align ='right'><b>%2: </b></td>"
217 "<td align ='left'>%7 %8</td>"
225 .arg(
qApp->fromPixel(line1.length()))
226 .arg(
qApp->fromPixel(line2.length()))
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.