55 #include <QSharedPointer>
56 #include <QStaticStringData>
57 #include <QStringData>
58 #include <QStringDataPtr>
61 #include "../../../../../dialogs/tools/dialogbisector.h"
62 #include "../../../../../dialogs/tools/dialogtool.h"
63 #include "../../../../../visualization/visualization.h"
64 #include "../../../../../visualization/line/vistoolbisector.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 &lineType,
const QString &lineWeight,
100 const QString &lineColor,
const QString &formula,
const quint32 &firstPointId,
101 const quint32 &secondPointId,
const quint32 &thirdPointId,
const Source &typeCreation,
102 QGraphicsItem *parent)
103 :
VToolLinePoint(doc, data, id, lineType, lineWeight, lineColor, formula, secondPointId, 0, parent)
104 , firstPointId(firstPointId)
105 , thirdPointId(thirdPointId)
113 QLineF line1(secondPoint, firstPoint);
114 QLineF line2(secondPoint, thirdPoint);
115 qreal
angle = line1.angleTo(line2);
119 return line1.angle()-
angle/2;
123 return line1.angle()+
angle/2;
137 const QPointF &thirdPoint,
const qreal &length)
139 QLineF line1(secondPoint, firstPoint);
140 line1.setAngle(
BisectorAngle(firstPoint, secondPoint, thirdPoint));
141 line1.setLength(length);
162 dialogTool->SetPointName(p->name());
179 QString formula = dialogTool->GetFormula();
180 const quint32
firstPointId = dialogTool->GetFirstPointId();
181 const quint32 secondPointId = dialogTool->GetSecondPointId();
182 const quint32
thirdPointId = dialogTool->GetThirdPointId();
183 const QString lineType = dialogTool->getLineType();
184 const QString lineWeight = dialogTool->getLineWeight();
185 const QString
lineColor = dialogTool->getLineColor();
186 const QString pointName = dialogTool->getPointName();
189 if (point !=
nullptr)
218 quint32 thirdPointId,
const QString &lineType,
219 const QString &lineWeight,
const QString &lineColor,
220 const QString &pointName, qreal mx, qreal my,
bool showPointName,
231 static_cast<QPointF
>(*thirdPoint),
qApp->toPixel(result));
256 scene->addItem(point);
288 ContextMenu<DialogBisector>(event,
id);
357 if (not
vis.isNull())
393 ShowToolVisualization<VisToolBisector>(show);
The DialogBisector class dialog for ToolBisector. 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?
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 AttrThirdPoint
const QString AttrLineColor
Qt::PenStyle lineTypeToPenStyle(const QString &lineType)
LineStyle return pen style for current line style.