Salome HOME
SMESHDS_Mesh structures
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.hxx
index eb0179ccc2eed4ba0bdd0decef677847fb128a84..30950ad8b54362f8491afc4335d40784fff8c632 100644 (file)
 #include <vector>
 #include <iostream>
 
-typedef unsigned short UShortType;
+//typedef unsigned short UShortType;
 typedef short ShortType;
 
 class SMDS_MeshNode;
 class SMDS_MeshEdge;
-class SMDS_MeshFace;   
+class SMDS_MeshFace;
+class SMDS_Mesh;
 
 // ============================================================
 /*!
@@ -73,7 +74,8 @@ public:
   virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
 
   friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *);
-  friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem);
+  friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement* elem);
+  friend class SMDS_Mesh;
 
   // ===========================
   //  Access to nodes by index
@@ -119,19 +121,29 @@ public:
    */
   int GetNodeIndex( const SMDS_MeshNode* node ) const;
 
-  inline int getId() {return myID; };
-  inline UShortType getMeshId() {return myMeshId; };
-  inline ShortType getshapeId() {return myShapeId; };
-  inline void setShapeId(UShortType shapeId) {myShapeId = shapeId; };
+  inline int getId() const {return myID; };
+  inline ShortType getMeshId() const {return myMeshId; };
+  inline ShortType getshapeId() const {return myShapeId; };
+  inline void setShapeId(ShortType shapeId) {myShapeId = shapeId; };
+  inline int getIdInShape() const { return myIdInShape; };
+  inline void setIdInShape(int id) { myIdInShape = id; };
 
 protected:
   SMDS_MeshElement(int ID=-1);
-  SMDS_MeshElement(int id, UShortType meshId, ShortType shapeId=-1);
+  SMDS_MeshElement(int id, ShortType meshId, ShortType shapeId=-1);
   virtual void Print(std::ostream & OS) const;
 
-  int myID;        // --- element index 
-  UShortType myMeshId;
+  //! Element index in vector SMDS_Mesh::myNodes or SMDS_Mesh::myCells
+  int myID;
+
+  //! SMDS_Mesh identification in SMESH
+  ShortType myMeshId;
+
+  //! SubShape and SubMesh identification in SMESHDS (not in use?)
   ShortType myShapeId;
+
+  //! Element index in SMESHDS_SubMesh vector
+  int myIdInShape;
 };
 
 // ============================================================
@@ -144,8 +156,10 @@ class SMDS_EXPORT SMDS_MeshCell:public SMDS_MeshElement
 {
 public:
     SMDS_MeshCell();
-    inline void setVtkId(int vtkId) { myVtkID = vtkId; };
+    virtual ~SMDS_MeshCell();
+   inline void setVtkId(int vtkId) { myVtkID = vtkId; };
     inline int getVtkId() const {return myVtkID; };
+    static int nbCells;
 protected:
     int myVtkID;
 };