]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOM/GEOM_Function.cxx
Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / GEOM / GEOM_Function.cxx
index 09820f40b11bdca473e0106b382dd76c3b55110f..146863614f6c54b3964e090546166e45dc74efb7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -18,6 +18,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include <Standard_Stream.hxx>
 
@@ -136,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