]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020183: EDF SMESH 966 : Mesh element info anomaly
authoreap <eap@opencascade.com>
Fri, 27 Feb 2009 11:26:14 +0000 (11:26 +0000)
committereap <eap@opencascade.com>
Fri, 27 Feb 2009 11:26:14 +0000 (11:26 +0000)
  fix GetElemObjId() and GetNodeObjId: prevent out_of_range error if id==vector.size()

src/OBJECT/SMESH_ExtractGeometry.cxx

index cebedd549c76b0f6a80f802caeabd106b246fd06..0376aba38567c85db8c9d8e8e7a3967d46030a23 100644 (file)
@@ -58,22 +58,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry(){}
 
 
 vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID){
-  if(myElemVTK2ObjIds.empty() || theVtkID > myElemVTK2ObjIds.size()) return -1;
-#if defined __GNUC_2__
+  if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1;
   return myElemVTK2ObjIds[theVtkID];
-#else
-  return myElemVTK2ObjIds.at(theVtkID);
-#endif
 }
 
 
 vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID){
-  if(myNodeVTK2ObjIds.empty() || theVtkID > myNodeVTK2ObjIds.size()) return -1;
-#if defined __GNUC_2__
+  if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1;
   return myNodeVTK2ObjIds[theVtkID];
-#else
-  return myNodeVTK2ObjIds.at(theVtkID);
-#endif
 }