]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Optimize the result creation: do not set/unset naming if it is not necessary
authormpv <mpv@opencascade.com>
Fri, 29 May 2015 12:46:08 +0000 (15:46 +0300)
committermpv <mpv@opencascade.com>
Fri, 29 May 2015 14:38:38 +0000 (17:38 +0300)
src/Model/Model_ResultBody.cpp

index afc1c21c81d0b32e608b693fba86889ae413319b..704de68d88c9e40fbff214d9da762ec72ccd6542 100644 (file)
@@ -66,7 +66,12 @@ static void EvolutionToSelection(TDF_Label theLab, const bool theFlag) {
   Handle(TNaming_NamedShape) aName;
   int anEvolution = -1;
   if (theLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
-    anEvolution = (int)(aName->Evolution());
+    TNaming_Evolution aNSEvol = aName->Evolution();
+    if ((aNSEvol == TNaming_SELECTED && theFlag) ||
+        (aNSEvol != TNaming_SELECTED && !theFlag)) { // nothing to do, it is already correct
+      return;
+    }
+    anEvolution = (int)(aNSEvol);
     for(TNaming_Iterator anIter(aName); anIter.More(); anIter.Next()) {
       aShapePairs.push_back(std::pair<TopoDS_Shape, TopoDS_Shape>
         (anIter.OldShape(), anIter.NewShape()));