From: nds Date: Fri, 20 Jun 2014 12:37:52 +0000 (+0400) Subject: refs #80 - Sketch base GUI: create/draw point, circle and arc X-Git-Tag: V_0.4.4~276 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=61426e6b8df62675d42ec9b5e59bbf90b6833135;p=modules%2Fshaper.git refs #80 - Sketch base GUI: create/draw point, circle and arc 1. Remove operation constraint class. 2. Edit constraint lenght. The lenght is moved. Selected(not highlighted) --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index c1ca60f14..30be9bac2 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -348,7 +348,7 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI else if (PartSet_OperationCreateConstraint::canProcessKind(theCmdId)) anOperation = new PartSet_OperationCreateConstraint(theCmdId.c_str(), this, aSketch); else if (theCmdId == PartSet_OperationEditConstraint::Type()) - anOperation = new PartSet_OperationEditConstraint(theCmdId.c_str(), this, aSketch); + anOperation = new PartSet_OperationEditConstraint(theCmdId.c_str(), theFeatureKind, this, aSketch); } if (!anOperation) { diff --git a/src/PartSet/PartSet_OperationEditConstraint.cpp b/src/PartSet/PartSet_OperationEditConstraint.cpp index 18857be25..97057d764 100644 --- a/src/PartSet/PartSet_OperationEditConstraint.cpp +++ b/src/PartSet/PartSet_OperationEditConstraint.cpp @@ -37,12 +37,12 @@ using namespace std; PartSet_OperationEditConstraint::PartSet_OperationEditConstraint(const QString& theId, + const std::string& theFeatureKind, QObject* theParent, FeaturePtr theFeature) -: PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature), myIsBlockedSelection(false) +: PartSet_OperationSketchBase(theId, theParent), myIsBlockedSelection(false) { - std::string aKind = theId.toStdString(); - myFeaturePrs = PartSet_Tools::createFeaturePrs(aKind, theFeature); + myFeaturePrs = PartSet_Tools::createFeaturePrs(theFeatureKind, theFeature); // changed myEditor = new PartSet_EditLine(0); @@ -68,6 +68,8 @@ void PartSet_OperationEditConstraint::init(FeaturePtr theFeature, const std::list& theHighlighted) { setFeature(theFeature); + myFeaturePrs->init(theFeature); + /* if (!theHighlighted.empty()) { // if there is highlighted object, we check whether it is in the list of selected objects @@ -90,7 +92,7 @@ void PartSet_OperationEditConstraint::init(FeaturePtr theFeature, FeaturePtr PartSet_OperationEditConstraint::sketch() const { - return mySketch; + return myFeaturePrs->sketch(); } void PartSet_OperationEditConstraint::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView, diff --git a/src/PartSet/PartSet_OperationEditConstraint.h b/src/PartSet/PartSet_OperationEditConstraint.h index 8aaaa452f..1c2bfeeb9 100644 --- a/src/PartSet/PartSet_OperationEditConstraint.h +++ b/src/PartSet/PartSet_OperationEditConstraint.h @@ -55,10 +55,11 @@ public: public: /// Constructor /// \param theId the feature identifier + /// \param theFeatureId the feature identifier /// \param theParent the operation parent /// \param theFeature the parent feature - PartSet_OperationEditConstraint(const QString& theId, QObject* theParent, - FeaturePtr theFeature); + PartSet_OperationEditConstraint(const QString& theId, const std::string& theFeatureKind, + QObject* theParent, FeaturePtr theFeature); /// Destructor virtual ~PartSet_OperationEditConstraint(); @@ -148,7 +149,6 @@ protected slots: private: PartSet_EditLine* myEditor; ///< the constraint value editor boost::shared_ptr myFeaturePrs; ///< the feature presentation - FeaturePtr mySketch; ///< the sketch feature //std::list myFeatures; ///< the features to apply the edit operation Point myCurPoint; ///< the current 3D point clicked or moved bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal