From: gka Date: Mon, 24 Apr 2006 07:55:49 +0000 (+0000) Subject: Add method for getting tangent by parameter on curve X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa800f73f1b40a9a232a8a32e94fa6e4c0acd747;p=modules%2Fgeom.git Add method for getting tangent by parameter on curve --- 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);