-// Copyright (C) 2010-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#define CHRONODEF
#include "SMDS_UnstructuredGrid.hxx"
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshInfo.hxx"
return new SMDS_CellLinks();
}
-vtkCellLinks::Link* SMDS_CellLinks::ResizeL(vtkIdType sz)
+void SMDS_CellLinks::ResizeForPoint(vtkIdType vtkID)
{
- return vtkCellLinks::Resize(sz);
-}
-
-vtkIdType SMDS_CellLinks::GetLinksSize()
-{
- return this->Size;
+ if ( vtkID > this->MaxId )
+ {
+ this->MaxId = vtkID;
+ if ( vtkID >= this->Size )
+ vtkCellLinks::Resize( vtkID+SMDS_Mesh::chunkSize );
+ }
}
SMDS_CellLinks::SMDS_CellLinks() :
MESSAGE("vtkUnstructuredGrid::GetMTime: " << mtime);
return mtime;
}
-
+// OUV_PORTING_VTK6: seems to be useless
+/*
void SMDS_UnstructuredGrid::Update()
{
MESSAGE("SMDS_UnstructuredGrid::Update");
MESSAGE("SMDS_UnstructuredGrid::UpdateInformation");
return vtkUnstructuredGrid::UpdateInformation();
}
-
+*/
vtkPoints* SMDS_UnstructuredGrid::GetPoints()
{
// TODO erreur incomprehensible de la macro vtk GetPoints apparue avec la version paraview de fin aout 2010
void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize,
std::vector<int>& idCellsOldToNew, int newCellSize)
{
- MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);CHRONO(1);
+ MESSAGE("------------------------- SMDS_UnstructuredGrid::compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1);
int alreadyCopied = 0;
// --- if newNodeSize, create a new compacted vtkPoints
* @param vtkId the vtk id of the cell
* @return number of neighbors
*/
-int SMDS_UnstructuredGrid::GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId)
+int SMDS_UnstructuredGrid::GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin)
{
int vtkType = this->GetCellType(vtkId);
int cellDim = SMDS_Downward::getCellDimension(vtkType);
downIds[nb] = downId;
downTypes[nb] = cellType;
nb++;
+ if (nb >= NBMAXNEIGHBORS)
+ {
+ INFOS("SMDS_UnstructuredGrid::GetNeighbors problem: NBMAXNEIGHBORS=" <<NBMAXNEIGHBORS << " not enough");
+ return nb;
+ }
+ }
+ if (getSkin)
+ {
+ if (cellDim == 3 && nbUp == 1) // this face is on the skin of the volume
+ {
+ neighborsVtkIds[nb] = _downArray[cellType]->getVtkCellId(downId); // OK if skin present
+ downIds[nb] = downId;
+ downTypes[nb] = cellType;
+ nb++;
+ if (nb >= NBMAXNEIGHBORS)
+ {
+ INFOS("SMDS_UnstructuredGrid::GetNeighbors problem: NBMAXNEIGHBORS=" <<NBMAXNEIGHBORS << " not enough");
+ return nb;
+ }
+ }
}
- if (nb >= NBMAXNEIGHBORS)
- assert(0);
}
return nb;
}