]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
authornds <natalia.donis@opencascade.com>
Fri, 20 Jun 2014 12:37:52 +0000 (16:37 +0400)
committernds <natalia.donis@opencascade.com>
Fri, 20 Jun 2014 12:37:52 +0000 (16:37 +0400)
1. Remove operation constraint class.
2. Edit constraint lenght. The lenght is moved. Selected(not highlighted)

src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationEditConstraint.cpp
src/PartSet/PartSet_OperationEditConstraint.h

index c1ca60f1407c7c2c7102189d9c9c92a7df46c91d..30be9bac2624eb525150753b32132c3845c611d1 100644 (file)
@@ -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) {
index 18857be2595801dc7eb13cfff0a485c56fe3b490..97057d76406fdb9d836a62fd4c9150ca776c5cfe 100644 (file)
 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<XGUI_ViewerPrs>& 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,
index 8aaaa452f0ccf750a4dde65fcd6a5e3a494b6c35..1c2bfeeb9a1142c0e8b1b4abca07de8c6c6c4197 100644 (file)
@@ -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<PartSet_FeaturePrs> myFeaturePrs; ///< the feature presentation
-  FeaturePtr mySketch; ///< the sketch feature
   //std::list<XGUI_ViewerPrs> 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