X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_Mesh.hxx;h=d827ab18e8ea31720e77631f154c77a35c9e8320;hb=aa67cc96d730566d202d1014d97b7f0b3a4d71f4;hp=438053d73db1c40e8d06ad436713909937318ab2;hpb=256c68c3f97225b1fa805d3f30ea2f422c1d2856;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 438053d73..d827ab18e 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -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 @@ -19,10 +19,11 @@ // // 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 @@ -39,8 +40,11 @@ #include "SMDS_MeshInfo.hxx" #include "SMDS_ElemIterator.hxx" #include "SMDS_VolumeOfNodes.hxx" +#include "SMDS_VtkEdge.hxx" +#include "SMDS_VtkFace.hxx" #include "SMDS_VtkVolume.hxx" #include "ObjectPool.hxx" +#include "SMDS_UnstructuredGrid.hxx" #include #include @@ -48,7 +52,8 @@ #include #include -class vtkUnstructuredGrid; +#include "Utils_SALOME_Exception.hxx" +#define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified")); class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{ public: @@ -64,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; @@ -507,8 +512,11 @@ public: const SMDS_MeshNode *n7, const SMDS_MeshNode *n8); - const SMDS_MeshFace *FindFace(std::vector nodes_ids) const; - static const SMDS_MeshFace* FindFace(std::vector nodes); + const SMDS_MeshFace *FindFace(const std::vector& nodes_ids) const; + static const SMDS_MeshFace* FindFace(const std::vector& nodes); + static const SMDS_MeshElement* FindElement(const std::vector& nodes, + const SMDSAbs_ElementType type=SMDSAbs_All, + const bool noMedium=true); /*! * \brief Raise an exception if free memory (ram+swap) too low @@ -558,21 +566,23 @@ public: typedef std::vector SetOfCells; void updateNodeMinMax(); - inline int fromVtkToSmds(int vtkid) { return myVtkIndex[vtkid]; }; + inline int fromVtkToSmds(int vtkid) { MYASSERT(vtkid>=0); return myVtkIndex[vtkid]; }; + inline int fromSmdsToVtk(int smdsid) { MYASSERT(smdsid>=0); return myIDElements[smdsid]; }; 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, const SMDS_MeshNode * node2, - const SMDS_MeshNode * node3); + const SMDS_MeshNode * node3, + int ID); SMDS_MeshFace * createQuadrangle(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2, const SMDS_MeshNode * node3, @@ -608,13 +618,15 @@ 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* myNodePool; //! Small objects like SMDS_VtkVolume are allocated by chunks to limit memory costs of new ObjectPool* myVolumePool; + ObjectPool* myFacePool; + ObjectPool* myEdgePool; //! SMDS_MeshNodes refer to vtk nodes (vtk id = index in myNodes),store reference to this mesh, and subshape SetOfNodes myNodes;