]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMDS/SMDS_MeshElement.hxx
Salome HOME
ObjectPool and SMDS_Position
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.hxx
index 13498092ab86d655eec439f99267e4bed56f167d..94e92223967cb720b2d691f11dfc7c090e37a157 100644 (file)
 #include <vector>
 #include <iostream>
 
+typedef unsigned short UShortType;
+typedef short ShortType;
+
 class SMDS_MeshNode;
 class SMDS_MeshEdge;
-class SMDS_MeshFace;   
+class SMDS_MeshFace;
+class SMDS_Mesh;
 
 // ============================================================
 /*!
@@ -64,11 +68,14 @@ public:
   virtual SMDSAbs_ElementType GetType() const = 0;
   virtual bool IsPoly() const { return false; };
   virtual bool IsQuadratic() const;
+  //! Return type of entity
+  virtual SMDSAbs_EntityType  GetEntityType() const = 0;
 
   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
@@ -114,14 +121,40 @@ public:
    */
   int GetNodeIndex( const SMDS_MeshNode* node ) const;
 
+  inline int getId() const {return myID; };
+  inline UShortType getMeshId() {return myMeshId; };
+  inline ShortType getshapeId() {return myShapeId; };
+  inline void setShapeId(UShortType shapeId) {myShapeId = shapeId; };
+
 protected:
   SMDS_MeshElement(int ID=-1);
+  SMDS_MeshElement(int id, UShortType meshId, ShortType shapeId=-1);
   virtual void Print(std::ostream & OS) const;
 
-private:
-  int myID;
+  int myID;        // --- element index 
+  ShortType myMeshId;
+  ShortType myShapeId;
 };
 
+// ============================================================
+/*!
+ * \brief Base class for all cells
+ */
+// ============================================================
+
+class SMDS_EXPORT SMDS_MeshCell:public SMDS_MeshElement
+{
+public:
+    SMDS_MeshCell();
+    virtual ~SMDS_MeshCell();
+   inline void setVtkId(int vtkId) { myVtkID = vtkId; };
+    inline int getVtkId() const {return myVtkID; };
+    static int nbCells;
+protected:
+    int myVtkID;
+};
+
+
 // ============================================================
 /*!
  * \brief Comparator of elements by ID for usage in std containers