56 #include <QSharedPointer>
57 #include <QStaticStringData>
58 #include <QStringData>
59 #include <QStringDataPtr>
62 #include "../../../../dialogs/tools/dialogtruedarts.h"
63 #include "../../../../dialogs/tools/dialogtool.h"
64 #include "../../../../visualization/visualization.h"
65 #include "../../../../visualization/line/vistooltruedarts.h"
66 #include "../ifc/exception/vexception.h"
67 #include "../ifc/ifcdef.h"
68 #include "../vgeometry/vgobject.h"
69 #include "../vgeometry/vpointf.h"
70 #include "../vpatterndb/vcontainer.h"
71 #include "../vwidgets/vmaingraphicsscene.h"
72 #include "../../../vabstracttool.h"
73 #include "../../vdrawtool.h"
86 const quint32 &baseLineP1Id,
87 const quint32 &baseLineP2Id,
88 const quint32 &dartP1Id,
89 const quint32 &dartP2Id,
90 const quint32 &dartP3Id,
91 const Source &typeCreation,
92 QGraphicsItem *parent)
94 , baseLineP1Id (baseLineP1Id)
95 , baseLineP2Id(baseLineP2Id)
105 const QPointF &dartP2,
const QPointF &dartP3, QPointF &p1, QPointF &p2)
107 const QLineF d2d1(dartP2, dartP1);
108 const QLineF d2d3(dartP2, dartP3);
110 const qreal degrees = d2d3.angleTo(d2d1);
112 QLineF d2blP2(dartP2, baseLineP2);
113 d2blP2.setAngle(d2blP2.angle()+degrees);
115 if (QLineF(baseLineP1, d2blP2.p2()).intersects(d2d1, &p1) == QLineF::NoIntersection)
122 QLineF d2p1(dartP2, p1);
123 d2p1.setAngle(d2p1.angle()-degrees);
137 dialogTool->SetChildrenId(
p1id,
p2id);
138 dialogTool->SetNewDartPointNames(p1->name(), p2->name());
141 dialogTool->SetFirstDartPointId(
dartP1Id);
142 dialogTool->SetSecondDartPointId(
dartP2Id);
143 dialogTool->SetThirdDartPointId(
dartP3Id);
154 const QString point1Name = dialogTool->GetFirstNewDartPointName();
155 const QString point2Name = dialogTool->GetSecondNewDartPointName();
156 const quint32
baseLineP1Id = dialogTool->GetFirstBasePointId();
157 const quint32
baseLineP2Id = dialogTool->GetSecondBasePointId();
158 const quint32
dartP1Id = dialogTool->GetFirstDartPointId();
159 const quint32
dartP2Id = dialogTool->GetSecondDartPointId();
160 const quint32
dartP3Id = dialogTool->GetThirdDartPointId();
163 point1Name, 5, 10,
true, point2Name, 5, 10,
true, scene,
doc,
data,
Document::FullParse,
165 if (point !=
nullptr)
174 const quint32 &_p1id,
const quint32 &_p2id,
175 const quint32 &baseLineP1Id,
176 const quint32 &baseLineP2Id,
177 const quint32 &dartP1Id,
178 const quint32 &dartP2Id,
179 const quint32 &dartP3Id,
180 const QString &point1Name,
181 qreal mx1, qreal my1,
bool showPointName1,
182 const QString &point2Name,
183 qreal mx2, qreal my2,
bool showPointName2,
196 static_cast<QPointF
>(*dartP1),
static_cast<QPointF
>(*dartP2),
197 static_cast<QPointF
>(*dartP3), fPoint1, fPoint2);
200 quint32
p1id = _p1id;
201 quint32
p2id = _p2id;
231 scene->addItem(points);
247 ShowToolVisualization<VisToolTrueDarts>(show);
375 ContextMenu<DialogTrueDarts>(event,
id);
443 if (not
vis.isNull())
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.
static quint32 getNextId()
getNextId generate next unique id
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.
static const QSharedPointer< VGObject > GetFakeGObject(quint32 id)
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)
const QString AttrBaseLineP1
const QString AttrBaseLineP2