35 #include "../ifc/ifcdef.h"
36 #include "../ifc/exception/vexception.h"
37 #include "../ifc/xml/vdomdocument.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_circletangent_dialog.h"
47 #include "../../../../dialogs/tools/dialogtool.h"
48 #include "../../../../visualization/visualization.h"
49 #include "../../../../visualization/line/intersect_circletangent_visual.h"
51 #include <QMessageBox>
52 #include <QSharedPointer>
53 #include <QStaticStringData>
54 #include <QStringData>
55 #include <QStringDataPtr>
65 quint32 circleCenterId,
const QString &circleRadius,
67 const Source &typeCreation, QGraphicsItem *parent)
69 , circleCenterId(circleCenterId)
70 , tangentPointId(tangentPointId)
71 , circleRadius(circleRadius)
72 , crossPoint(crossPoint)
88 dialogTool->SetPointName(p->name());
103 const QString pointName = dialogTool->getPointName();
106 if (point !=
nullptr)
115 quint32 circleCenterId, QString &circleRadius,
116 quint32 tangentPointId,
123 const Source &typeCreation)
130 static_cast<QPointF
>(cPoint), radius,
crossPoint);
132 if (point == QPointF())
134 const QString msg = tr(
"<b><big>Can't find intersection point %1 of</big></b><br>"
135 "<b><big>Circle and Tangent</big></b><br><br>"
136 "Using origin point as a place holder until pattern is corrected.")
139 QMessageBox msgBox(
qApp->getMainWindow());
140 msgBox.setWindowTitle(tr(
"Intersect Circle and Tangent"));
141 msgBox.setWindowFlags(msgBox.windowFlags() & ~Qt::WindowContextHelpButtonHint);
142 msgBox.setWindowIcon(QIcon(
":/toolicon/32x32/point_from_circle_and_tangent.png"));
143 msgBox.setIcon(QMessageBox::Warning);
145 msgBox.setStandardButtons(QMessageBox::Ok);
173 scene->addItem(point);
271 if (value.
error() ==
false)
300 ShowToolVisualization<IntersectCircleTangentVisual>(show);
318 ContextMenu<IntersectCircleTangentDialog>(event,
id);
338 QString().setNum(
static_cast<int>(dialogTool->GetCrossCirclesPoint())));
365 if (not
vis.isNull())
virtual void RefreshGeometry() Q_DECL_OVERRIDE
void setCRadius(const QString &value)
void setCrossPoint(const CrossCirclesPoint &value)
void setObject2Id(const quint32 &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 ContactPoints(const QPointF &p, const QPointF ¢er, qreal radius, 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.
@ PointFromCircleAndTangent
const QString AttrCrossPoint
const QString AttrTangent
const QString AttrCRadius
const QString AttrCCenter