57 #include <QSharedPointer>
58 #include <QStaticStringData>
59 #include <QStringData>
60 #include <QStringDataPtr>
63 #include "../../../../dialogs/tools/dialoglineintersect.h"
64 #include "../../../../visualization/line/vistoollineintersect.h"
65 #include "../ifc/exception/vexception.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 "../vwidgets/vmaingraphicsscene.h"
72 #include "../../../../dialogs/tools/dialogtool.h"
73 #include "../../../../visualization/visualization.h"
74 #include "../../../vabstracttool.h"
75 #include "../../vdrawtool.h"
96 const quint32 &p1Line1,
const quint32 &p2Line1,
const quint32 &p1Line2,
97 const quint32 &p2Line2,
const Source &typeCreation,
98 QGraphicsItem *parent)
118 dialogTool->SetP1Line1(
p1Line1);
119 dialogTool->SetP2Line1(
p2Line1);
120 dialogTool->SetP1Line2(
p1Line2);
121 dialogTool->SetP2Line2(
p2Line2);
122 dialogTool->SetPointName(p->name());
140 const quint32 p1Line1Id = dialogTool->GetP1Line1();
141 const quint32 p2Line1Id = dialogTool->GetP2Line1();
142 const quint32 p1Line2Id = dialogTool->GetP1Line2();
143 const quint32 p2Line2Id = dialogTool->GetP2Line2();
144 const QString pointName = dialogTool->getPointName();
145 VToolLineIntersect* point =
Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10,
true, scene,
doc,
147 if (point !=
nullptr)
173 const quint32 &p1Line2Id,
const quint32 &p2Line2Id,
174 const QString &pointName, qreal mx, qreal my,
bool showPointName,
183 QLineF line1(
static_cast<QPointF
>(*
p1Line1),
static_cast<QPointF
>(*
p2Line1));
184 QLineF line2(
static_cast<QPointF
>(*
p1Line2),
static_cast<QPointF
>(*
p2Line2));
186 QLineF::IntersectType intersect = line1.intersects(line2, &fPoint);
187 if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
219 p2Line2Id, typeCreation);
220 scene->addItem(point);
266 ContextMenu<DialogLineIntersect>(event,
id);
332 if (not
vis.isNull())
354 const QLineF p1L1ToCur(
static_cast<QPointF
>(*p1L1),
static_cast<QPointF
>(*current));
355 const QLineF curToP2L1(
static_cast<QPointF
>(*current),
static_cast<QPointF
>(*p2L1));
356 const QLineF p1L2ToCur(
static_cast<QPointF
>(*p1L2),
static_cast<QPointF
>(*current));
357 const QLineF curToP2L2(
static_cast<QPointF
>(*current),
static_cast<QPointF
>(*p2L2));
359 const QString toolTip = QString(
"<table>"
360 "<tr> <td><b>%10:</b> %11</td> </tr>"
361 "<tr> <td><b>%1:</b> %2 %3</td> </tr>"
362 "<tr> <td><b>%4:</b> %5 %3</td> </tr>"
363 "<tr> <td><b>%6:</b> %7 %3</td> </tr>"
364 "<tr> <td><b>%8:</b> %9 %3</td> </tr>"
366 .arg(QString(
"%1->%2").arg(p1L1->name(), current->name()))
367 .arg(
qApp->fromPixel(p1L1ToCur.length()))
369 .arg(QString(
"%1->%2").arg(current->name(), p2L1->name()))
370 .arg(
qApp->fromPixel(curToP2L1.length()))
371 .arg(QString(
"%1->%2").arg(p1L2->name(), current->name()))
372 .arg(
qApp->fromPixel(p1L2ToCur.length()))
373 .arg(QString(
"%1->%2").arg(current->name(), p2L2->name()))
374 .arg(
qApp->fromPixel(curToP2L2.length()))
376 .arg(current->name());
402 ShowToolVisualization<VisToolLineIntersect>(show);
The DialogLineIntersect class dialog for ToolLineIntersect. Help create point and edit option.
virtual void UpdateToolData(const quint32 &id, VContainer *data)=0
virtual void IncrementReferens(quint32 id) const =0
static void AddTool(quint32 id, VDataTool *tool)
AddTool add tool to list tools.
virtual void DecrementReferens(quint32 id) const =0
static void InitToolConnections(VMainGraphicsScene *scene, T *tool)
The VContainer class container of all variables.
void AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
AddLine add line to container.
const QSharedPointer< VGObject > GetGObject(quint32 id) const
GetGObject returns a point by id.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
quint32 AddGObject(VGObject *obj)
AddGObject add new GObject to container.
void UpdateGObject(quint32 id, T *obj)
UpdateGObject update GObject by id.
static quint32 GetParametrUInt(const QDomElement &domElement, const QString &name, const QString &defValue)
Returns the long long value of the given attribute. RENAME: GetParameterLongLong?
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
The VMainGraphicsScene class main scene.
The VPointF class keep data of point.
void setShowPointName(bool show)
void setObject1Id(const quint32 &value)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const QString AttrP1Line1
const QString AttrP2Line2
const QString AttrP1Line2
const QString AttrP2Line1