Salome HOME
Issue #1383 Preview button: implementation on the Updater level
[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   if (data()->isValid()) {
24     for(int a = numberOfSubs(); a > 0; a--) {
25       FeaturePtr aFeature = subFeature(a - 1);
26       if (aFeature.get()) {
27         // subs are referenced from sketch, but must be removed for sure, so not checkings
28         aFeature->document()->removeFeature(aFeature);
29       }
30     }
31   }
32   ModelAPI_Feature::erase();
33 }