Salome HOME
0019296: EDF 681 SMESH - Pre-evaluation of the number of elements before mesh
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.hxx
index 32fe2153dbdfeeca1f3d7836b835f05bd04cdd6b..ab8abdabf27dcb2a2a442d9bb0fb37dad983f3d2 100644 (file)
@@ -58,7 +58,7 @@ class SMESH_I_EXPORT SMESH_Mesh_i:
 public:
   SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
                 SMESH_Gen_i*            myGen_i,
-               CORBA::Long             studyId );
+                CORBA::Long             studyId );
 
   virtual ~SMESH_Mesh_i();
 
@@ -206,6 +206,8 @@ public:
    */
   char* GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits);
 
+  void ExportToMEDX( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion, CORBA::Boolean overwrite )
+    throw (SALOME::SALOME_Exception);
   void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion )
     throw (SALOME::SALOME_Exception);
   void ExportMED( const char* file, CORBA::Boolean auto_groups )
@@ -227,6 +229,9 @@ public:
   CORBA::Long NbElements()
     throw (SALOME::SALOME_Exception);
 
+  CORBA::Long Nb0DElements()
+    throw (SALOME::SALOME_Exception);
+
   CORBA::Long NbEdges()
     throw (SALOME::SALOME_Exception);
 
@@ -335,7 +340,7 @@ public:
   static SMESH::Hypothesis_Status
   ConvertHypothesisStatus (SMESH_Hypothesis::Hypothesis_Status theStatus);
 
-  static void PrepareForWriting (const char* file);
+  static void PrepareForWriting (const char* file, bool overwrite = true);
 
   //int importMEDFile( const char* theFileName, const char* theMeshName );
 
@@ -482,6 +487,31 @@ public:
    * Returns list of notebook variables used for last Mesh operation
    */
   SMESH::string_array* GetLastParameters();
+
+
+  /*!
+   * Returns statistic of mesh elements
+   * Result array of number enityties
+   * Inherited from SMESH_IDSource
+   */
+  virtual SMESH::long_array* GetMeshInfo();
+
+  /*!
+   * Collect statistic of mesh elements given by iterator
+   */
+  static void CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
+                              SMESH::long_array&         theInfo);
+                          
+
+  /*!
+   * \brief Return submesh objects list in meshing order
+   */
+  virtual SMESH::submesh_array_array* GetMeshOrder();
+  /*!
+   * \brief Set submesh object order
+   */
+  virtual ::CORBA::Boolean SetMeshOrder(const SMESH::submesh_array_array& theSubMeshArray);
+
   
   std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
   std::map<int, ::SMESH_subMesh*> _mapSubMesh;   //NRI
@@ -492,6 +522,13 @@ private:
    */
   void checkGroupNames();
 
+  /*!
+   * Convert submesh ids into submesh interfaces
+   */
+  void convertMeshOrder(const TListOfListOfInt&     theIdsOrder,
+                        SMESH::submesh_array_array& theSubMeshOrder,
+                        const bool                  theIsDump);
+
 private:
 
   static int myIdGenerator;
@@ -503,6 +540,33 @@ private:
   std::map<int, SMESH::SMESH_GroupBase_ptr>  _mapGroups;
   std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
   SALOME_MED::MedFileInfo_var myFileInfo;
+
+private:
+
+  // Data used to track changes of GEOM groups
+  struct TGeomGroupData {
+    // keep study entry and not ior because GEOM_Object actually changes if
+    // number of items in a group varies (1) <-> (>1)
+    std::string       _groupEntry;
+    std::set<int>     _indices; // indices of group items within group's main shape
+    CORBA::Object_ptr _smeshObject; // SMESH object depending on GEOM group
+  };
+  std::list<TGeomGroupData> _geomGroupData;
+
+  /*!
+   * Remember GEOM group data
+   */
+  void addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj,
+                        CORBA::Object_ptr     theSmeshObj);
+  /*!
+   * Remove GEOM group data relating to removed smesh object
+   */
+  void removeGeomGroupData(CORBA::Object_ptr theSmeshObj);
+  /*!
+   * \brief Return new group contents if it has been changed and update group data
+   */
+  TopoDS_Shape newGroupShape( TGeomGroupData & groupData);
+  
 };
 
 #endif