]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM_I/GEOM_ITransformOperations_i.cc
Salome HOME
0019827: EDF 736 GEOM : Duplication of a object along an elliptic path
[modules/geom.git] / src / GEOM_I / GEOM_ITransformOperations_i.cc
index 338e901ebcf85bb62462b301923e22b17da6fc1b..9715c0c4d10e2fde5c2eb549700071966506f40b 100644 (file)
@@ -988,6 +988,46 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  PositionAlongPath
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath
+                                             (GEOM::GEOM_Object_ptr theObject,
+                                             GEOM::GEOM_Object_ptr thePath,
+                                             CORBA::Double         theDistance,
+                                             CORBA::Boolean        theCopy)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theObject == NULL || thePath == NULL)
+    return aGEOMObject._retn();
+
+  //Get the basic object
+  CORBA::String_var anEntry = theObject->GetEntry();
+  Handle(GEOM_Object) aBasicObject =
+    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry);
+  if (aBasicObject.IsNull()) return aGEOMObject._retn();
+
+  //Get the path object
+  CORBA::String_var aPathEntry = thePath->GetEntry();
+  Handle(GEOM_Object) aPathObject =
+    GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), aPathEntry);
+  if (aPathObject.IsNull()) return aGEOMObject._retn();
+
+  //Perform the position
+  Handle(GEOM_Object) anObject =
+    GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MultiTranslate1D