/*========================================================================= Program: Visualization Toolkit Module: vtkMappedUnstructuredGridCellIterator.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 "vtkMappedUnstructuredGridCellIterator.h" #include "vtkMappedUnstructuredGrid.h" #include "vtkObjectFactory.h" #include "vtkPoints.h" //------------------------------------------------------------------------------ template vtkMappedUnstructuredGridCellIterator* vtkMappedUnstructuredGridCellIterator::New() { VTK_STANDARD_NEW_BODY(ThisType) } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::PrintSelf(ostream &os, vtkIndent indent) { os << indent << "Implementation:"; if (this->Impl == nullptr) { os << " nullptr" << endl; } else { os << endl; this->Impl->PrintSelf(os, indent.GetNextIndent()); } os << indent << "GridPoints:"; if (this->GridPoints == nullptr) { os << " nullptr" << endl; } else { os << endl; this->GridPoints->PrintSelf(os, indent.GetNextIndent()); } } //------------------------------------------------------------------------------ template bool vtkMappedUnstructuredGridCellIterator ::IsDoneWithTraversal() { return this->CellId >= this->NumberOfCells; } //------------------------------------------------------------------------------ template vtkIdType vtkMappedUnstructuredGridCellIterator ::GetCellId() { return this->CellId; } //------------------------------------------------------------------------------ template vtkMappedUnstructuredGridCellIterator ::vtkMappedUnstructuredGridCellIterator() : Impl(nullptr), GridPoints(nullptr), CellId(0), NumberOfCells(0) { } //------------------------------------------------------------------------------ template vtkMappedUnstructuredGridCellIterator ::~vtkMappedUnstructuredGridCellIterator() { } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::ResetToFirstCell() { this->CellId = 0; } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::IncrementToNextCell() { ++this->CellId; } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::FetchCellType() { this->CellType = this->Impl->GetCellType(this->CellId); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::FetchPointIds() { this->Impl->GetCellPoints(this->CellId, this->PointIds); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::FetchPoints() { this->GridPoints->GetPoints(this->GetPointIds(), this->Points); } //------------------------------------------------------------------------------ template void vtkMappedUnstructuredGridCellIterator ::SetMappedUnstructuredGrid( vtkMappedUnstructuredGrid *grid) { this->Impl = grid->GetImplementation(); this->GridPoints = grid->GetPoints(); this->CellId = 0; this->NumberOfCells = grid->GetNumberOfCells(); if(this->GridPoints) { this->Points->SetDataType(this->GridPoints->GetDataType()); } }