From a211d6f8bd7ae50bcb3c82ec821472a9e6c144d1 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Jun 2012 09:39:40 +0000 Subject: [PATCH] 0021672: [CEA 565] Dump Study from script + //Retuns true if this function is the last one in the study + Standard_EXPORT bool IsLastFuntion(); --- src/GEOM/GEOM_Function.cxx | 17 +++++++++++++++++ src/GEOM/GEOM_Function.hxx | 3 +++ 2 files changed, 20 insertions(+) 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); -- 2.39.2