Salome HOME
0021422: EDF 1963 SMESH: Viscous layer algorithm fails in some cases
[modules/smesh.git] / src / SMDS / SMDS_MeshElementIDFactory.cxx
index 1abf9e81f24928a9d0c42c65c1d3cdc6f624d1c5..6c86e6f28b5137f7bb650ea52f7b5a06ae65a0e4 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 //  SMESH SMDS : implementaion of Salome mesh data structure
@@ -38,6 +38,8 @@
 #include "SMDS_UnstructuredGrid.hxx"
 #include <vtkCellType.h>
 
+#include <climits>
+
 using namespace std;
 
 //=======================================================================
@@ -95,7 +97,8 @@ int SMDS_MeshElementIDFactory::SetInVtkGrid(SMDS_MeshElement * elem)
   // --- insert cell in vtkUnstructuredGrid
 
   vtkUnstructuredGrid * grid = myMesh->getGrid();
-  int typ = GetVtkCellType(elem->GetType());
+  //int locType = elem->GetType();
+  int typ = VTK_VERTEX;//GetVtkCellType(locType);
   int cellId = grid->InsertNextLinkedCell(typ, nodeIds.size(), &nodeIds[0]);
   cell->setVtkId(cellId); 
   //MESSAGE("SMDS_MeshElementIDFactory::SetInVtkGrid " << cellId);
@@ -172,7 +175,7 @@ void SMDS_MeshElementIDFactory::ReleaseID(int ID, int vtkId)
 
 void SMDS_MeshElementIDFactory::updateMinMax() const
 {
-  myMin = IntegerLast();
+  myMin = INT_MAX;
   myMax = 0;
   for (int i = 0; i < myMesh->myCells.size(); i++)
     {
@@ -185,7 +188,7 @@ void SMDS_MeshElementIDFactory::updateMinMax() const
             myMin = id;
         }
     }
-  if (myMin == IntegerLast())
+  if (myMin == INT_MAX)
     myMin = 0;
 }