]> 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 61dcb6662619bf35d3547ef003f727030c0fd018..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
@@ -27,6 +27,8 @@
 #include <GEOM_Solver.hxx>
 #include <GEOM_ISubShape.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include "utilities.h"
 
 #include <TDF.hxx>
@@ -135,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
@@ -208,12 +227,12 @@ TopoDS_Shape GEOM_Function::GetValue()
 
     if (!isResult) {
       try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
         OCC_CATCH_SIGNALS;
 #endif
         GEOM_Solver aSolver(GEOM_Engine::GetEngine());
         if (!aSolver.ComputeFunction(this)) {
-          MESSAGE("GEOM_Object::GetValue Error : Can't build a sub shape");
+          MESSAGE("GEOM_Object::GetValue Error : Can't build a sub-shape");
           return aShape;
         }
       }