From 3cb6f863c56023b731ac7d619a85378a6aa9572a Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 20 Jun 2005 05:15:39 +0000 Subject: [PATCH] PAL9166. Add possibility to make sketcher on an existing plane --- idl/GEOM_Gen.idl | 11 +++++++++++ src/GEOM_I/GEOM_ICurvesOperations_i.cc | 25 +++++++++++++++++++++++++ src/GEOM_I/GEOM_ICurvesOperations_i.hh | 2 ++ 3 files changed, 38 insertions(+) diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 891f401e0..56c6cfd8c 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -1463,6 +1463,17 @@ module GEOM * \return New GEOM_Object, containing the created wire. */ GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane); + + /*! + * Create a sketcher (wire or face), following the textual description, + * passed through \a theCommand argument. \n + * For format of the description string see the previous method.\n + * \param theCommand String, defining the sketcher in local + * coordinates of the working plane. + * \param theWorkingPlane Planar Face of the working plane. + * \return New GEOM_Object, containing the created wire. + */ + GEOM_Object MakeSketcherOnPlane (in string theCommand, in GEOM_Object theWorkingPlane); }; /*! diff --git a/src/GEOM_I/GEOM_ICurvesOperations_i.cc b/src/GEOM_I/GEOM_ICurvesOperations_i.cc index ba436bb03..5182be099 100644 --- a/src/GEOM_I/GEOM_ICurvesOperations_i.cc +++ b/src/GEOM_I/GEOM_ICurvesOperations_i.cc @@ -303,3 +303,28 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher (const char* theCom return GetObject(anObject); } + + +//============================================================================= +/*! + * MakeSketcherOnPlane + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane (const char* theCommand, GEOM::GEOM_Object_ptr theWorkingPlane) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + Handle(GEOM_Object) aWorkingPlane = GetOperations()->GetEngine()->GetObject + (theWorkingPlane->GetStudyID(), theWorkingPlane->GetEntry()); + + // Make Sketcher + Handle(GEOM_Object) anObject = + GetOperations()->MakeSketcherOnPlane(theCommand, aWorkingPlane); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} diff --git a/src/GEOM_I/GEOM_ICurvesOperations_i.hh b/src/GEOM_I/GEOM_ICurvesOperations_i.hh index 6308621f8..28f028d19 100644 --- a/src/GEOM_I/GEOM_ICurvesOperations_i.hh +++ b/src/GEOM_I/GEOM_ICurvesOperations_i.hh @@ -44,6 +44,8 @@ class GEOM_ICurvesOperations_i : GEOM::GEOM_Object_ptr MakeSketcher (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane); + GEOM::GEOM_Object_ptr MakeSketcherOnPlane (const char* theCommand, GEOM::GEOM_Object_ptr theWorkingPlane); + ::GEOMImpl_ICurvesOperations* GetOperations() { return (::GEOMImpl_ICurvesOperations*)GetImpl(); } }; -- 2.39.2