if ( vtkID > this->MaxId )
{
this->MaxId = vtkID;
- if ( vtkID >= this->Size )
+ if ( vtkID >= this->Size )
vtkCellLinks::Resize( vtkID+SMDS_Mesh::chunkSize );
}
}
vtkIdType j, cellId = 0;
unsigned short *linkLoc;
vtkIdType npts=0;
- vtkIdType *pts=0;
+ vtkIdType const *pts(nullptr);
vtkIdType loc = Connectivity->GetTraversalLocation();
// traverse data to determine number of uses of each point
{
if ( setOfNodes.insert( pts[i] ).second )
{
- this->Links->ResizeCellList( pts[i], 1 );
- this->Links->AddCellReference( cellid, pts[i] );
+ (static_cast< vtkCellLinks * >(this->Links.GetPointer()))->ResizeCellList( pts[i], 1 );
+ (static_cast< vtkCellLinks * >(this->Links.GetPointer()))->AddCellReference( cellid, pts[i] );
}
i++;
}
if ( false /*!updateCells*/ ) // no holes in elements
{
this->Connectivity->Squeeze();
- this->Locations->Squeeze();
+ this->CellLocations->Squeeze();
this->Types->Squeeze();
if ( this->FaceLocations )
{
if ( newCellSize != oldCellSize )
for ( int i = 0; i < oldCellSize - 1; ++i )
if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL )
- newConnectivitySize -= this->Locations->GetValue( i+1 ) - this->Locations->GetValue( i );
+ newConnectivitySize -= this->CellLocations->GetValue( i+1 ) - this->CellLocations->GetValue( i );
vtkCellArray *newConnectivity = vtkCellArray::New();
newConnectivity->Initialize();
newFaceLocations->Squeeze();
newFaces->Squeeze();
this->SetCells( newTypes, newLocations, newConnectivity, newFaceLocations, newFaces );
+ this->CellLocations = newLocations;
newFaceLocations->Delete();
newFaces->Delete();
}
else
{
this->SetCells( newTypes, newLocations, newConnectivity, FaceLocations, Faces );
+ this->CellLocations = newLocations;
}
newTypes->Delete();
{
int iOld = idCellsNewToOld[ iNew ];
newTypes->SetValue( iNew, this->Types->GetValue( iOld ));
- vtkIdType oldLoc = this->Locations->GetValue( iOld );
+
+ vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld );
vtkIdType nbpts;
- vtkIdType *oldPtsCell = 0;
- this->Connectivity->GetCell( oldLoc, nbpts, oldPtsCell );
+ vtkIdType const *oldPtsCell(nullptr);
+ this->Connectivity->GetCell( oldLoc+iOld, nbpts, oldPtsCell );
if ((vtkIdType) pointsCell.size() < nbpts )
pointsCell.resize( nbpts );
for ( int l = 0; l < nbpts; l++ )
void SMDS_UnstructuredGrid::ModifyCellNodes(int vtkVolId, std::map<int, int> localClonedNodeIds)
{
vtkIdType npts = 0;
- vtkIdType *pts; // will refer to the point id's of the face
- this->GetCellPoints(vtkVolId, npts, pts);
+ vtkIdType const *tmp(nullptr); // will refer to the point id's of the face
+ vtkIdType *pts; // will refer to the point id's of the face
+ this->GetCellPoints(vtkVolId, npts, tmp);
+ std::copy(tmp, tmp+npts, pts);
for (int i = 0; i < npts; i++)
{
if (localClonedNodeIds.count(pts[i]))
SMDS_CellLinks* links;
this->Links = links = SMDS_CellLinks::New();
- this->Links->Allocate(this->GetNumberOfPoints());
+ (static_cast< vtkCellLinks *>(this->Links.GetPointer()))->Allocate(this->GetNumberOfPoints());
this->Links->Register(this);
links->BuildLinks(this, this->Connectivity,this->GetCellTypesArray() );
this->Links->Delete();
{
if ( !this->Links )
BuildLinks();
- return static_cast< SMDS_CellLinks* >( this->Links );
+ return static_cast< SMDS_CellLinks* >( this->Links.GetPointer() );
}
/*! Create a volume (prism or hexahedron) by duplication of a face.
return vtkDoubleArray::SafeDownCast( vtkDataSet::CellData->GetScalars() )->GetValue( vtkID );
return 0;
}
-