35 #include "../ifc/exception/vexception.h"
36 #include "../ifc/xml/vdomdocument.h"
37 #include "../ifc/ifcdef.h"
38 #include "../vgeometry/vgobject.h"
39 #include "../vgeometry/vpointf.h"
40 #include "../vmisc/vabstractapplication.h"
41 #include "../vpatterndb/vcontainer.h"
42 #include "../vpatterndb/vformula.h"
43 #include "../vwidgets/vmaingraphicsscene.h"
44 #include "../../vdrawtool.h"
45 #include "../../../vabstracttool.h"
46 #include "../../../../dialogs/tools/intersect_circles_dialog.h"
47 #include "../../../../dialogs/tools/dialogtool.h"
48 #include "../../../../visualization/visualization.h"
49 #include "../../../../visualization/line/intersect_circles_visual.h"
51 #include <QMessageBox>
52 #include <QSharedPointer>
53 #include <QStaticStringData>
54 #include <QStringData>
55 #include <QStringDataPtr>
65 quint32 firstCircleCenterId,
66 quint32 secondCircleCenterId,
67 const QString &firstCircleRadius,
68 const QString &secondCircleRadius,
70 const Source &typeCreation, QGraphicsItem *parent)
72 , firstCircleCenterId(firstCircleCenterId)
73 , secondCircleCenterId(secondCircleCenterId)
74 , firstCircleRadius(firstCircleRadius)
75 , secondCircleRadius(secondCircleRadius)
76 , crossPoint(crossPoint)
94 dialogTool->SetPointName(p->name());
111 const QString pointName = dialogTool->getPointName();
115 if (point !=
nullptr)
124 quint32 firstCircleCenterId,
125 quint32 secondCircleCenterId,
126 QString &firstCircleRadius,
127 QString &secondCircleRadius,
134 const Source &typeCreation)
142 const QPointF point =
FindPoint(
static_cast<QPointF
>(c1Point),
static_cast<QPointF
>(c2Point), calcC1Radius,
144 if (point == QPointF())
146 const QString msg = tr(
"<b><big>Can't find intersection point %1 of Circles</big></b><br>"
147 "Using origin point as a place holder until pattern is corrected.")
150 QMessageBox msgBox(
qApp->getMainWindow());
151 msgBox.setWindowTitle(tr(
"Point Intersect Circles"));
152 msgBox.setWindowFlags(msgBox.windowFlags() & ~Qt::WindowContextHelpButtonHint);
153 msgBox.setWindowIcon(QIcon(
":/toolicon/32x32/point_of_intersection_circles.png"));
154 msgBox.setIcon(QMessageBox::Warning);
156 msgBox.setStandardButtons(QMessageBox::Ok);
186 scene->addItem(point);
284 if (value.
error() ==
false)
308 if (value.
error() ==
false)
337 ShowToolVisualization<IntersectCirclesVisual>(show);
355 ContextMenu<IntersectCirclesDialog>(event,
id);
377 QString().setNum(
static_cast<int>(dialogTool->GetCrossCirclesPoint())));
406 if (not
vis.isNull())
void setC1Radius(const QString &value)
virtual void RefreshGeometry() Q_DECL_OVERRIDE
void setObject2Id(const quint32 &value)
void setCrossPoint(const CrossCirclesPoint &value)
void setC2Radius(const QString &value)
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 QString GetParametrString(const QDomElement &domElement, const QString &name, const QString &defValue=QString())
Returns the string value of the given attribute. RENAME: see above.
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)
quint32 getIdTool() const
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.
@ PointOfIntersectionCircles
const QString AttrC1Radius
const QString AttrC2Radius
const QString AttrC1Center
const QString AttrCrossPoint
const QString AttrC2Center