From aa800f73f1b40a9a232a8a32e94fa6e4c0acd747 Mon Sep 17 00:00:00 2001 From: gka Date: Mon, 24 Apr 2006 07:55:49 +0000 Subject: [PATCH] Add method for getting tangent by parameter on curve --- src/GEOM_I/GEOM_IBasicOperations_i.cc | 31 +++++++++++++++++++++++++++ src/GEOM_I/GEOM_IBasicOperations_i.hh | 3 +++ 2 files changed, 34 insertions(+) diff --git a/src/GEOM_I/GEOM_IBasicOperations_i.cc b/src/GEOM_I/GEOM_IBasicOperations_i.cc index b24857da1..b67314b0b 100644 --- a/src/GEOM_I/GEOM_IBasicOperations_i.cc +++ b/src/GEOM_I/GEOM_IBasicOperations_i.cc @@ -136,6 +136,37 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve 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); +} + //============================================================================= /*! diff --git a/src/GEOM_I/GEOM_IBasicOperations_i.hh b/src/GEOM_I/GEOM_IBasicOperations_i.hh index e46f50431..8cee133b5 100644 --- a/src/GEOM_I/GEOM_IBasicOperations_i.hh +++ b/src/GEOM_I/GEOM_IBasicOperations_i.hh @@ -52,6 +52,9 @@ class GEOM_IBasicOperations_i : GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve, CORBA::Double theParameter); + GEOM::GEOM_Object_ptr MakeTangentOnCurve (GEOM::GEOM_Object_ptr theRefCurve, + CORBA::Double theParameter); + GEOM::GEOM_Object_ptr MakeVectorDXDYDZ (CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ); -- 2.39.2