Rename VToolPoint.
--HG-- branch : feature
This commit is contained in:
parent
a99c3ce54a
commit
0097d67865
|
@ -32,9 +32,9 @@
|
|||
#include "../../libs/vgeometry/vsplinepath.h"
|
||||
#include "../../libs/vgeometry/vpointf.h"
|
||||
#include "../../libs/vtools/tools/vabstracttool.h"
|
||||
#include "../../libs/vtools/tools/drawTools/vtoolcutspline.h"
|
||||
#include "../../libs/vtools/tools/drawTools/vtoolcutsplinepath.h"
|
||||
#include "../../libs/vtools/tools/drawTools/vtoolcutarc.h"
|
||||
#include "../../libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h"
|
||||
#include "../../libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h"
|
||||
#include "../../libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
|
||||
#include "../xml/vpattern.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -178,7 +178,7 @@ void MainWindow::AddPP(const QString &PPName, const QString &path)
|
|||
sceneDraw->addItem(spoint);
|
||||
ui->view->itemClicked(spoint);
|
||||
|
||||
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(spoint, &VToolSinglePoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(sceneDraw, &VMainGraphicsScene::DisableItem, spoint, &VToolBasePoint::Disable);
|
||||
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolBasePoint::SetFactor);
|
||||
connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolBasePoint::EnableToolMove);
|
||||
|
|
|
@ -293,7 +293,7 @@ quint32 VPattern::SPointActiveDraw()
|
|||
const QDomElement domElement = domNode.toElement();
|
||||
if (domElement.isNull() == false)
|
||||
{
|
||||
if (domElement.tagName() == VToolPoint::TagName &&
|
||||
if (domElement.tagName() == VToolSinglePoint::TagName &&
|
||||
domElement.attribute(AttrType, "") == VToolBasePoint::ToolType)
|
||||
{
|
||||
return GetParametrId(domElement);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
VToolCut::VToolCut(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &curveCutId, const quint32 &curve1id, const quint32 &curve2id, const QString &color,
|
||||
QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), firstCurve(nullptr), secondCurve(nullptr),
|
||||
:VToolSinglePoint(doc, data, id, parent), formula(formula), firstCurve(nullptr), secondCurve(nullptr),
|
||||
curveCutId(curveCutId), curve1id(curve1id), curve2id(curve2id), detailsMode(false)
|
||||
{
|
||||
Q_ASSERT_X(curveCutId > 0, Q_FUNC_INFO, "curveCutId <= 0");
|
||||
|
@ -72,7 +72,7 @@ void VToolCut::HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirecti
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCut::Disable(bool disable, const QString &namePP)
|
||||
{
|
||||
VToolPoint::Disable(disable, namePP);
|
||||
VToolSinglePoint::Disable(disable, namePP);
|
||||
firstCurve->ChangedActivDraw(enabled);
|
||||
secondCurve->ChangedActivDraw(enabled);
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ void VToolCut::RefreshGeometry()
|
|||
{
|
||||
RefreshCurve(firstCurve, curve1id, SimpleCurvePoint::ForthPoint);
|
||||
RefreshCurve(secondCurve, curve2id, SimpleCurvePoint::FirstPoint);
|
||||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -172,7 +172,7 @@ void VToolCut::FullUpdateCurveFromFile(const QString &attrCurve)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCut::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrColor, lineColor);
|
||||
}
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#ifndef VTOOLCUT_H
|
||||
#define VTOOLCUT_H
|
||||
|
||||
#include "../vtoolpoint.h"
|
||||
#include "../vtoolsinglepoint.h"
|
||||
#include "../vwidgets/vsimplecurve.h"
|
||||
#include "../../../toolcurve/vabstractspline.h"
|
||||
|
||||
class VFormula;
|
||||
|
||||
class VToolCut : public VToolPoint
|
||||
class VToolCut : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -165,7 +165,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS
|
|||
{
|
||||
VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, color, typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutArc::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutArc::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolCutArc::EnableToolMove);
|
||||
|
|
|
@ -173,7 +173,7 @@ VToolCutSpline* VToolCutSpline::Create(const quint32 _id, const QString &pointNa
|
|||
VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, color,
|
||||
typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSpline::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSpline::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolCutSpline::EnableToolMove);
|
||||
|
|
|
@ -217,7 +217,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
|
|||
VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, splPath1id,
|
||||
splPath2id, color, typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCutSplinePath::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCutSplinePath::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolCutSplinePath::EnableToolMove);
|
||||
|
|
|
@ -201,7 +201,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const
|
|||
VToolBisector *point = new VToolBisector(doc, data, id, typeLine, lineColor, formula, firstPointId,
|
||||
secondPointId, thirdPointId, typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolBisector::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolBisector::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolBisector::EnableToolMove);
|
||||
|
|
|
@ -129,7 +129,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const quint32 _id, cons
|
|||
VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(doc, data, id, typeLine, lineColor, formulaAngle,
|
||||
basePointId, curveId, typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolCurveIntersectAxis::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolCurveIntersectAxis::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolCurveIntersectAxis::EnableToolMove);
|
||||
|
|
|
@ -166,7 +166,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName,
|
|||
VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, lineColor, formulaLength, formulaAngle,
|
||||
basePointId, typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolEndLine::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolEndLine::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolEndLine::EnableToolMove);
|
||||
|
|
|
@ -158,7 +158,7 @@ VToolHeight* VToolHeight::Create(const quint32 _id, const QString &pointName, co
|
|||
VToolHeight *point = new VToolHeight(doc, data, id, typeLine, lineColor, basePointId, p1LineId, p2LineId,
|
||||
typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolHeight::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolHeight::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolHeight::EnableToolMove);
|
||||
|
|
|
@ -140,7 +140,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const quint32 _id, const
|
|||
basePointId, firstPointId, secondPointId,
|
||||
typeCreation);
|
||||
scene->addItem(point);
|
||||
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(point, &VToolSinglePoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(scene, &VMainGraphicsScene::NewFactor, point, &VToolLineIntersectAxis::SetFactor);
|
||||
connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolLineIntersectAxis::Disable);
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolLineIntersectAxis::EnableToolMove);
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &lineColor, const QString &formula, const quint32 &basePointId,
|
||||
const qreal &angle, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId),
|
||||
:VToolSinglePoint(doc, data, id, parent), formulaLength(formula), angle(angle), basePointId(basePointId),
|
||||
mainLine(nullptr)
|
||||
{
|
||||
this->typeLine = typeLine;
|
||||
|
@ -74,7 +74,7 @@ void VToolLinePoint::RefreshGeometry()
|
|||
mainLine->setPen(QPen(CorrectColor(QColor(lineColor)),
|
||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||
LineStyleToPenStyle(typeLine)));
|
||||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||
QPointF point = VDrawTool::data.GeometricObject<VPointF>(id)->toQPointF();
|
||||
QPointF basePoint = VDrawTool::data.GeometricObject<VPointF>(basePointId)->toQPointF();
|
||||
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
||||
|
@ -92,7 +92,7 @@ void VToolLinePoint::RemoveReferens()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLinePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrTypeLine, typeLine);
|
||||
doc->SetAttribute(tag, AttrLineColor, lineColor);
|
||||
|
@ -112,7 +112,7 @@ void VToolLinePoint::SetFactor(qreal factor)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLinePoint::Disable(bool disable, const QString &namePP)
|
||||
{
|
||||
VToolPoint::Disable(disable, namePP);
|
||||
VToolSinglePoint::Disable(disable, namePP);
|
||||
mainLine->setPen(QPen(CorrectColor(lineColor),
|
||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||
LineStyleToPenStyle(typeLine)));
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#ifndef VTOOLLINEPOINT_H
|
||||
#define VTOOLLINEPOINT_H
|
||||
|
||||
#include "../vtoolpoint.h"
|
||||
#include "../vtoolsinglepoint.h"
|
||||
#include "../vpatterndb/vformula.h"
|
||||
|
||||
/**
|
||||
* @brief The VToolLinePoint class parent for all tools what create point with line.
|
||||
*/
|
||||
class VToolLinePoint : public VToolPoint
|
||||
class VToolLinePoint : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -49,7 +49,7 @@ const QString VToolBasePoint::ToolType = QStringLiteral("single");
|
|||
*/
|
||||
VToolBasePoint::VToolBasePoint (VAbstractPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
const QString &namePP, const QString &mPath, QGraphicsItem * parent )
|
||||
:VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath)
|
||||
:VToolSinglePoint(doc, data, id, parent), namePP(namePP), mPath(mPath)
|
||||
{
|
||||
baseColor = Qt::red;
|
||||
this->setPen(QPen(baseColor, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||
|
@ -202,7 +202,7 @@ void VToolBasePoint::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBasePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
VToolPoint::hoverEnterEvent(event);
|
||||
VToolSinglePoint::hoverEnterEvent(event);
|
||||
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ void VToolBasePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBasePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
VToolPoint::hoverLeaveEvent(event);
|
||||
VToolSinglePoint::hoverLeaveEvent(event);
|
||||
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
|
@ -232,7 +232,7 @@ void VToolBasePoint::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
SetOverrideCursor(cursorArrowCloseHand, 1, 1);
|
||||
}
|
||||
}
|
||||
VToolPoint::mousePressEvent(event);
|
||||
VToolSinglePoint::mousePressEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -246,7 +246,7 @@ void VToolBasePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
RestoreOverrideCursor(cursorArrowCloseHand);
|
||||
}
|
||||
}
|
||||
VToolPoint::mouseReleaseEvent(event);
|
||||
VToolSinglePoint::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -263,7 +263,7 @@ void VToolBasePoint::SetColorLabel(const Qt::GlobalColor &color)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBasePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
QSharedPointer<VPointF> point = qSharedPointerDynamicCast<VPointF>(obj);
|
||||
SCASSERT(point.isNull() == false);
|
||||
|
@ -329,5 +329,5 @@ void VToolBasePoint::SetFactor(qreal factor)
|
|||
void VToolBasePoint::EnableToolMove(bool move)
|
||||
{
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, move);
|
||||
VToolPoint::EnableToolMove(move);
|
||||
VToolSinglePoint::EnableToolMove(move);
|
||||
}
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#ifndef VTOOLBASEPOINT_H
|
||||
#define VTOOLBASEPOINT_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
/**
|
||||
* @brief The VToolBasePoint class tool for creation pattern base point. Obly base point can move. All object
|
||||
* pattern peace depend on base point.
|
||||
*/
|
||||
class VToolBasePoint : public VToolPoint
|
||||
class VToolBasePoint : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -50,7 +50,7 @@ VToolLineIntersect::VToolLineIntersect(VAbstractPattern *doc, VContainer *data,
|
|||
const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2,
|
||||
const quint32 &p2Line2, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2),
|
||||
:VToolSinglePoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2),
|
||||
p2Line2(p2Line2)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
|
@ -232,7 +232,7 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrP1Line1, p1Line1);
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
#ifndef VTOOLLINEINTERSECT_H
|
||||
#define VTOOLLINEINTERSECT_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
/**
|
||||
* @brief The VToolLineIntersect class help find point intersection lines.
|
||||
*/
|
||||
class VToolLineIntersect:public VToolPoint
|
||||
class VToolLineIntersect:public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -39,7 +39,7 @@ VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(VAbstractPattern *doc,
|
|||
quint32 arcId, quint32 tangentPointId,
|
||||
CrossCirclesPoint crossPoint, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), arcId(arcId), tangentPointId(tangentPointId), crossPoint(crossPoint)
|
||||
:VToolSinglePoint(doc, data, id, parent), arcId(arcId), tangentPointId(tangentPointId), crossPoint(crossPoint)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointFromArcAndTangent::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrArc, arcId);
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
#ifndef VTOOLPOINTFROMARCANDTANGENT_H
|
||||
#define VTOOLPOINTFROMARCANDTANGENT_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
class VToolPointFromArcAndTangent : public VToolPoint
|
||||
class VToolPointFromArcAndTangent : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -41,7 +41,7 @@ VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(VAbstractPattern
|
|||
quint32 circleCenterId, const QString &circleRadius,
|
||||
quint32 tangentPointId, CrossCirclesPoint crossPoint,
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), circleCenterId(circleCenterId), tangentPointId(tangentPointId),
|
||||
:VToolSinglePoint(doc, data, id, parent), circleCenterId(circleCenterId), tangentPointId(tangentPointId),
|
||||
circleRadius(circleRadius), crossPoint(crossPoint)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
|
@ -272,7 +272,7 @@ void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointFromCircleAndTangent::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrCCenter, circleCenterId);
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#ifndef VTOOLPOINTFROMCIRCLEANDTANGENT_H
|
||||
#define VTOOLPOINTFROMCIRCLEANDTANGENT_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
class VFormula;
|
||||
|
||||
class VToolPointFromCircleAndTangent : public VToolPoint
|
||||
class VToolPointFromCircleAndTangent : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -54,7 +54,7 @@ VToolPointOfContact::VToolPointOfContact(VAbstractPattern *doc, VContainer *data
|
|||
const QString &radius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
: VToolPoint(doc, data, id, parent), arcRadius(radius), center(center), firstPointId(firstPointId),
|
||||
: VToolSinglePoint(doc, data, id, parent), arcRadius(radius), center(center), firstPointId(firstPointId),
|
||||
secondPointId(secondPointId)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
|
@ -285,7 +285,7 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrRadius, arcRadius);
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
#ifndef VTOOLPOINTOFCONTACT_H
|
||||
#define VTOOLPOINTOFCONTACT_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
class VFormula;
|
||||
|
||||
/**
|
||||
* @brief The VToolPointOfContact class tool for creation point intersection line and arc.
|
||||
*/
|
||||
class VToolPointOfContact : public VToolPoint
|
||||
class VToolPointOfContact : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -47,7 +47,7 @@ const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfInters
|
|||
VToolPointOfIntersection::VToolPointOfIntersection(VAbstractPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId)
|
||||
:VToolSinglePoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrFirstPoint, firstPointId);
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
#ifndef VTOOLPOINTOFINTERSECTION_H
|
||||
#define VTOOLPOINTOFINTERSECTION_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
/**
|
||||
* @brief The VToolPointOfIntersection class tool for creation point intersection two lines.
|
||||
*/
|
||||
class VToolPointOfIntersection : public VToolPoint
|
||||
class VToolPointOfIntersection : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -39,7 +39,7 @@ VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(VAbstractPattern *doc
|
|||
const quint32 &firstArcId, const quint32 &secondArcId,
|
||||
CrossCirclesPoint pType, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), firstArcId(firstArcId), secondArcId(secondArcId), crossPoint(pType)
|
||||
:VToolSinglePoint(doc, data, id, parent), firstArcId(firstArcId), secondArcId(secondArcId), crossPoint(pType)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersectionArcs::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrFirstArc, firstArcId);
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#ifndef VTOOLPOINTOFINTERSECTIONARCS_H
|
||||
#define VTOOLPOINTOFINTERSECTIONARCS_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
class VArc;
|
||||
|
||||
class VToolPointOfIntersectionArcs : public VToolPoint
|
||||
class VToolPointOfIntersectionArcs : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(VAbstractPatter
|
|||
const QString &secondCircleRadius,
|
||||
CrossCirclesPoint crossPoint,
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), firstCircleCenterId(firstCircleCenterId),
|
||||
:VToolSinglePoint(doc, data, id, parent), firstCircleCenterId(firstCircleCenterId),
|
||||
secondCircleCenterId(secondCircleCenterId), firstCircleRadius(firstCircleRadius),
|
||||
secondCircleRadius(secondCircleRadius), crossPoint(crossPoint)
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersectionCircles::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrC1Center, firstCircleCenterId);
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#ifndef VTOOLPOINTOFINTERSECTIONCIRCLES_H
|
||||
#define VTOOLPOINTOFINTERSECTIONCIRCLES_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
class VFormula;
|
||||
|
||||
class VToolPointOfIntersectionCircles : public VToolPoint
|
||||
class VToolPointOfIntersectionCircles : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vtoolpoint.cpp
|
||||
** @file vtoolsinglepoint.cpp
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
|
@ -26,7 +26,7 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
#include "../vmisc/logging.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../vwidgets/vgraphicssimpletextitem.h"
|
||||
|
@ -34,29 +34,29 @@
|
|||
|
||||
#include <QKeyEvent>
|
||||
|
||||
Q_LOGGING_CATEGORY(vToolPoint, "v.toolPoint")
|
||||
Q_LOGGING_CATEGORY(vToolSinglePoint, "v.toolSinglePoint")
|
||||
|
||||
const QString VToolPoint::TagName = QStringLiteral("point");
|
||||
const QString VToolSinglePoint::TagName = QStringLiteral("point");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief VToolPoint constructor.
|
||||
* @brief VToolSinglePoint constructor.
|
||||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
* @param id object id in container.
|
||||
* @param parent parent object.
|
||||
*/
|
||||
VToolPoint::VToolPoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(nullptr),
|
||||
VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
|
||||
:VAbstractPoint(doc, data, id), QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(nullptr),
|
||||
lineName(nullptr)
|
||||
{
|
||||
radius = ToPixel(DefPointRadius/*mm*/, Unit::Mm);
|
||||
namePoint = new VGraphicsSimpleTextItem(this);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::contextMenuEvent);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolPoint::DeleteFromLabel);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::PointChoosed, this, &VToolPoint::PointChoosed);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolSinglePoint::contextMenuEvent);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolSinglePoint::DeleteFromLabel);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::PointChoosed, this, &VToolSinglePoint::PointChoosed);
|
||||
lineName = new QGraphicsLineItem(this);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolSinglePoint::NameChangePosition);
|
||||
this->setBrush(QBrush(Qt::NoBrush));
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||
|
@ -65,11 +65,11 @@ VToolPoint::VToolPoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGra
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPoint::~VToolPoint()
|
||||
VToolSinglePoint::~VToolSinglePoint()
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
void VToolSinglePoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
/* From question on StackOverflow
|
||||
* https://stackoverflow.com/questions/10985028/how-to-remove-border-around-qgraphicsitem-when-selected
|
||||
|
@ -82,7 +82,7 @@ void VToolPoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VToolPoint::name() const
|
||||
QString VToolSinglePoint::name() const
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -90,14 +90,14 @@ QString VToolPoint::name() const
|
|||
}
|
||||
catch (const VExceptionBadId &e)
|
||||
{
|
||||
qCDebug(vToolPoint, "Error! Couldn't get point name. %s %s", e.ErrorMessage().toUtf8().constData(),
|
||||
qCDebug(vToolSinglePoint, "Error! Couldn't get point name. %s %s", e.ErrorMessage().toUtf8().constData(),
|
||||
e.DetailedInformation().toUtf8().constData());
|
||||
return QString("");// Return empty string for property browser
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::setName(const QString &name)
|
||||
void VToolSinglePoint::setName(const QString &name)
|
||||
{
|
||||
// Don't know if need check name here.
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
|
@ -106,9 +106,9 @@ void VToolPoint::setName(const QString &name)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VToolPoint::getTagName() const
|
||||
QString VToolSinglePoint::getTagName() const
|
||||
{
|
||||
return VToolPoint::TagName;
|
||||
return VToolSinglePoint::TagName;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -116,7 +116,7 @@ QString VToolPoint::getTagName() const
|
|||
* @brief NameChangePosition handle change posion point label.
|
||||
* @param pos new position.
|
||||
*/
|
||||
void VToolPoint::NameChangePosition(const QPointF &pos)
|
||||
void VToolSinglePoint::NameChangePosition(const QPointF &pos)
|
||||
{
|
||||
VPointF *point = new VPointF(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
QPointF p = pos - this->pos();
|
||||
|
@ -133,7 +133,7 @@ void VToolPoint::NameChangePosition(const QPointF &pos)
|
|||
* @param mx label bias x axis.
|
||||
* @param my label bias y axis.
|
||||
*/
|
||||
void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
|
||||
void VToolSinglePoint::UpdateNamePosition(qreal mx, qreal my)
|
||||
{
|
||||
MoveLabel *moveLabel = new MoveLabel(doc, mx, my, id, this->scene());
|
||||
connect(moveLabel, &MoveLabel::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
||||
|
@ -146,7 +146,7 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
|
|||
* @param id object id in container.
|
||||
* @param enable enable or disable highlight.
|
||||
*/
|
||||
void VToolPoint::ShowTool(quint32 id, bool enable)
|
||||
void VToolSinglePoint::ShowTool(quint32 id, bool enable)
|
||||
{
|
||||
ShowItem(this, id, enable);
|
||||
}
|
||||
|
@ -156,14 +156,14 @@ void VToolPoint::ShowTool(quint32 id, bool enable)
|
|||
* @brief SetFactor set current scale factor of scene.
|
||||
* @param factor scene scale factor.
|
||||
*/
|
||||
void VToolPoint::SetFactor(qreal factor)
|
||||
void VToolSinglePoint::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::Disable(bool disable, const QString &namePP)
|
||||
void VToolSinglePoint::Disable(bool disable, const QString &namePP)
|
||||
{
|
||||
enabled = !CorrectDisable(disable, namePP);
|
||||
this->setEnabled(enabled);
|
||||
|
@ -171,19 +171,19 @@ void VToolPoint::Disable(bool disable, const QString &namePP)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::DeleteFromLabel()
|
||||
void VToolSinglePoint::DeleteFromLabel()
|
||||
{
|
||||
DeleteTool(); //Leave this method immediately after call!!!
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::EnableToolMove(bool move)
|
||||
void VToolSinglePoint::EnableToolMove(bool move)
|
||||
{
|
||||
namePoint->setFlag(QGraphicsItem::ItemIsMovable, move);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::PointChoosed()
|
||||
void VToolSinglePoint::PointChoosed()
|
||||
{
|
||||
emit ChoosedTool(id, SceneObject::Point);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ void VToolPoint::PointChoosed()
|
|||
/**
|
||||
* @brief FullUpdateFromFile update tool data form file.
|
||||
*/
|
||||
void VToolPoint::FullUpdateFromFile()
|
||||
void VToolSinglePoint::FullUpdateFromFile()
|
||||
{
|
||||
ReadAttributes();
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||
|
@ -204,7 +204,7 @@ void VToolPoint::FullUpdateFromFile()
|
|||
* @brief mouseReleaseEvent handle mouse release events.
|
||||
* @param event mouse release event.
|
||||
*/
|
||||
void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
|
@ -218,7 +218,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
* @brief hoverEnterEvent handle hover enter events.
|
||||
* @param event hover enter event.
|
||||
*/
|
||||
void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
void VToolSinglePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(CorrectColor(baseColor),
|
||||
|
@ -231,7 +231,7 @@ void VToolPoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
|||
* @brief hoverLeaveEvent handle hover leave events.
|
||||
* @param event hover leave event.
|
||||
*/
|
||||
void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(CorrectColor(baseColor),
|
||||
|
@ -244,7 +244,7 @@ void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||
* @brief RefreshPointGeometry refresh point on scene.
|
||||
* @param point point.
|
||||
*/
|
||||
void VToolPoint::RefreshPointGeometry(const VPointF &point)
|
||||
void VToolSinglePoint::RefreshPointGeometry(const VPointF &point)
|
||||
{
|
||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
|
||||
this->setPen(QPen(CorrectColor(baseColor),
|
||||
|
@ -269,7 +269,7 @@ void VToolPoint::RefreshPointGeometry(const VPointF &point)
|
|||
/**
|
||||
* @brief RefreshLine refresh line to label on scene.
|
||||
*/
|
||||
void VToolPoint::RefreshLine()
|
||||
void VToolSinglePoint::RefreshLine()
|
||||
{
|
||||
QRectF nRec = namePoint->sceneBoundingRect();
|
||||
nRec.translate(- scenePos());
|
||||
|
@ -305,7 +305,7 @@ void VToolPoint::RefreshLine()
|
|||
* @param value value.
|
||||
* @return value.
|
||||
*/
|
||||
QVariant VToolPoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == QGraphicsItem::ItemSelectedChange)
|
||||
{
|
||||
|
@ -328,7 +328,7 @@ QVariant VToolPoint::itemChange(QGraphicsItem::GraphicsItemChange change, const
|
|||
* @brief keyReleaseEvent handle key release events.
|
||||
* @param event key release event.
|
||||
*/
|
||||
void VToolPoint::keyReleaseEvent(QKeyEvent *event)
|
||||
void VToolSinglePoint::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
{
|
||||
|
@ -342,13 +342,13 @@ void VToolPoint::keyReleaseEvent(QKeyEvent *event)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
void VToolSinglePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
void VToolSinglePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VDrawTool::SaveOptions(tag, obj);
|
||||
|
||||
|
@ -361,7 +361,7 @@ void VToolPoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::setEnabled(bool enabled)
|
||||
void VToolSinglePoint::setEnabled(bool enabled)
|
||||
{
|
||||
QGraphicsEllipseItem::setEnabled(enabled);
|
||||
if (enabled)
|
|
@ -1,6 +1,6 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vtoolpoint.h
|
||||
** @file vtoolsinglepoint.h
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
|
@ -26,24 +26,24 @@
|
|||
**
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef VTOOLPOINT_H
|
||||
#define VTOOLPOINT_H
|
||||
#ifndef VTOOLSINGLEPOINT_H
|
||||
#define VTOOLSINGLEPOINT_H
|
||||
|
||||
#include "../../vdrawtool.h"
|
||||
#include "../vabstractpoint.h"
|
||||
#include <QGraphicsEllipseItem>
|
||||
|
||||
class VPointF;
|
||||
class VGraphicsSimpleTextItem;
|
||||
|
||||
/**
|
||||
* @brief The VToolPoint class parent for all tools what create points.
|
||||
* @brief The VToolSinglePoint class parent for all tools what create points.
|
||||
*/
|
||||
class VToolPoint: public VDrawTool, public QGraphicsEllipseItem
|
||||
class VToolSinglePoint: public VAbstractPoint, public QGraphicsEllipseItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VToolPoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr);
|
||||
virtual ~VToolPoint();
|
||||
VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quint32 id, QGraphicsItem * parent = nullptr);
|
||||
virtual ~VToolSinglePoint();
|
||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
|
||||
QString name() const;
|
||||
void setName(const QString &name);
|
||||
|
@ -106,7 +106,7 @@ protected:
|
|||
}
|
||||
}
|
||||
private:
|
||||
Q_DISABLE_COPY(VToolPoint)
|
||||
Q_DISABLE_COPY(VToolSinglePoint)
|
||||
};
|
||||
|
||||
#endif // VTOOLPOINT_H
|
||||
#endif // VTOOLSINGLEPOINT_H
|
|
@ -50,7 +50,7 @@ const QString VToolTriangle::ToolType = QStringLiteral("triangle");
|
|||
VToolTriangle::VToolTriangle(VAbstractPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id,
|
||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
|
||||
:VToolSinglePoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
|
||||
secondPointId(secondPointId)
|
||||
{
|
||||
ToolCreation(typeCreation);
|
||||
|
@ -249,7 +249,7 @@ void VToolTriangle::SaveDialog(QDomElement &domElement)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||
{
|
||||
VToolPoint::SaveOptions(tag, obj);
|
||||
VToolSinglePoint::SaveOptions(tag, obj);
|
||||
|
||||
doc->SetAttribute(tag, AttrType, ToolType);
|
||||
doc->SetAttribute(tag, AttrAxisP1, axisP1Id);
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#ifndef VTOOLTRIANGLE_H
|
||||
#define VTOOLTRIANGLE_H
|
||||
|
||||
#include "vtoolpoint.h"
|
||||
#include "vtoolsinglepoint.h"
|
||||
|
||||
/**
|
||||
* @brief The VToolTriangle class for tool that find point intersection two foots right triangle
|
||||
* (triangle with 90 degree).
|
||||
*/
|
||||
class VToolTriangle : public VToolPoint
|
||||
class VToolTriangle : public VToolSinglePoint
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
38
src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp
Normal file
38
src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vabstractpoint.cpp
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 19 6, 2015
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentine project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2015 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
#include "vabstractpoint.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractPoint::VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id)
|
||||
:VDrawTool(doc, data, id)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractPoint::~VAbstractPoint()
|
||||
{}
|
41
src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h
Normal file
41
src/libs/vtools/tools/drawTools/toolpoint/vabstractpoint.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vabstractpoint.h
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 19 6, 2015
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentine project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) 2015 Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef VABSTRACTPOINT_H
|
||||
#define VABSTRACTPOINT_H
|
||||
|
||||
#include "../vdrawtool.h"
|
||||
|
||||
class VAbstractPoint: public VDrawTool
|
||||
{
|
||||
public:
|
||||
VAbstractPoint(VAbstractPattern *doc, VContainer *data, quint32 id);
|
||||
virtual ~VAbstractPoint();
|
||||
};
|
||||
|
||||
#endif // VABSTRACTPOINT_H
|
|
@ -13,7 +13,7 @@ HEADERS += \
|
|||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpoint.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h \
|
||||
|
@ -43,7 +43,8 @@ HEADERS += \
|
|||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h \
|
||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.h
|
||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.h \
|
||||
$$PWD/drawTools/toolpoint/vabstractpoint.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/vtooldetail.cpp \
|
||||
|
@ -56,7 +57,7 @@ SOURCES += \
|
|||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpoint.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp \
|
||||
|
@ -84,4 +85,5 @@ SOURCES += \
|
|||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp \
|
||||
$$PWD/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp \
|
||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.cpp
|
||||
$$PWD/drawTools/toolcurve/vtoolarcwithlength.cpp \
|
||||
$$PWD/drawTools/toolpoint/vabstractpoint.cpp
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "movesplinepath.h"
|
||||
#include <QDomElement>
|
||||
#include "../tools/drawTools/vtoolsplinepath.h"
|
||||
#include "../tools/drawTools/toolcurve/vtoolsplinepath.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MoveSplinePath::MoveSplinePath(VAbstractPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath,
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolbisector.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtoolbisector.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolBisector::VisToolBisector(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolcurveintersectaxis.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/vtoolcurveintersectaxis.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolCurveIntersectAxis::VisToolCurveIntersectAxis(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolheight.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/vtoolheight.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolHeight::VisToolHeight(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoollineintersectaxis.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/vtoollineintersectaxis.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolLineIntersectAxis::VisToolLineIntersectAxis(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolnormal.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/vtoolnormal.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolNormal::VisToolNormal(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolpointfromarcandtangent.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtoolpointfromarcandtangent.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../../vgeometry/varc.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../vgeometry/varc.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolPointFromArcAndTangent::VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolpointfromcircleandtangent.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtoolpointfromcircleandtangent.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolPointFromCircleAndTangent::VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolpointofcontact.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/vtoolpointofcontact.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolPointOfContact::VisToolPointOfContact(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolpointofintersectionarcs.h"
|
||||
#include "../../vgeometry/varc.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtoolpointofintersectionarcs.h"
|
||||
#include "../vgeometry/varc.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolPointOfIntersectionArcs::VisToolPointOfIntersectionArcs(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolpointofintersectioncircles.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtoolpointofintersectioncircles.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolPointOfIntersectionCircles::VisToolPointOfIntersectionCircles(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
*************************************************************************/
|
||||
|
||||
#include "vistoolshoulderpoint.h"
|
||||
#include "../tools/drawTools/vtoolshoulderpoint.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h"
|
||||
#include "../vgeometry/vpointf.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VisToolShoulderPoint::VisToolShoulderPoint(const VContainer *data, QGraphicsItem *parent)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "vistooltriangle.h"
|
||||
#include "../../vgeometry/vpointf.h"
|
||||
#include "../../vpatterndb/vcontainer.h"
|
||||
#include "../tools/drawTools/vtooltriangle.h"
|
||||
#include "../tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h"
|
||||
#include <QtCore/qmath.h>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user