From 0bc7518564b1bebe935eb3cca353061ddb9629a6 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 10 Jun 2014 13:13:24 +0400 Subject: [PATCH] refs #80 - Sketch base GUI: create/draw point, circle and arc Edit feature: rename edit line to edit feature. --- src/PartSet/CMakeLists.txt | 4 +-- src/PartSet/PartSet_Module.cpp | 6 ++-- ...e.cpp => PartSet_OperationEditFeature.cpp} | 36 +++++++++---------- ...tLine.h => PartSet_OperationEditFeature.h} | 14 ++++---- src/PartSet/PartSet_OperationSketch.cpp | 6 ++-- 5 files changed, 33 insertions(+), 33 deletions(-) rename src/PartSet/{PartSet_OperationEditLine.cpp => PartSet_OperationEditFeature.cpp} (82%) rename src/PartSet/{PartSet_OperationEditLine.h => PartSet_OperationEditFeature.h} (92%) diff --git a/src/PartSet/CMakeLists.txt b/src/PartSet/CMakeLists.txt index a07a1f599..bb812080d 100644 --- a/src/PartSet/CMakeLists.txt +++ b/src/PartSet/CMakeLists.txt @@ -14,7 +14,7 @@ SET(PROJECT_HEADERS PartSet_Module.h PartSet_OperationConstraint.h PartSet_OperationCreateFeature.h - PartSet_OperationEditLine.h + PartSet_OperationEditFeature.h PartSet_OperationSketchBase.h PartSet_OperationSketch.h PartSet_Presentation.h @@ -32,7 +32,7 @@ SET(PROJECT_SOURCES PartSet_Module.cpp PartSet_OperationConstraint.cpp PartSet_OperationCreateFeature.cpp - PartSet_OperationEditLine.cpp + PartSet_OperationEditFeature.cpp PartSet_OperationSketchBase.cpp PartSet_OperationSketch.cpp PartSet_Presentation.cpp diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index d754eaf14..ae43f8a3a 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -323,8 +323,8 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI aSketch = aPrevOp->sketch(); if (PartSet_OperationCreateFeature::canProcessKind(theCmdId)) anOperation = new PartSet_OperationCreateFeature(theCmdId.c_str(), this, aSketch); - else if (theCmdId == PartSet_OperationEditLine::Type()) - anOperation = new PartSet_OperationEditLine(theCmdId.c_str(), this, aSketch); + else if (theCmdId == PartSet_OperationEditFeature::Type()) + anOperation = new PartSet_OperationEditFeature(theCmdId.c_str(), this, aSketch); else if (theCmdId == PartSet_OperationConstraint::Type()) anOperation = new PartSet_OperationConstraint(theCmdId.c_str(), this, aSketch); } diff --git a/src/PartSet/PartSet_OperationEditLine.cpp b/src/PartSet/PartSet_OperationEditFeature.cpp similarity index 82% rename from src/PartSet/PartSet_OperationEditLine.cpp rename to src/PartSet/PartSet_OperationEditFeature.cpp index af46da90d..092df0604 100644 --- a/src/PartSet/PartSet_OperationEditLine.cpp +++ b/src/PartSet/PartSet_OperationEditFeature.cpp @@ -1,8 +1,8 @@ -// File: PartSet_OperationEditLine.h +// File: PartSet_OperationEditFeature.h // Created: 05 May 2014 // Author: Natalia ERMOLAEVA -#include +#include #include #include @@ -32,28 +32,28 @@ using namespace std; -PartSet_OperationEditLine::PartSet_OperationEditLine(const QString& theId, +PartSet_OperationEditFeature::PartSet_OperationEditFeature(const QString& theId, QObject* theParent, FeaturePtr theFeature) : PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature), myIsBlockedSelection(false) { } -PartSet_OperationEditLine::~PartSet_OperationEditLine() +PartSet_OperationEditFeature::~PartSet_OperationEditFeature() { } -bool PartSet_OperationEditLine::isGranted(ModuleBase_IOperation* theOperation) const +bool PartSet_OperationEditFeature::isGranted(ModuleBase_IOperation* theOperation) const { return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type(); } -std::list PartSet_OperationEditLine::getSelectionModes(FeaturePtr theFeature) const +std::list PartSet_OperationEditFeature::getSelectionModes(FeaturePtr theFeature) const { return PartSet_OperationSketchBase::getSelectionModes(theFeature); } -void PartSet_OperationEditLine::init(FeaturePtr theFeature, +void PartSet_OperationEditFeature::init(FeaturePtr theFeature, const std::list& theSelected, const std::list& theHighlighted) { @@ -78,12 +78,12 @@ void PartSet_OperationEditLine::init(FeaturePtr theFeature, myFeatures = theSelected; } -FeaturePtr PartSet_OperationEditLine::sketch() const +FeaturePtr PartSet_OperationEditFeature::sketch() const { return mySketch; } -void PartSet_OperationEditLine::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView, +void PartSet_OperationEditFeature::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView, const std::list& /*theSelected*/, const std::list& theHighlighted) { @@ -108,13 +108,13 @@ void PartSet_OperationEditLine::mousePressed(QMouseEvent* theEvent, Handle(V3d_V emit setSelection(aSelected); } else if (aFeature) { - restartOperation(PartSet_OperationEditLine::Type(), aFeature); + restartOperation(PartSet_OperationEditFeature::Type(), aFeature); } } } } -void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) +void PartSet_OperationEditFeature::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) { if (!(theEvent->buttons() & Qt::LeftButton)) return; @@ -149,7 +149,7 @@ void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_Vie myCurPoint.setPoint(aPoint); } -void PartSet_OperationEditLine::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView, +void PartSet_OperationEditFeature::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView, const std::list& /*theSelected*/, const std::list& /*theHighlighted*/) { @@ -168,7 +168,7 @@ void PartSet_OperationEditLine::mouseReleased(QMouseEvent* theEvent, Handle(V3d_ } } -void PartSet_OperationEditLine::startOperation() +void PartSet_OperationEditFeature::startOperation() { // do nothing in order to do not create a new feature emit multiSelectionEnabled(false); @@ -179,7 +179,7 @@ void PartSet_OperationEditLine::startOperation() myCurPoint.clear(); } -void PartSet_OperationEditLine::stopOperation() +void PartSet_OperationEditFeature::stopOperation() { emit multiSelectionEnabled(true); @@ -188,7 +188,7 @@ void PartSet_OperationEditLine::stopOperation() myFeatures.clear(); } -void PartSet_OperationEditLine::blockSelection(bool isBlocked, const bool isRestoreSelection) +void PartSet_OperationEditFeature::blockSelection(bool isBlocked, const bool isRestoreSelection) { if (myIsBlockedSelection == isBlocked) return; @@ -205,13 +205,13 @@ void PartSet_OperationEditLine::blockSelection(bool isBlocked, const bool isRest } } -FeaturePtr PartSet_OperationEditLine::createFeature(const bool /*theFlushMessage*/) +FeaturePtr PartSet_OperationEditFeature::createFeature(const bool /*theFlushMessage*/) { // do nothing in order to do not create a new feature return FeaturePtr(); } -void PartSet_OperationEditLine::moveLinePoint(FeaturePtr theFeature, +void PartSet_OperationEditFeature::moveLinePoint(FeaturePtr theFeature, double theDeltaX, double theDeltaY, const std::string& theAttribute) { @@ -227,7 +227,7 @@ void PartSet_OperationEditLine::moveLinePoint(FeaturePtr theFeature, aPoint->setValue(aPoint->x() + theDeltaX, aPoint->y() + theDeltaY); } -void PartSet_OperationEditLine::sendFeatures() +void PartSet_OperationEditFeature::sendFeatures() { static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_MOVED); diff --git a/src/PartSet/PartSet_OperationEditLine.h b/src/PartSet/PartSet_OperationEditFeature.h similarity index 92% rename from src/PartSet/PartSet_OperationEditLine.h rename to src/PartSet/PartSet_OperationEditFeature.h index 1e18c1511..b3f5f8ee9 100644 --- a/src/PartSet/PartSet_OperationEditLine.h +++ b/src/PartSet/PartSet_OperationEditFeature.h @@ -1,9 +1,9 @@ -// File: PartSet_OperationEditLine.h +// File: PartSet_OperationEditFeature.h // Created: 05 May 2014 // Author: Natalia ERMOLAEVA -#ifndef PartSet_OperationEditLine_H -#define PartSet_OperationEditLine_H +#ifndef PartSet_OperationEditFeature_H +#define PartSet_OperationEditFeature_H #include "PartSet.h" @@ -13,10 +13,10 @@ class QMouseEvent; /*! - \class PartSet_OperationEditLine + \class PartSet_OperationEditFeature * \brief The operation for the sketch feature creation */ -class PARTSET_EXPORT PartSet_OperationEditLine : public PartSet_OperationSketchBase +class PARTSET_EXPORT PartSet_OperationEditFeature : public PartSet_OperationSketchBase { Q_OBJECT /// Struct to define gp point, with the state is the point is initialized @@ -55,10 +55,10 @@ public: /// \param theId the feature identifier /// \param theParent the operation parent /// \param theFeature the parent feature - PartSet_OperationEditLine(const QString& theId, QObject* theParent, + PartSet_OperationEditFeature(const QString& theId, QObject* theParent, FeaturePtr theFeature); /// Destructor - virtual ~PartSet_OperationEditLine(); + virtual ~PartSet_OperationEditFeature(); /// Returns that this operator can be started above already running one. /// The runned operation should be the sketch feature modified operation diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index 039d293b3..33a0a22bd 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -4,7 +4,7 @@ #include -#include +#include #include #include @@ -90,7 +90,7 @@ void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_Vie if (theHighlighted.size() == 1) { FeaturePtr aFeature = theHighlighted.front().feature(); if (aFeature) - restartOperation(PartSet_OperationEditLine::Type(), aFeature); + restartOperation(PartSet_OperationEditFeature::Type(), aFeature); } else myFeatures = theHighlighted; @@ -139,7 +139,7 @@ void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) FeaturePtr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(), theView, feature(), myFeatures); if (aFeature) - restartOperation(PartSet_OperationEditLine::Type(), aFeature); + restartOperation(PartSet_OperationEditFeature::Type(), aFeature); } } -- 2.39.2