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/dialogpointfromarcandtangent.h"
71 #include "../../../../visualization/visualization.h"
72 #include "../../../../visualization/line/vistoolpointfromarcandtangent.h"
75 #include <QMessageBox>
76 #include <QSharedPointer>
77 #include <QStaticStringData>
78 #include <QStringData>
79 #include <QStringDataPtr>
88 quint32 arcId, quint32 tangentPointId,
90 QGraphicsItem *parent)
93 , tangentPointId(tangentPointId)
94 , crossPoint(crossPoint)
106 dialogTool->SetArcId(
arcId);
109 dialogTool->SetPointName(p->name());
120 const quint32
arcId = dialogTool->GetArcId();
123 const QString pointName = dialogTool->getPointName();
124 VToolPointFromArcAndTangent *point =
Create(0, pointName,
arcId,
tangentPointId, pType, 5, 10,
true, scene,
doc,
126 if (point !=
nullptr)
135 const QString &pointName,
137 quint32 tangentPointId,
145 const Source &typeCreation)
152 if (point == QPointF())
154 const QString msg = tr(
"<b><big>Can't find intersection point %1 of</big></b><br>"
155 "<b><big>%2 and Tangent</big></b><br><br>"
156 "Using origin point as a place holder until pattern is corrected.")
160 QMessageBox msgBox(
qApp->getMainWindow());
161 msgBox.setWindowTitle(tr(
"Intersect Arc and Tangent"));
162 msgBox.setWindowFlags(msgBox.windowFlags() & ~Qt::WindowContextHelpButtonHint);
163 msgBox.setWindowIcon(QIcon(
":/toolicon/32x32/point_from_arc_and_tangent.png"));
164 msgBox.setIcon(QMessageBox::Warning);
166 msgBox.setStandardButtons(QMessageBox::Ok);
194 scene->addItem(point);
208 const QPointF center =
static_cast<QPointF
>(arc->
GetCenter());
212 QLineF r1Arc(center, p1);
213 r1Arc.setLength(radius+10);
215 QLineF r2Arc(center, p2);
216 r2Arc.setLength(radius+10);
346 ShowToolVisualization<VisToolPointFromArcAndTangent>(show);
364 ContextMenu<DialogPointFromArcAndTangent>(event,
id);
383 QString().setNum(
static_cast<int>(dialogTool->GetCrossCirclesPoint())));
408 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 ".".
virtual QString name() const
name return name graphical object.
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)
const QString AttrCrossPoint
const QString AttrTangent