Salome HOME
PR: merged from V5_1_4rc1
[modules/smesh.git] / src / SMDS / SMDS_Mesh.hxx
index e471ca99a2626b406e60ee8183c7801f7db1deca..d827ab18e8ea31720e77631f154c77a35c9e8320 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH SMDS : implementaion of Salome mesh data structure
 //  File   : SMDS_Mesh.hxx
 //  Module : SMESH
-
+//
 #ifndef _SMDS_Mesh_HeaderFile
 #define _SMDS_Mesh_HeaderFile
 
@@ -43,6 +44,7 @@
 #include "SMDS_VtkFace.hxx"
 #include "SMDS_VtkVolume.hxx"
 #include "ObjectPool.hxx"
+#include "SMDS_UnstructuredGrid.hxx"
 
 #include <boost/shared_ptr.hpp>
 #include <set>
@@ -53,8 +55,6 @@
 #include "Utils_SALOME_Exception.hxx"
 #define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified"));
 
-class vtkUnstructuredGrid;
-
 class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{
 public:
   friend class SMDS_MeshElementIDFactory;
@@ -69,7 +69,7 @@ public:
   inline vtkUnstructuredGrid* getGrid() {return myGrid; };
   inline int getMeshId() {return myMeshId; };
 
-  SMDS_NodeIteratorPtr nodesIterator() const;
+  SMDS_NodeIteratorPtr nodesIterator(bool idInceasingOrder=false) const;
   SMDS_0DElementIteratorPtr elements0dIterator() const;
   SMDS_EdgeIteratorPtr edgesIterator() const;
   SMDS_FaceIteratorPtr facesIterator() const;
@@ -512,8 +512,11 @@ public:
                                        const SMDS_MeshNode *n7,
                                        const SMDS_MeshNode *n8);
 
-  const SMDS_MeshFace *FindFace(std::vector<int> nodes_ids) const;
-  static const SMDS_MeshFace* FindFace(std::vector<const SMDS_MeshNode *> nodes);
+  const SMDS_MeshFace *FindFace(const std::vector<int>& nodes_ids) const;
+  static const SMDS_MeshFace* FindFace(const std::vector<const SMDS_MeshNode *>& nodes);
+  static const SMDS_MeshElement* FindElement(const std::vector<const SMDS_MeshNode *>& nodes,
+                                             const SMDSAbs_ElementType                 type=SMDSAbs_All,
+                                             const bool                                noMedium=true);
 
   /*!
    * \brief Raise an exception if free memory (ram+swap) too low
@@ -568,12 +571,12 @@ public:
 
   void incrementNodesCapacity(int nbNodes);
   void incrementCellsCapacity(int nbCells);
-  
-  int myCellLinksSize;
+  void adjustStructure();
+  void dumpGrid(string ficdump="dumpGrid");
 
   static int chunkSize;
 
-private:
+protected:
   SMDS_Mesh(SMDS_Mesh * parent);
 
   SMDS_MeshFace * createTriangle(const SMDS_MeshNode * node1,
@@ -615,7 +618,7 @@ private:
   int myMeshId;
 
   //! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
-  vtkUnstructuredGrid*      myGrid;
+  SMDS_UnstructuredGrid*      myGrid;
 
   //! Small objects like SMDS_MeshNode are allocated by chunks to limit memory costs of new
   ObjectPool<SMDS_MeshNode>* myNodePool;