Salome HOME
22244: [CEA] Method to compute the normal to a mesh face
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.hxx
index 831b7ba20adef5625256a78cea5c270293e0acdb..f83347539ae8dc3312913dadc38a4d6d1c52fe6b 100644 (file)
 
 #include "SMESH.hxx"
 
+#include "SMESH_Hypothesis.hxx"
+#include "SMESH_Mesh.hxx"
+#include "SMESH_subMesh.hxx"
+
+#include <SALOME_GenericObj_i.hh>
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Gen)
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
 #include CORBA_CLIENT_HEADER(GEOM_Gen)
 
-#include "SMESH_Hypothesis.hxx"
-#include "SMESH_Mesh.hxx"
-#include "SMESH_subMesh.hxx"
-
-#include "SALOME_GenericObj_i.hh"
+#include <map>
 
 class SMESH_Gen_i;
 class SMESH_GroupBase_i;
 class SMESH_subMesh_i;
 class SMESH_PreMeshInfo;
-
-#include <map>
+class SMESH_MeshEditor_i;
 
 class SMESH_I_EXPORT SMESH_Mesh_i:
   public virtual POA_SMESH::SMESH_Mesh,
@@ -264,6 +264,8 @@ public:
                        const char*               file,
                        CORBA::Boolean            isascii) throw (SALOME::SALOME_Exception);
 
+  CORBA::Double GetComputeProgress();
+
   CORBA::Long NbNodes()
     throw (SALOME::SALOME_Exception);
 
@@ -366,6 +368,9 @@ public:
   SMESH::EntityType GetElementGeomType( CORBA::Long id )
     throw (SALOME::SALOME_Exception);
 
+  SMESH::GeometryType GetElementShape( CORBA::Long id )
+    throw (SALOME::SALOME_Exception);
+
   /*!
    * Returns ID of elements for given submesh
    */
@@ -530,6 +535,11 @@ public:
    */
   SMESH::long_array* GetElemFaceNodes(CORBA::Long elemId, CORBA::Short faceIndex);
 
+  /*!
+   * Returns three components of normal of given mesh face (or an empty array in KO case)
+   */
+  SMESH::double_array* GetFaceNormal(CORBA::Long faceId, CORBA::Boolean normalized);
+
   /*!
    * Returns an element based on all given nodes.
    */
@@ -575,12 +585,6 @@ public:
    */
   SMESH::string_array* GetLastParameters();
 
-  /*!
-   * 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
    */
@@ -591,17 +595,32 @@ public:
   virtual ::CORBA::Boolean SetMeshOrder(const SMESH::submesh_array_array& theSubMeshArray);
 
 
+  /*!
+   * Collect statistic of mesh elements given by iterator
+   */
+  static void CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
+                              SMESH::long_array&         theInfo);
+  /*!
+   * \brief Return iterator on elements of given type in given object
+   */
+  static SMDS_ElemIteratorPtr GetElements(SMESH::SMESH_IDSource_ptr obj,
+                                          SMESH::ElementType        type);
+
   // =========================
   // SMESH_IDSource interface
   // =========================
 
   virtual SMESH::long_array* GetIDs();
   /*!
-   * Returns statistic of mesh elements
-   * Result array of number enityties
+   * Returns number of mesh elements of each \a EntityType
+   * Result array of number of elements per \a EntityType
    * Inherited from SMESH_IDSource
    */
   virtual SMESH::long_array* GetMeshInfo();
+  /*!
+   * Returns number of mesh elements of each \a ElementType
+   */
+  virtual SMESH::long_array* GetNbElementsByType();
   /*!
    * Returns types of elements it contains
    */
@@ -644,6 +663,8 @@ private:
   std::map<int, SMESH::SMESH_subMesh_ptr>    _mapSubMeshIor;
   std::map<int, SMESH::SMESH_GroupBase_ptr>  _mapGroups;
   std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
+  SMESH_MeshEditor_i*    _editor;
+  SMESH_MeshEditor_i*    _previewEditor;
   SMESH::MedFileInfo_var _medFileInfo;
   SMESH_PreMeshInfo*     _preMeshInfo; // mesh info before full loading from study file
 
@@ -658,7 +679,7 @@ private:
     // 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
+    CORBA::Object_var _smeshObject; // SMESH object depending on GEOM group
   };
   std::list<TGeomGroupData> _geomGroupData;
 
@@ -672,7 +693,7 @@ private:
    */
   void removeGeomGroupData(CORBA::Object_ptr theSmeshObj);
   /*!
-   * \brief Return new group contents if it has been changed and update group data
+   * Return new group contents if it has been changed and update group data
    */
   TopoDS_Shape newGroupShape( TGeomGroupData & groupData);