]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_CompositeFeature.cpp
Salome HOME
Fixes for crashes and bad behavior on delete of features and Parts. For now delete...
[modules/shaper.git] / src / ModelAPI / ModelAPI_CompositeFeature.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_CompositeFeature.cpp
4 // Created:     20 Oct 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include <ModelAPI_CompositeFeature.h>
8
9 ModelAPI_CompositeFeature::~ModelAPI_CompositeFeature()
10 {
11
12 }
13
14 void ModelAPI_CompositeFeature::exchangeIDs(
15   std::shared_ptr<ModelAPI_Feature> theFeature1, std::shared_ptr<ModelAPI_Feature> theFeature2)
16 {
17   // by default nothing is in the implementation
18 }
19
20 void ModelAPI_CompositeFeature::erase()
21 {
22   // erase all sub-features
23   for(int a = numberOfSubs(); a > 0; a--) {
24     FeaturePtr aFeature = subFeature(a - 1);
25     if (aFeature.get()) {
26       // subs are referenced from sketch, but must be removed for sure, so not checkings
27       aFeature->document()->removeFeature(aFeature);
28     }
29   }
30   ModelAPI_Feature::erase();
31 }