Salome HOME
PAL14858 (The Mesh Info Dialog Box is too slow)
[modules/smesh.git] / src / SMDS / SMDS_Mesh.hxx
index 130e05d444c75445d1a3a17307294e13d0811007..f95cfc40f33ff10f6b9b393f35b9b45c7cb584fd 100644 (file)
 #ifndef _SMDS_Mesh_HeaderFile
 #define _SMDS_Mesh_HeaderFile
 
+#include "SMESH_SMDS.hxx"
+
 #include "SMDS_MeshNode.hxx"
 #include "SMDS_MeshEdge.hxx"
 #include "SMDS_MeshFace.hxx"
 #include "SMDS_MeshVolume.hxx"
 #include "SMDS_MeshElementIDFactory.hxx"
+#include "SMDS_MeshInfo.hxx"
 #include "SMDS_ElemIterator.hxx"
 #include <NCollection_Map.hxx>
 
-//#ifdef WNT
-//#include <SALOME_WNT.hxx>
-//#else
-//#define SALOME_WNT_EXPORT
-//#endif
-#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
-#define SMDS_WNT_EXPORT __declspec( dllexport )
-#else
-#define SMDS_WNT_EXPORT
-#endif
-
 #include <boost/shared_ptr.hpp>
 #include <set>
 #include <list>
 
-class SMDS_WNT_EXPORT SMDS_Mesh:public SMDS_MeshObject{
+class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{
 public:
   
   SMDS_Mesh();
@@ -491,11 +483,19 @@ public:
   const SMDS_MeshFace *FindFace(std::vector<int> nodes_ids) const;
   static const SMDS_MeshFace* FindFace(std::vector<const SMDS_MeshNode *> nodes);
 
+  /*!
+   * \brief Raise an exception if free memory (ram+swap) too low
+    * \param doNotRaise - if true, suppres exception, just return free memory size
+    * \retval int - amount of available memory in MB or negative number in failure case
+   */
+  static int CheckMemory(const bool doNotRaise=false) throw (std::bad_alloc);
+
   int MaxNodeID() const;
   int MinNodeID() const;
   int MaxElementID() const;
   int MinElementID() const;
 
+  const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
 
   int NbNodes() const;
   int NbEdges() const;
@@ -558,15 +558,16 @@ private:
 
   // Fields PRIVATE
   
-  SetOfNodes myNodes;
-  SetOfEdges myEdges;
-  SetOfFaces myFaces;
-  SetOfVolumes myVolumes;
-  SMDS_Mesh *myParent;
+  SetOfNodes             myNodes;
+  SetOfEdges             myEdges;
+  SetOfFaces             myFaces;
+  SetOfVolumes           myVolumes;
+  SMDS_Mesh *            myParent;
   std::list<SMDS_Mesh *> myChildren;
   SMDS_MeshElementIDFactory *myNodeIDFactory;
   SMDS_MeshElementIDFactory *myElementIDFactory;
-  
+  SMDS_MeshInfo          myInfo;
+
   bool myHasConstructionEdges;
   bool myHasConstructionFaces;
   bool myHasInverseElements;