Salome HOME
Define abstract module class
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchBase.cpp
index 398293c615bd774ac907a22389178b921dab1e6d..e8f081e4d581d19beab5a3cf4f46dc48dd91e42d 100644 (file)
@@ -50,20 +50,16 @@ std::list<FeaturePtr> PartSet_OperationSketchBase::subFeatures() const
 
 std::list<int> PartSet_OperationSketchBase::getSelectionModes(ObjectPtr theFeature) const
 {
+  //TODO: Define position of selection modes definition
   std::list<int> aModes;
-  //FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
-  //if (aFeature) {
-  //  if (PartSet_Tools::isConstraintFeature(aFeature->getKind())) {
-  //      aModes.clear();
-  //      aModes.push_back(AIS_DSM_Text);
-  //      aModes.push_back(AIS_DSM_Line);
-  //      return aModes;
-  //  }
-  //}
-  aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX));
-  aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE));
-  aModes.push_back(AIS_DSM_Text);
-  aModes.push_back(AIS_DSM_Line);
+  FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
+  if (aFeature && PartSet_Tools::isConstraintFeature(aFeature->getKind())) {
+    aModes.push_back(AIS_DSM_Text);
+    aModes.push_back(AIS_DSM_Line);
+  } else {
+    aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX));
+    aModes.push_back(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE));
+  }
   return aModes;
 }
 FeaturePtr PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
@@ -102,9 +98,7 @@ void PartSet_OperationSketchBase::restartOperation(const std::string& theType, O
   if (aFeature) {
     QStringList aNested = this->nestedFeatures();
     if (!aNested.isEmpty()) {
-      if (aNested.contains(QString(aFeature->getKind().c_str()))) 
-        emit restartRequired(theType, theFeature);
-      else
+      if (!aNested.contains(QString(aFeature->getKind().c_str())))
         return;
     }
   }