Salome HOME
[bos #38360] [CEA] improve performances of exportXAO and PublishToStudy
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_CompoundBuilder.cpp
index aa654d8882eb783a3bd8129a36ee734056955cea..2eaf19f1906bbeeb6b189b6411fd187abb0587ed 100644 (file)
@@ -41,44 +41,3 @@ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_CompoundBuilder::compound(
   aRes->setImpl(new TopoDS_Shape(aComp));
   return aRes;
 }
-
-// Returns true if transformations are equal with the given precision
-static bool isEqual(const gp_Trsf& theT1, const gp_Trsf& theT2, const double thePrecision)
-{
-  for(int aRow = 1; aRow < 4; aRow++) {
-    for(int aCol = 1; aCol < 5; aCol++) {
-      double aDiff = theT1.Value(aRow, aCol) - theT2.Value(aRow, aCol);
-      if (aDiff < 0) aDiff = -aDiff;
-      if (aDiff > thePrecision)
-        return false;
-    }
-  }
-  return true;
-}
-
-int GeomAlgoAPI_CompoundBuilder::id(
-      std::shared_ptr<GeomAPI_Shape> theContext, std::shared_ptr<GeomAPI_Shape> theSub)
-{
-  int anID = 0;
-  TopoDS_Shape aMainShape = theContext->impl<TopoDS_Shape>();
-  const TopoDS_Shape& aSubShape = theSub->impl<TopoDS_Shape>();
-  if (!aMainShape.IsNull() && !aSubShape.IsNull()) {
-    TopTools_IndexedMapOfShape aSubShapesMap;
-    TopExp::MapShapes(aMainShape, aSubShapesMap);
-    anID = aSubShapesMap.FindIndex(aSubShape);
-    if (anID == 0) { // try to search shape with the same location if TopLoc_Location is different
-      TopExp_Explorer anExp(aMainShape, aSubShape.ShapeType());
-      for(; anExp.More(); anExp.Next()) {
-        if (anExp.Current().TShape() == aSubShape.TShape()) {
-          const TopLoc_Location aLoc1 = anExp.Current().Location();
-          if (isEqual(aLoc1.Transformation(), aSubShape.Location().Transformation(), 1.e-7)) {
-            anID = aSubShapesMap.FindIndex(anExp.Current());
-            break;
-          }
-        }
-      }
-    }
-  }
-
-  return anID;
-}