Salome HOME
23586: [EDF] HYDRO: Copy mesh to new geometry
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IShapesOperations.cxx
index 6b611088d9491ae5c34a2bd568f032521b518550..db197be5ce5b3afe906ca442f691599adb43bd1f 100644 (file)
@@ -4715,6 +4715,42 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
   return aResult;
 }
 
+//=======================================================================
+//function : GetInPlaceMap
+//purpose  :
+//=======================================================================
+void GEOMImpl_IShapesOperations::GetInPlaceMap (Handle(GEOM_Object) theShapeWhere,
+                                                Handle(GEOM_Object) theShapeWhat,
+                                                std::vector< std::vector< int > > & theResVec)
+{
+  SetErrorCode(KO);
+
+  if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return;
+
+  TopoDS_Shape aWhere = theShapeWhere->GetValue();
+  TopoDS_Shape aWhat  = theShapeWhat->GetValue();
+
+  if (aWhere.IsNull() || aWhat.IsNull()) return;
+
+  Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
+  if (aWhereFunction.IsNull()) return;
+
+  bool isFound = GEOMAlgo_GetInPlaceAPI::GetInPlaceMap( aWhereFunction, aWhat, theResVec );
+
+  if ( isFound )
+    SetErrorCode(OK);
+
+  Handle(GEOM_Function) aFunction =
+    GEOM::GetCreatedLast(theShapeWhere,theShapeWhat)->GetLastFunction();
+
+  GEOM::TPythonDump(aFunction, /*append=*/true)
+    << "resultList = geompy.GetInPlaceMap( "
+    << theShapeWhere << ", "
+    << theShapeWhat << ")";
+
+  return;
+}
+
 //=======================================================================
 //function : isSameEdge
 //purpose  : Returns True if two edges coincide