Salome HOME
Optimize the flushing: this improvement speed ups the unit test for 3-4 times
[modules/shaper.git] / src / PartSet / PartSet_ExternalObjectsMgr.cpp
index df63169bcca030b776758ccd2dfbd51b25876f9a..54608476b671021210654dc4ff9ca73fe3a3b1fc 100755 (executable)
@@ -51,34 +51,12 @@ ObjectPtr PartSet_ExternalObjectsMgr::externalObject(const ObjectPtr& theSelecte
     // Processing of external (non-sketch) object
     aSelectedObject = PartSet_Tools::createFixedObjectByExternal(theShape->impl<TopoDS_Shape>(),
                                                     theSelectedObject, theSketch, theTemporary);
-    if (aSelectedObject.get()) {
-      if (theTemporary)
+    if (aSelectedObject.get() && theTemporary)
         myExternalObjectValidated = aSelectedObject;
-      else
-        myExternalObjects.append(aSelectedObject);
-    }
   }
   return aSelectedObject;
 }
 
-//********************************************************************
-/*ObjectPtr PartSet_ExternalObjectsMgr::externalObjectValidated(const ObjectPtr& theSelectedObject,
-                                                     const GeomShapePtr& theShape,
-                                                     const CompositeFeaturePtr& theSketch)
-{
-  // TODO(nds): unite with externalObject()
-  ObjectPtr aSelectedObject = PartSet_Tools::findFixedObjectByExternal(theShape->impl<TopoDS_Shape>(),
-                                                             theSelectedObject, theSketch);
-  if (!aSelectedObject.get()) {
-    // Processing of external (non-sketch) object
-    aSelectedObject = PartSet_Tools::createFixedObjectByExternal(theShape->impl<TopoDS_Shape>(),
-                                                                 theSelectedObject, theSketch);
-    if (aSelectedObject.get())
-      myExternalObjectValidated = aSelectedObject;
-  }
-  return aSelectedObject;
-}*/
-
 //********************************************************************
 void PartSet_ExternalObjectsMgr::removeExternal(const CompositeFeaturePtr& theSketch,
                                                 const FeaturePtr& theFeature,
@@ -87,50 +65,10 @@ void PartSet_ExternalObjectsMgr::removeExternal(const CompositeFeaturePtr& theSk
 {
   if (theTemporary)
     removeExternalObject(myExternalObjectValidated, theSketch, theFeature, theWorkshop);
-  else{
-    QObjectPtrList::const_iterator anIt = myExternalObjects.begin(), aLast = myExternalObjects.end();
-    for (; anIt != aLast; anIt++) {
-      ObjectPtr anObject = *anIt;
-      removeExternalObject(anObject, theSketch, theFeature, theWorkshop);
-    }
-    myExternalObjects.clear();
-  }
-}
-
-//********************************************************************
-void PartSet_ExternalObjectsMgr::removeUnusedExternalObjects(const QObjectPtrList& theIgnoreObjects,
-                                                             const CompositeFeaturePtr& theSketch,
-                                                             const FeaturePtr& theFeature)
-{
-  /*
-  // TODO(nds): unite with removeExternal(), remove parameters
-  QObjectPtrList aUsedExternalObjects;
-
-  QObjectPtrList::const_iterator anIt = myExternalObjects.begin(), aLast = myExternalObjects.end();
-  for (; anIt != aLast; anIt++) {
-    ObjectPtr anObject = *anIt;
-    if (theIgnoreObjects.contains(anObject))
-      aUsedExternalObjects.append(anObject);
-    else
-      removeExternalObject(anObject, theSketch, theFeature);
-  }*/
-  myExternalObjects.clear();
-  //if (!aUsedExternalObjects.empty())
-  //  myExternalObjects = aUsedExternalObjects;
 }
 
-//********************************************************************
-/*void PartSet_ExternalObjectsMgr::removeExternalValidated(const CompositeFeaturePtr& theSketch,
-                                                         const FeaturePtr& theFeature,
-                                                         ModuleBase_IWorkshop* theWorkshop)
-{
-  // TODO(nds): unite with removeExternal(), remove parameters
-  removeExternalObject(myExternalObjectValidated, theSketch, theFeature, theWorkshop);
-  myExternalObjectValidated = ObjectPtr();
-}*/
-
 void PartSet_ExternalObjectsMgr::removeExternalObject(const ObjectPtr& theObject,
-                                                      const CompositeFeaturePtr& theSketch,
+                                                      const CompositeFeaturePtr& /*theSketch*/,
                                                       const FeaturePtr& theFeature,
                                                       ModuleBase_IWorkshop* theWorkshop)
 {