Salome HOME
Porting to CAS-6.3
[modules/geom.git] / src / GEOM_I / GEOM_IBasicOperations_i.cc
index b24857da187189aaecab5f261362e172d2fce847..613e3954e5bbde2948169780a501186c8bae63ae 100644 (file)
@@ -15,7 +15,7 @@
 // License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include <Standard_Stream.hxx>
 
@@ -105,6 +105,40 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointWithReference
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakePointOnLinesIntersection
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
+                  (GEOM::GEOM_Object_ptr theLine1,  GEOM::GEOM_Object_ptr theLine2)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theLine1 == NULL || theLine2 == NULL) return aGEOMObject._retn();
+
+  //Get the reference Lines
+
+  Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
+    (theLine1->GetStudyID(), theLine1->GetEntry());
+  Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
+    (theLine2->GetStudyID(), theLine2->GetEntry());
+  if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
+
+  //Create the point
+
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakePointOnLinesIntersection(aRef1, aRef2);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+
 //=============================================================================
 /*!
  *  MakePointOnCurve
@@ -137,6 +171,70 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
 }
 
 
+//=============================================================================
+/*!
+ *  MakePointOnSurface
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurface
+                                             (GEOM::GEOM_Object_ptr theSurface,
+                                             CORBA::Double theUParameter,
+                                             CORBA::Double theVParameter)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theSurface == NULL) return aGEOMObject._retn();
+
+  //Get the reference surface
+  Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
+    (theSurface->GetStudyID(), theSurface->GetEntry());
+  if (aRefernce.IsNull()) return aGEOMObject._retn();
+
+  //Create the point
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakePointOnSurface(aRefernce, theUParameter, theVParameter);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+
+//=============================================================================
+/*!
+ *  MakeTangentOnCurve
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentOnCurve
+                  (GEOM::GEOM_Object_ptr theCurve,  CORBA::Double theParameter)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theCurve == NULL) return aGEOMObject._retn();
+
+  //Get the reference curve
+
+  Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
+    (theCurve->GetStudyID(), theCurve->GetEntry());
+  if (aRefernce.IsNull()) return aGEOMObject._retn();
+
+  //Create the point
+
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeTangentOnCurve(aRefernce, theParameter);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+
 //=============================================================================
 /*!
  *  MakeVectorDXDYDZ
@@ -259,6 +357,38 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoPnt
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeLineTwoFaces
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoFaces
+                 (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theFace1 == NULL || theFace2 == NULL) return aGEOMObject._retn();
+
+  //Get the reference points
+
+  Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
+    (theFace1->GetStudyID(), theFace1->GetEntry());
+  Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
+    (theFace2->GetStudyID(), theFace2->GetEntry());
+  if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
+
+  //Create the Line
+
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeLineTwoFaces(aRef1, aRef2);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
 
 //=============================================================================
 /*!
@@ -388,3 +518,39 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeMarker
 
   return GetObject(anObject);
 }
+
+//=============================================================================
+/*!
+ *  MakeTangentPlaneOnFace
+ */
+//=============================================================================
+
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeTangentPlaneOnFace
+                     (GEOM::GEOM_Object_ptr theFace, 
+                     CORBA::Double theParameterU,
+                     CORBA::Double theParameterV,
+                     CORBA::Double theTrimSize)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theFace == NULL) return aGEOMObject._retn();
+
+  //Get the reference face
+
+  Handle(GEOM_Object) aRef = GetOperations()->GetEngine()->GetObject
+    (theFace->GetStudyID(), theFace->GetEntry());
+  if (aRef.IsNull()) return aGEOMObject._retn();
+
+  //Create the plane
+
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeTangentPlaneOnFace(aRef, theParameterU,theParameterV,theTrimSize);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+