From: eap Date: Wed, 20 Jun 2012 09:39:40 +0000 (+0000) Subject: 0021672: [CEA 565] Dump Study from script X-Git-Tag: V6_6_0a1~113 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a211d6f8bd7ae50bcb3c82ec821472a9e6c144d1;p=modules%2Fgeom.git 0021672: [CEA 565] Dump Study from script + //Retuns true if this function is the last one in the study + Standard_EXPORT bool IsLastFuntion(); --- diff --git a/src/GEOM/GEOM_Function.cxx b/src/GEOM/GEOM_Function.cxx index 0ed23645e..146863614 100644 --- a/src/GEOM/GEOM_Function.cxx +++ b/src/GEOM/GEOM_Function.cxx @@ -137,6 +137,23 @@ GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& the aRoot->Append(aNode); } +//================================================================================ +/*! + * \brief Retuns true if this function is the last one in the study + */ +//================================================================================ + +bool GEOM_Function::IsLastFuntion() +{ + bool isLast = false; + + Handle(TDataStd_TreeNode) aNode; + if (_label.FindAttribute(GetFunctionTreeID(), aNode)) + isLast = !aNode->HasNext(); + + return isLast; +} + //============================================================================= /*! * GetOwner diff --git a/src/GEOM/GEOM_Function.hxx b/src/GEOM/GEOM_Function.hxx index 4aed35221..a9633386d 100644 --- a/src/GEOM/GEOM_Function.hxx +++ b/src/GEOM/GEOM_Function.hxx @@ -253,6 +253,9 @@ public: //Returns true if the last method succided Standard_EXPORT bool IsDone() { return _isDone; } + //Retuns true if this function is the last one in the study + Standard_EXPORT bool IsLastFuntion(); + //Returns a sequence of the external dependencies of this function Standard_EXPORT void GetDependency(TDF_LabelSequence& theSeq);