Salome HOME
Porting to SALOME_8.2.0 : Debug visualization selection for AIS_Trihedron axes.
[modules/shaper.git] / src / ModelAPI / ModelAPI_CompositeFeature.cpp
index ba5d1cd5ccd1d7ab26eb7c3e128aadea7e9bd7c3..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
 
@@ -11,3 +11,23 @@ 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();
+}