Salome HOME
CoTech 32: Action 32.3: In GEOM, the function Import() renamed to ImportFile()
[modules/geom.git] / src / GEOM_I / GEOM_ITransformOperations_i.cc
index ef24cb3901d7191809c32f4c917c6b3faf9fa1c8..568c0e010a9914cc422c2df06b27134a45aa1384 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -1129,6 +1129,37 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  TransformLikeOtherCopy
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy
+                                             (GEOM::GEOM_Object_ptr theObject,
+                                              GEOM::GEOM_Object_ptr theSample)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the object itself
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  if (anObject.IsNull()) return aGEOMObject._retn();
+
+  //Get the sample object
+  Handle(GEOM_Object) aSample = GetObjectImpl(theSample);
+  if (aSample.IsNull()) return aGEOMObject._retn();
+
+  //Perform the transformation
+  Handle(GEOM_Object) aResObject =
+    GetOperations()->TransformLikeOtherCopy(anObject, aSample);
+  if (!GetOperations()->IsDone() || aResObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(aResObject);
+}
+
 //=============================================================================
 /*!
  *  RecomputeObject