Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / ModelAPI / ModelAPI_CompositeFeature.cpp
index 5cad229fab9d0ca6f8603f9a1bb6aac653917185..09b5919f371c8b1ffee31f8fc06b62b5739bdd16 100644 (file)
@@ -1,6 +1,6 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
-// File:        ModelAPI_CompositeFeature.h
+// File:        ModelAPI_CompositeFeature.cpp
 // Created:     20 Oct 2014
 // Author:      Mikhail PONIKAROV
 
@@ -10,3 +10,24 @@ ModelAPI_CompositeFeature::~ModelAPI_CompositeFeature()
 {
 
 }
+
+void ModelAPI_CompositeFeature::exchangeIDs(
+  std::shared_ptr<ModelAPI_Feature> theFeature1, std::shared_ptr<ModelAPI_Feature> theFeature2)
+{
+  // by default nothing is in the implementation
+}
+
+void ModelAPI_CompositeFeature::erase()
+{
+  // erase all sub-features
+  if (data()->isValid()) {
+    for(int a = numberOfSubs(); a > 0; a--) {
+      FeaturePtr aFeature = subFeature(a - 1);
+      if (aFeature.get()) {
+        // subs are referenced from sketch, but must be removed for sure, so not checkings
+        aFeature->document()->removeFeature(aFeature);
+      }
+    }
+  }
+  ModelAPI_Feature::erase();
+}