54 #include <QSharedPointer>
55 #include <QStaticStringData>
56 #include <QStringData>
57 #include <QStringDataPtr>
60 #include "../../../../../dialogs/tools/dialogheight.h"
61 #include "../../../../../dialogs/tools/dialogtool.h"
62 #include "../../../../../visualization/visualization.h"
63 #include "../../../../../visualization/line/vistoolheight.h"
64 #include "../ifc/exception/vexception.h"
65 #include "../ifc/ifcdef.h"
66 #include "../vgeometry/vgobject.h"
67 #include "../vgeometry/vpointf.h"
68 #include "../vpatterndb/vcontainer.h"
69 #include "../vwidgets/vmaingraphicsscene.h"
70 #include "../../../../vabstracttool.h"
71 #include "../../../vdrawtool.h"
94 const QString &lineWeight,
const QString &lineColor,
const quint32 &basePointId,
95 const quint32 &p1LineId,
const quint32 &p2LineId,
96 const Source &typeCreation, QGraphicsItem * parent)
97 :
VToolLinePoint(doc, data, id, lineType, lineWeight, lineColor, QString()
98 , basePointId, 0, parent)
121 dialogTool->SetPointName(p->name());
139 const QString pointName = dialogTool->getPointName();
140 const QString lineType = dialogTool->getLineType();
141 const QString lineWeight = dialogTool->getLineWeight();
142 const QString
lineColor = dialogTool->getLineColor();
143 const quint32
basePointId = dialogTool->GetBasePointId();
144 const quint32
p1LineId = dialogTool->GetP1LineId();
145 const quint32
p2LineId = dialogTool->GetP2LineId();
147 VToolHeight *point =
Create(0, pointName, lineType, lineWeight,
lineColor,
basePointId,
p1LineId,
p2LineId, 5, 10,
true,
149 if (point !=
nullptr)
178 const QString &lineWeight,
const QString &lineColor, quint32 basePointId,
179 quint32 p1LineId, quint32 p2LineId,
182 const Source &typeCreation)
188 QPointF pHeight =
FindPoint(QLineF(
static_cast<QPointF
>(*p1Line),
static_cast<QPointF
>(*p2Line)),
189 static_cast<QPointF
>(*basePoint));
218 scene->addItem(point);
262 ContextMenu<DialogHeight>(event,
id);
314 if (not
vis.isNull())
336 const QLineF curLine(
static_cast<QPointF
>(*basePoint),
static_cast<QPointF
>(*current));
337 const QLineF p1ToCur(
static_cast<QPointF
>(*p1Line),
static_cast<QPointF
>(*current));
338 const QLineF p2ToCur(
static_cast<QPointF
>(*p2Line),
static_cast<QPointF
>(*current));
340 const QString toolTip = QString(
"<table>"
341 "<tr> <td><b> %10:</b> %11</td> </tr>"
342 "<tr> <td><b>%1:</b> %2 %3</td> </tr>"
343 "<tr> <td><b> %4:</b> %5°</td> </tr>"
344 "<tr> <td><b>%6:</b> %7 %3</td> </tr>"
345 "<tr> <td><b>%8:</b> %9 %3</td> </tr>"
348 .arg(
qApp->fromPixel(curLine.length()))
351 .arg(curLine.angle())
352 .arg(QString(
"%1->%2").arg(p1Line->name(), current->name()))
353 .arg(
qApp->fromPixel(p1ToCur.length()))
354 .arg(QString(
"%1->%2").arg(p2Line->name(), current->name()))
355 .arg(
qApp->fromPixel(p2ToCur.length()))
357 .arg(current->name());
383 ShowToolVisualization<VisToolHeight>(show);
The DialogHeight class dialog for ToolHeight. 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.
static void InitToolConnections(VMainGraphicsScene *scene, T *tool)
The VContainer class container of all variables.
void AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
AddLine add line to container.
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 QPointF ClosestPoint(const QLineF &line, const QPointF &point)
ClosestPoint find point projection of point onto line.
The VMainGraphicsScene class main scene.
The VPointF class keep data of point.
void setShowPointName(bool show)
void setLineWeight(const QString &value)
void setObject1Id(const quint32 &value)
void setLineStyle(const Qt::PenStyle &value)
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
const QString AttrBasePoint
const QString AttrLineType
const QString LineTypeSolidLine
const QString AttrLineWeight
const QString AttrLineColor
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.