Salome HOME
0022353: EDF GEOM: Projection on a edge or a wire
[modules/geom.git] / src / GEOM_I / GEOM_ITransformOperations_i.cc
index fec39291e1747b412212cd839e9c2bd9dc86d8a4..582f2ddbe349394b559bc19003486db234700286 100644 (file)
@@ -692,6 +692,39 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ProjectShapeCopy
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  ProjectPointOnWire
+ */
+//=============================================================================
+CORBA::Double GEOM_ITransformOperations_i::ProjectPointOnWire
+                               (GEOM::GEOM_Object_ptr thePoint,
+                                GEOM::GEOM_Object_ptr theWire,
+                                GEOM::GEOM_Object_out thePointOnEdge,
+                                CORBA::Long&          theEdgeInWireIndex)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference shape
+  Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
+  Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
+
+  if (aPoint.IsNull() || aWire.IsNull()) {
+    return -1.0;
+  }
+
+  Handle(GEOM_Object) aPointOnEdge;
+  CORBA::Double aResult = GetOperations()->ProjectPointOnWire
+    (aPoint, aWire, aPointOnEdge, theEdgeInWireIndex);
+
+  if (!aPointOnEdge.IsNull()) {
+    thePointOnEdge = GetObject(aPointOnEdge);
+  }
+
+  return aResult;
+}
+
 //=============================================================================
 /*!
  *  ScaleShape