]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Undo the regression: optimization makes the sketch instable
authormpv <mpv@opencascade.com>
Fri, 4 Sep 2015 08:52:08 +0000 (11:52 +0300)
committermpv <mpv@opencascade.com>
Fri, 4 Sep 2015 08:52:08 +0000 (11:52 +0300)
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h

index 7b993c2161e0ad1d3daa39ea59f25188c5490430..c8f7a22e6694d2239060ed00411651e21cdc3844 100644 (file)
@@ -143,14 +143,6 @@ void SketchPlugin_Sketch::removeFeature(std::shared_ptr<ModelAPI_Feature> theFea
   // to keep the persistent sub-elements indexing, do not remove elements from list,
   // but substitute by nulls
   reflist(SketchPlugin_Sketch::FEATURES_ID())->substitute(theFeature, ObjectPtr());
-
-  std::map<int, std::shared_ptr<ModelAPI_Feature> >::iterator aSubIter = mySubs.begin();
-  for(; aSubIter != mySubs.end(); aSubIter++) {
-    if (aSubIter->second == theFeature) {
-      mySubs.erase(aSubIter);
-      break;
-    }
-  }
 }
 
 int SketchPlugin_Sketch::numberOfSubs(bool forTree) const
@@ -166,12 +158,8 @@ std::shared_ptr<ModelAPI_Feature> SketchPlugin_Sketch::subFeature(
   if (forTree)
     return FeaturePtr();
 
-  if (mySubs.find(theIndex) != mySubs.end())
-    return mySubs[theIndex];
-
   ObjectPtr anObj = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->object(theIndex, false);
   FeaturePtr aRes = std::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
-  mySubs[theIndex] = aRes;
   return aRes;
 }
 
index aadbe9caf47a04a25e689740bd394a0bd8682a88..fe0df3ba8295c266da56b0da51bbd398d8e639c3 100644 (file)
@@ -30,8 +30,6 @@
  */
 class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICustomPrs//, public GeomAPI_IPresentable
 {
-  /// Optimization: indexes of sketch sub-elements are persistent, so, no problems in synchronization.
-  std::map<int, std::shared_ptr<ModelAPI_Feature> > mySubs;
  public:
   /// Sketch feature kind
   inline static const std::string& ID()