]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Divide method init on initFeature and initSelection
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 08:48:51 +0000 (12:48 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 26 Jun 2014 08:48:51 +0000 (12:48 +0400)
src/PartSet/PartSet_OperationFeatureCreate.cpp
src/PartSet/PartSet_OperationFeatureEdit.cpp
src/PartSet/PartSet_OperationFeatureEdit.h
src/PartSet/PartSet_OperationFeatureEditMulti.cpp
src/PartSet/PartSet_OperationFeatureEditMulti.h
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h

index 6aabe1e67fc8985c3ad5655ef289d393bd2fe2ab..a72593906a95032f17e6e6f1d709576ab02e6bda 100644 (file)
@@ -91,8 +91,8 @@ void PartSet_OperationFeatureCreate::initSelection(const std::list<XGUI_ViewerPr
 
 void PartSet_OperationFeatureCreate::initFeature(FeaturePtr theFeature)
 {
-//  if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
-//    return;
+  //if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
+  //  return;
   myInitFeature = theFeature;
 }
 
index dc7f99ddf77024c10f6fc1f441d8a40280cd218f..6ab6edf9544939745ec5ad11589c1ab09f90e7e2 100644 (file)
@@ -58,13 +58,12 @@ std::list<int> PartSet_OperationFeatureEdit::getSelectionModes(FeaturePtr theFea
   return PartSet_OperationSketchBase::getSelectionModes(theFeature);
 }
 
-void PartSet_OperationFeatureEdit::init(FeaturePtr theFeature,
-                                     const std::list<XGUI_ViewerPrs>& theSelected,
-                                     const std::list<XGUI_ViewerPrs>& theHighlighted)
+void PartSet_OperationFeatureEdit::initFeature(FeaturePtr theFeature)
 {
   setEditingFeature(theFeature);
 }
 
+
 FeaturePtr PartSet_OperationFeatureEdit::sketch() const
 {
   return mySketch;
index 0071c967ad43121d31658048e34c2ef1444edc30..a750cf9f77e9124b4a3fde5e4f9d7b94baa21491 100644 (file)
@@ -70,13 +70,8 @@ public:
   /// \return the selection mode
   virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
-  /// Initializes some fields accorging to the feature
-  /// \param theFeature the feature
-  /// \param theSelected the list of selected presentations
-  /// \param theHighlighted the list of highlighted presentations
-  virtual void init(FeaturePtr theFeature,
-                    const std::list<XGUI_ViewerPrs>& theSelected,
-                    const std::list<XGUI_ViewerPrs>& theHighlighted);
+  /// Initializes the operation with previously created feature. It is used in sequental operations
+  virtual void initFeature(FeaturePtr theFeature);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
index d719df8c96bafe224fb921341e58dae556d7ff80..89928ccded1b616101be1a0add75ccd01a8a95c2 100644 (file)
@@ -48,12 +48,9 @@ bool PartSet_OperationFeatureEditMulti::isGranted(ModuleBase_IOperation* theOper
   return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
 }
 
-void PartSet_OperationFeatureEditMulti::init(FeaturePtr theFeature,
-                                     const std::list<XGUI_ViewerPrs>& theSelected,
-                                     const std::list<XGUI_ViewerPrs>& theHighlighted)
+void PartSet_OperationFeatureEditMulti::initSelection(const std::list<XGUI_ViewerPrs>& theSelected,
+                                                      const std::list<XGUI_ViewerPrs>& theHighlighted)
 {
-  setEditingFeature(theFeature);
-
   if (!theHighlighted.empty()) {
     // if there is highlighted object, we check whether it is in the list of selected objects
     // in that case this object is a handle of the moved lines. If there no such object in the selection,
@@ -73,6 +70,11 @@ void PartSet_OperationFeatureEditMulti::init(FeaturePtr theFeature,
     myFeatures = theSelected;
 }
 
+void PartSet_OperationFeatureEditMulti::initFeature(FeaturePtr theFeature)
+{
+  setEditingFeature(theFeature);
+}
+
 FeaturePtr PartSet_OperationFeatureEditMulti::sketch() const
 {
   return mySketch;
index f21a78ad6842ec20031e0299be51a7b9051a2f9b..a431a1d85f7b3176a0b5d66ad6c446c09419850b 100644 (file)
@@ -65,13 +65,14 @@ public:
   /// \param theOperation the previous running operation
   virtual bool isGranted(ModuleBase_IOperation* theOperation) const;
 
-  /// Initializes some fields accorging to the feature
-  /// \param theFeature the feature
+  /// Initializes the operation with previously created feature. It is used in sequental operations
+  virtual void initFeature(FeaturePtr theFeature);
+
+  /// Initialisation of operation with preliminary selection
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(FeaturePtr theFeature,
-                    const std::list<XGUI_ViewerPrs>& theSelected,
-                    const std::list<XGUI_ViewerPrs>& theHighlighted);
+  virtual void initSelection(const std::list<XGUI_ViewerPrs>& theSelected,
+    const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
index dfe2fe85c6cd5249a673be88829cf0ac2e238c07..b035dca5ca7c26e6c8f2b0b1cddf42856419fdea 100644 (file)
@@ -58,9 +58,9 @@ std::list<int> PartSet_OperationSketch::getSelectionModes(FeaturePtr theFeature)
   return aModes;
 }
 
-void PartSet_OperationSketch::init(FeaturePtr theFeature,
-                                   const std::list<XGUI_ViewerPrs>& /*theSelected*/,
-                                   const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
+
+/// Initializes the operation with previously created feature. It is used in sequental operations
+void PartSet_OperationSketch::initFeature(FeaturePtr theFeature)
 {
   if (theFeature)
     setEditingFeature(theFeature);
index 27c0d8641db489ef85cde4dce263e84cc9f3386b..37c0482cac0275bd2be5912d6103c1bf56e0547e 100644 (file)
@@ -39,12 +39,8 @@ public:
   /// \return the selection mode
   virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
-  /// Initializes some fields accorging to the feature
-  /// \param theSelected the list of selected presentations
-  /// \param theHighlighted the list of highlighted presentations
-  virtual void init(FeaturePtr theFeature,
-                    const std::list<XGUI_ViewerPrs>& theSelected,
-                    const std::list<XGUI_ViewerPrs>& theHighlighted);
+  /// Initializes the operation with previously created feature. It is used in sequental operations
+  virtual void initFeature(FeaturePtr theFeature);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance