56 #include <QSharedPointer>
57 #include <QStaticStringData>
58 #include <QStringData>
59 #include <QStringDataPtr>
62 #include "../../../../../dialogs/tools/dialogalongline.h"
63 #include "../../../../../dialogs/tools/dialogtool.h"
64 #include "../../../../../visualization/visualization.h"
65 #include "../../../../../visualization/line/vistoolalongline.h"
66 #include "../ifc/exception/vexception.h"
67 #include "../ifc/ifcdef.h"
68 #include "../vgeometry/vgobject.h"
69 #include "../vgeometry/vpointf.h"
70 #include "../vmisc/vabstractapplication.h"
71 #include "../vmisc/vcommonsettings.h"
72 #include "../vpatterndb/vcontainer.h"
73 #include "../vpatterndb/vtranslatevars.h"
74 #include "../vpatterndb/variables/vlinelength.h"
75 #include "../vwidgets/vmaingraphicsscene.h"
76 #include "../../../../vabstracttool.h"
77 #include "../../../vdrawtool.h"
98 const quint32 &firstPointId,
const quint32 &secondPointId,
99 const QString &lineType,
const QString &lineWeight,
const QString &lineColor,
100 const Source &typeCreation, QGraphicsItem *parent)
101 :
VToolLinePoint(doc, data, id, lineType, lineWeight, lineColor, formula, firstPointId, 0, parent), secondPointId(secondPointId)
117 ContextMenu<DialogAlongLine>(event,
id);
180 if (not
vis.isNull())
200 const QLineF curLine(
static_cast<QPointF
>(*basePoint),
static_cast<QPointF
>(*current));
201 const QLineF curToSecond(
static_cast<QPointF
>(*current),
static_cast<QPointF
>(*secondPoint));
203 const QString toolTip = QString(
"<table>"
204 "<tr> <td><b> %9:</b> %10</td> </tr>"
205 "<tr> <td><b>%1:</b> %2 %3</td> </tr>"
206 "<tr> <td><b> %4:</b> %5°</td> </tr>"
207 "<tr> <td><b>%6:</b> %2 %3</td> </tr>"
208 "<tr> <td><b>%7:</b> %8 %3</td> </tr>"
211 .arg(
qApp->fromPixel(curLine.length()))
214 .arg(curLine.angle())
215 .arg(QString(
"%1->%2").arg(basePoint->name(), current->name()))
216 .arg(QString(
"%1->%2").arg(current->name(), secondPoint->name()))
217 .arg(
qApp->fromPixel(curToSecond.length()))
219 .arg(current->name());
245 ShowToolVisualization<VisToolAlongLine>(show);
264 dialogTool->SetPointName(p->name());
281 QString formula = dialogTool->GetFormula();
282 const quint32 firstPointId = dialogTool->GetFirstPointId();
283 const quint32
secondPointId = dialogTool->GetSecondPointId();
284 const QString lineType = dialogTool->getLineType();
285 const QString lineWeight = dialogTool->getLineWeight();
286 const QString
lineColor = dialogTool->getLineColor();
287 const QString pointName = dialogTool->getPointName();
290 if (point !=
nullptr)
317 const QString &lineWeight,
318 const QString &lineColor, QString &formula,
const quint32 &firstPointId,
319 quint32 secondPointId, qreal mx, qreal my,
bool showPointName,
325 QLineF line = QLineF(
static_cast<QPointF
>(*firstPoint),
static_cast<QPointF
>(*secondPoint));
362 scene->addItem(point);
The DialogAlongLine class dialog for ToolAlongLine. 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.
virtual void DecrementReferens(quint32 id) const =0
static void InitToolConnections(VMainGraphicsScene *scene, T *tool)
The VContainer class container of all variables.
void AddVariable(const QString &name, T *var)
void RemoveVariable(const QString &name)
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.
const Unit * GetPatternUnit() const
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 ".".
void SetName(const QString &name)
The VMainGraphicsScene class main scene.
The VPointF class keep data of point.
void setShowPointName(bool show)
QColor m_pointColor
pointL line that we see if Text is moved too away from point.
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 AttrLineType
const QString AttrSecondPoint
const QString LineTypeSolidLine
const QString AttrFirstPoint
const QString AttrLineWeight
const QString currentLength
const QString AttrLineColor
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.