55 #include <QSharedPointer>
56 #include <QStaticStringData>
57 #include <QStringData>
58 #include <QStringDataPtr>
61 #include "../../../../../dialogs/tools/dialognormal.h"
62 #include "../../../../../dialogs/tools/dialogtool.h"
63 #include "../../../../../visualization/visualization.h"
64 #include "../../../../../visualization/line/vistoolnormal.h"
65 #include "../ifc/exception/vexception.h"
66 #include "../ifc/ifcdef.h"
67 #include "../vgeometry/vgobject.h"
68 #include "../vgeometry/vpointf.h"
69 #include "../vmisc/vabstractapplication.h"
70 #include "../vmisc/vcommonsettings.h"
71 #include "../vpatterndb/vcontainer.h"
72 #include "../vpatterndb/vtranslatevars.h"
73 #include "../vwidgets/vmaingraphicsscene.h"
74 #include "../../../../vabstracttool.h"
75 #include "../../../vdrawtool.h"
99 const QString &lineWeight,
const QString &lineColor,
const QString &formula,
101 const quint32 &firstPointId,
const quint32 &secondPointId,
const Source &typeCreation,
102 QGraphicsItem *parent)
103 :
VToolLinePoint(doc, data, id, lineType, lineWeight, lineColor, formula, firstPointId, angle, parent),
104 secondPointId(secondPointId)
124 dialogTool->SetAngle(
angle);
127 dialogTool->SetPointName(p->name());
144 QString formula = dialogTool->GetFormula();
145 const quint32 firstPointId = dialogTool->GetFirstPointId();
146 const quint32
secondPointId = dialogTool->GetSecondPointId();
147 const QString lineType = dialogTool->getLineType();
148 const QString lineWeight = dialogTool->getLineWeight();
149 const QString
lineColor = dialogTool->getLineColor();
150 const QString pointName = dialogTool->getPointName();
151 const qreal
angle = dialogTool->GetAngle();
154 if (point !=
nullptr)
183 quint32 secondPointId,
const QString &lineType,
const QString &lineWeight,
184 const QString &lineColor,
185 const QString &pointName, qreal angle, qreal mx, qreal my,
bool showPointName,
188 const Source &typeCreation)
195 QPointF fPoint =
VToolNormal::FindPoint(
static_cast<QPointF
>(*firstPoint),
static_cast<QPointF
>(*secondPoint),
221 scene->addItem(point);
243 QLineF line(firstPoint, secondPoint);
244 QLineF normal = line.normalVector();
245 normal.setAngle(normal.angle()+
angle);
246 normal.setLength(length);
265 ContextMenu<DialogNormal>(event,
id);
331 if (not
vis.isNull())
367 ShowToolVisualization<VisToolNormal>(show);
The DialogNormal class dialog for ToolNormal. 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 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?
static qreal GetParametrDouble(const QDomElement &domElement, const QString &name, const QString &defValue)
Returns the double value of the given attribute.
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
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)
const QString AttrLineType
const QString AttrSecondPoint
const QString LineTypeSolidLine
const QString AttrFirstPoint
const QString AttrLineWeight
const QString AttrLineColor
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.