/*========================================================================= Program: Visualization Toolkit Module: vtkMappedUnstructuredGrid.txx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkMappedUnstructuredGrid.h" #include "vtkGenericCell.h" #include //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::PrintSelf(ostream &os, vtkIndent indent) { os << indent << "Implementation:"; if (this->Impl == nullptr) { os << " nullptr" << endl; } else { os << endl; this->Impl->PrintSelf(os, indent.GetNextIndent()); } } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::CopyStructure(vtkDataSet *ds) { if (ThisType *grid = ThisType::SafeDownCast(ds)) { this->SetImplementation(grid->GetImplementation()); } this->Superclass::CopyStructure(ds); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::ShallowCopy(vtkDataObject *src) { if (ThisType *grid = ThisType::SafeDownCast(src)) { this->SetImplementation(grid->GetImplementation()); } this->Superclass::ShallowCopy(src); } //------------------------------------------------------------------------------ template vtkIdType vtkMappedUnstructuredGrid ::GetNumberOfCells() { return this->Impl->GetNumberOfCells(); } //------------------------------------------------------------------------------ template vtkCell* vtkMappedUnstructuredGrid ::GetCell(vtkIdType cellId) { this->GetCell(cellId, this->TempCell); return this->TempCell; } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::GetCell(vtkIdType cellId, vtkGenericCell *cell) { cell->SetCellType(this->Impl->GetCellType(cellId)); this->Impl->GetCellPoints(cellId, cell->PointIds); this->Points->GetPoints(cell->PointIds, cell->Points); if (cell->RequiresInitialization()) { cell->Initialize(); } } //------------------------------------------------------------------------------ template int vtkMappedUnstructuredGrid ::GetCellType(vtkIdType cellId) { return this->Impl->GetCellType(cellId); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) { this->Impl->GetCellPoints(cellId, ptIds); } //------------------------------------------------------------------------------ template vtkCellIterator *vtkMappedUnstructuredGrid ::NewCellIterator() { CellIteratorType *cellIterator = CellIteratorType::New(); cellIterator->SetMappedUnstructuredGrid(this); return cellIterator; } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::GetPointCells(vtkIdType ptId, vtkIdList *cellIds) { this->Impl->GetPointCells(ptId, cellIds); } //------------------------------------------------------------------------------ template int vtkMappedUnstructuredGrid ::GetMaxCellSize() { return this->Impl->GetMaxCellSize(); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::GetIdsOfCellsOfType(int type, vtkIdTypeArray *array) { this->Impl->GetIdsOfCellsOfType(type, array); } //------------------------------------------------------------------------------ template int vtkMappedUnstructuredGrid ::IsHomogeneous() { return this->Impl->IsHomogeneous(); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::Allocate(vtkIdType numCells, int) { return this->Impl->Allocate(numCells); } //------------------------------------------------------------------------------ template vtkIdType vtkMappedUnstructuredGrid ::InsertNextCell(int type, vtkIdList *ptIds) { return this->Impl->InsertNextCell(type, ptIds); } //------------------------------------------------------------------------------ template vtkIdType vtkMappedUnstructuredGrid ::InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds) { return this->Impl->InsertNextCell(type, npts, ptIds); } //------------------------------------------------------------------------------ template vtkIdType vtkMappedUnstructuredGrid ::InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds, vtkIdType nfaces, vtkIdType *faces) { return this->Impl->InsertNextCell(type, npts, ptIds, nfaces, faces); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts) { this->Impl->ReplaceCell(cellId, npts, pts); } //------------------------------------------------------------------------------ template vtkMTimeType vtkMappedUnstructuredGrid ::GetMTime() { return std::max(this->MTime.GetMTime(), this->Impl->GetMTime()); } //------------------------------------------------------------------------------ template vtkMappedUnstructuredGrid:: vtkMappedUnstructuredGrid() : Impl(nullptr) { } //------------------------------------------------------------------------------ template vtkMappedUnstructuredGrid:: ~vtkMappedUnstructuredGrid() { } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGrid ::SetImplementation(Implementation *impl) { this->Impl = impl; this->Modified(); } //------------------------------------------------------------------------------ template Implementation* vtkMappedUnstructuredGrid ::GetImplementation() { return this->Impl; }