]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge remote-tracking branch 'remotes/origin/Operations_on_Groups'
authorazv <azv@opencascade.com>
Mon, 12 Aug 2019 05:36:58 +0000 (08:36 +0300)
committerazv <azv@opencascade.com>
Mon, 12 Aug 2019 05:36:58 +0000 (08:36 +0300)
1  2 
src/ModuleBase/ModuleBase_Tools.cpp

index b528344ce493df558b99541aabaa011b1cdc12fd,e8124f80fda6de2309e64c8c7242eaed50035e7d..40d74c1d20629effe4ebecb36d940559cc91d6ef
@@@ -1130,7 -1130,7 +1130,7 @@@ void setPointBallHighlighting(AIS_Shape
        aFile = std::string(anEnv) +
          FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
      } else {
 -      anEnv = getenv("OPENPARTS_ROOT_DIR");
 +      anEnv = getenv("CADBUILDER_ROOT_DIR");
        if (anEnv)
          aFile = std::string(anEnv) + FSEP + "resources";
      }
@@@ -1299,6 -1299,28 +1299,28 @@@ std::string generateName(const Attribut
    return aName;
  }
  
+ bool isSameShape(const TopoDS_Shape& theShape1, const TopoDS_Shape& theShape2)
+ {
+   // In case of compound we cannot rely on simple comparison method.
+   // If the compound is generated by Group feature then this compound is alwais new.
+   // So, we have to compare content of these compounds
+   if (theShape1.ShapeType() != theShape2.ShapeType())
+     return false;
+   if (theShape1.ShapeType() != TopAbs_COMPOUND)
+     return theShape1.IsSame(theShape2);
+   TopoDS_Iterator aIt1(theShape1);
+   TopoDS_Iterator aIt2(theShape2);
+   for (; aIt1.More() && aIt2.More(); aIt1.Next(), aIt2.Next()) {
+     if (!(aIt1.Value()).IsSame(aIt2.Value()))
+       return false;
+   }
+   return true;
+ }
  } // namespace ModuleBase_Tools