From ab7976330adb7efc0b87cb91d48face696a8fca8 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 15 Dec 2010 10:47:20 +0000 Subject: [PATCH] 0020832: EDF 1359 SMESH : Automatic meshing of boundary layers Make const some requiring methods --- src/SMESH/SMESH_Mesh.cxx | 28 ++++++++++++++-------------- src/SMESH/SMESH_Mesh.hxx | 28 ++++++++++++++-------------- src/SMESHDS/SMESHDS_Mesh.cxx | 8 ++++---- src/SMESHDS/SMESHDS_Mesh.hxx | 6 +++--- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 39c2ca976..eb14cf655 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1172,7 +1172,7 @@ void SMESH_Mesh::ExportSTL(const char *file, const bool isascii) throw(SALOME_Ex */ //================================================================================ -int SMESH_Mesh::NbNodes() throw(SALOME_Exception) +int SMESH_Mesh::NbNodes() const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->NbNodes(); @@ -1184,7 +1184,7 @@ int SMESH_Mesh::NbNodes() throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::Nb0DElements() throw(SALOME_Exception) +int SMESH_Mesh::Nb0DElements() const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().Nb0DElements(); @@ -1196,7 +1196,7 @@ int SMESH_Mesh::Nb0DElements() throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbEdges(order); @@ -1208,7 +1208,7 @@ int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbFaces(order); @@ -1220,7 +1220,7 @@ int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbTriangles(order); @@ -1232,7 +1232,7 @@ int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbQuadrangles(order); @@ -1244,7 +1244,7 @@ int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) throw(SALOME_Exception */ //================================================================================ -int SMESH_Mesh::NbPolygons() throw(SALOME_Exception) +int SMESH_Mesh::NbPolygons() const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPolygons(); @@ -1256,7 +1256,7 @@ int SMESH_Mesh::NbPolygons() throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbVolumes(order); @@ -1268,7 +1268,7 @@ int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbTetras(order); @@ -1280,7 +1280,7 @@ int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbHexas(order); @@ -1292,7 +1292,7 @@ int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPyramids(order); @@ -1304,7 +1304,7 @@ int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) throw(SALOME_Exception) +int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPrisms(order); @@ -1316,7 +1316,7 @@ int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbPolyhedrons() throw(SALOME_Exception) +int SMESH_Mesh::NbPolyhedrons() const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPolyhedrons(); @@ -1328,7 +1328,7 @@ int SMESH_Mesh::NbPolyhedrons() throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbSubMesh() throw(SALOME_Exception) +int SMESH_Mesh::NbSubMesh() const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); return _myMeshDS->NbSubMesh(); diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index c88bbd02d..af28a5635 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -226,33 +226,33 @@ public: void ExportUNV(const char *file) throw(SALOME_Exception); void ExportSTL(const char *file, const bool isascii) throw(SALOME_Exception); - int NbNodes() throw(SALOME_Exception); + int NbNodes() const throw(SALOME_Exception); - int Nb0DElements() throw(SALOME_Exception); + int Nb0DElements() const throw(SALOME_Exception); - int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbPolygons() throw(SALOME_Exception); + int NbPolygons() const throw(SALOME_Exception); - int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception); + int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception); - int NbPolyhedrons() throw(SALOME_Exception); + int NbPolyhedrons() const throw(SALOME_Exception); - int NbSubMesh() throw(SALOME_Exception); + int NbSubMesh() const throw(SALOME_Exception); int NbGroup() const { return _mapGroup.size(); } diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 0ae03d0c5..e94a4a455 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -1123,7 +1123,7 @@ SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const TopoDS_Shape & S) const /////////////////////////////////////////////////////////////////////////////// /// Return the sub mesh by Id of shape it is linked to /////////////////////////////////////////////////////////////////////////////// -SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const int Index) +SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const int Index) const { TShapeIndexToSubMesh::const_iterator anIter = myShapeIndexToSubMesh.find(Index); if (anIter != myShapeIndexToSubMesh.end()) @@ -1136,10 +1136,10 @@ SMESHDS_SubMesh * SMESHDS_Mesh::MeshElements(const int Index) //function : SubMeshIndices //purpose : //======================================================================= -list SMESHDS_Mesh::SubMeshIndices() +list SMESHDS_Mesh::SubMeshIndices() const { list anIndices; - std::map::iterator anIter = myShapeIndexToSubMesh.begin(); + std::map::const_iterator anIter = myShapeIndexToSubMesh.begin(); for (; anIter != myShapeIndexToSubMesh.end(); anIter++) { anIndices.push_back((*anIter).first); } @@ -1183,7 +1183,7 @@ void SMESHDS_Mesh::ClearScript() //function : HasMeshElements //purpose : //======================================================================= -bool SMESHDS_Mesh::HasMeshElements(const TopoDS_Shape & S) +bool SMESHDS_Mesh::HasMeshElements(const TopoDS_Shape & S) const { if (myShape.IsNull()) MESSAGE("myShape is NULL"); int Index = myIndexToShape.FindIndex(S); diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 7e852c774..a6f5d66ad 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -411,10 +411,10 @@ public: const TopoDS_Shape & S); void UnSetMeshElementOnShape(const SMDS_MeshElement * anElt, const TopoDS_Shape & S); - bool HasMeshElements(const TopoDS_Shape & S); + bool HasMeshElements(const TopoDS_Shape & S) const; SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const; - SMESHDS_SubMesh * MeshElements(const int Index); - std::list SubMeshIndices(); + SMESHDS_SubMesh * MeshElements(const int Index) const; + std::list SubMeshIndices() const; const std::map& SubMeshes() const { return myShapeIndexToSubMesh; } -- 2.39.2