59 #include "../ifc/ifcdef.h"
60 #include "../ifc/exception/vexception.h"
61 #include "../vgeometry/varc.h"
62 #include "../vgeometry/vgobject.h"
63 #include "../vgeometry/vpointf.h"
64 #include "../vmisc/vabstractapplication.h"
65 #include "../vpatterndb/vcontainer.h"
66 #include "../vwidgets/vmaingraphicsscene.h"
67 #include "../../vdrawtool.h"
68 #include "../../../vabstracttool.h"
69 #include "../../../../dialogs/tools/dialogtool.h"
70 #include "../../../../dialogs/tools/dialogpointofintersectionarcs.h"
71 #include "../../../../visualization/visualization.h"
72 #include "../../../../visualization/line/vistoolpointofintersectionarcs.h"
75 #include <QMessageBox>
76 #include <QSharedPointer>
77 #include <QStaticStringData>
78 #include <QStringData>
79 #include <QStringDataPtr>
88 const quint32 &firstArcId,
const quint32 &secondArcId,
90 QGraphicsItem *parent)
92 , firstArcId(firstArcId)
93 , secondArcId(secondArcId)
109 dialogTool->SetPointName(p->name());
120 const quint32
firstArcId = dialogTool->GetFirstArcId();
121 const quint32
secondArcId = dialogTool->GetSecondArcId();
123 const QString pointName = dialogTool->getPointName();
126 if (point !=
nullptr)
135 const quint32 &firstArcId,
140 const Source &typeCreation)
145 const QPointF point =
FindPoint(firstArc.data(), secondArc.data(), pType);
147 if (point == QPointF())
149 const QString msg = tr(
"<b><big>Can't find intersection point %1 of Arcs</big></b><br>"
150 "Using origin point as a place holder until pattern is corrected.")
153 QMessageBox msgBox(
qApp->getMainWindow());
154 msgBox.setWindowTitle(tr(
"Point Intersect Arcs"));
155 msgBox.setWindowFlags(msgBox.windowFlags() & ~Qt::WindowContextHelpButtonHint);
156 msgBox.setWindowIcon(QIcon(
":/toolicon/32x32/point_of_intersection_arcs.png"));
157 msgBox.setIcon(QMessageBox::Warning);
159 msgBox.setStandardButtons(QMessageBox::Ok);
182 scene->addItem(point);
196 const QPointF centerArc1 =
static_cast<QPointF
>(arc1->
GetCenter());
197 const QPointF centerArc2 =
static_cast<QPointF
>(arc2->
GetCenter());
200 QLineF r1Arc1(centerArc1, p1);
201 r1Arc1.setLength(r1Arc1.length()+10);
203 QLineF r1Arc2(centerArc2, p1);
204 r1Arc2.setLength(r1Arc2.length()+10);
206 QLineF r2Arc1(centerArc1, p2);
207 r2Arc1.setLength(r2Arc1.length()+10);
209 QLineF r2Arc2(centerArc2, p2);
210 r2Arc2.setLength(r2Arc2.length()+10);
340 ShowToolVisualization<VisToolPointOfIntersectionArcs>(show);
358 ContextMenu<DialogPointOfIntersectionArcs>(event,
id);
401 if (not
vis.isNull())
virtual VPointF GetCenter() const
virtual bool IsIntersectLine(const QLineF &line) const
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)
VArc class for anticlockwise arc.
qreal GetRadius() const
GetRadius return formula for radius.
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 ".".
static int IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2)
The VMainGraphicsScene class main scene.
The VPointF class keep data of point.
@ PointOfIntersectionArcs
const QString AttrSecondArc
const QString AttrFirstArc
const QString AttrCrossPoint