56 #include <QSharedPointer>
57 #include <QStaticStringData>
58 #include <QStringData>
59 #include <QStringDataPtr>
62 #include "../../../../dialogs/tools/dialogtriangle.h"
63 #include "../../../../dialogs/tools/dialogtool.h"
64 #include "../../../../visualization/visualization.h"
65 #include "../../../../visualization/line/vistooltriangle.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"
75 #include "../vmisc/vmath.h"
76 #include "../vmisc/vabstractapplication.h"
96 const quint32 &axisP2Id,
const quint32 &firstPointId,
const quint32 &secondPointId,
97 const Source &typeCreation, QGraphicsItem *parent)
101 , firstPointId(firstPointId)
102 , secondPointId(secondPointId)
121 dialogTool->SetPointName(p->name());
139 const quint32
axisP1Id = dialogTool->GetAxisP1Id();
140 const quint32
axisP2Id = dialogTool->GetAxisP2Id();
141 const quint32
firstPointId = dialogTool->GetFirstPointId();
142 const quint32
secondPointId = dialogTool->GetSecondPointId();
143 const QString pointName = dialogTool->getPointName();
146 if (point !=
nullptr)
173 quint32 axisP2Id, quint32 firstPointId, quint32 secondPointId,
182 QPointF point =
FindPoint(
static_cast<QPointF
>(*axisP1),
static_cast<QPointF
>(*axisP2),
183 static_cast<QPointF
>(*firstPoint),
static_cast<QPointF
>(*secondPoint));
206 scene->addItem(point);
228 const QPointF &secondPoint)
230 QLineF axis(axisP1, axisP2);
231 QLineF hypotenuse(firstPoint, secondPoint);
234 QLineF::IntersectType intersect = axis.intersects(hypotenuse, &startPoint);
235 if (intersect != QLineF::UnboundedIntersection && intersect != QLineF::BoundedIntersection)
248 line.setP1(startPoint);
249 line.setAngle(axis.angle());
250 line.setLength(step);
252 qint64 c = qFloor(hypotenuse.length());
255 line.setLength(line.length()+step);
256 qint64 a = qFloor(QLineF(line.p2(), firstPoint).length());
257 qint64 b = qFloor(QLineF(line.p2(), secondPoint).length());
258 if (c*c <= (a*a + b*b))
316 ContextMenu<DialogTriangle>(event,
id);
365 if (not
vis.isNull())
399 ShowToolVisualization<VisToolTriangle>(show);
The DialogTriangle class dialog for ToolTriangle. 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.
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)
static Q_REQUIRED_RESULT bool VFuzzyComparePossibleNulls(double p1, double p2)
const QString AttrSecondPoint
const QString AttrFirstPoint