/*========================================================================= Program: Visualization Toolkit Module: vtkArrayIteratorTemplate.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. =========================================================================*/ #ifndef vtkArrayIteratorTemplate_txx #define vtkArrayIteratorTemplate_txx #include "vtkArrayIteratorTemplate.h" #include "vtkAbstractArray.h" #include "vtkObjectFactory.h" //----------------------------------------------------------------------------- template vtkArrayIteratorTemplate* vtkArrayIteratorTemplate::New() { VTK_STANDARD_NEW_BODY(vtkArrayIteratorTemplate); } template vtkCxxSetObjectMacro(vtkArrayIteratorTemplate, Array, vtkAbstractArray); //----------------------------------------------------------------------------- template vtkArrayIteratorTemplate::vtkArrayIteratorTemplate() { this->Array = nullptr; this->Pointer = nullptr; } //----------------------------------------------------------------------------- template vtkArrayIteratorTemplate::~vtkArrayIteratorTemplate() { this->SetArray(nullptr); this->Pointer = nullptr; } //----------------------------------------------------------------------------- template void vtkArrayIteratorTemplate::Initialize(vtkAbstractArray* a) { this->SetArray(a); this->Pointer = nullptr; if (this->Array) { this->Pointer = static_cast(this->Array->GetVoidPointer(0)); } } //----------------------------------------------------------------------------- template vtkIdType vtkArrayIteratorTemplate::GetNumberOfTuples() { if (this->Array) { return this->Array->GetNumberOfTuples(); } return 0; } //----------------------------------------------------------------------------- template vtkIdType vtkArrayIteratorTemplate::GetNumberOfValues() { if (this->Array) { return (this->Array->GetNumberOfTuples() * this->Array->GetNumberOfComponents()); } return 0; } //----------------------------------------------------------------------------- template int vtkArrayIteratorTemplate::GetNumberOfComponents() { if (this->Array) { return this->Array->GetNumberOfComponents(); } return 0; } //----------------------------------------------------------------------------- template T* vtkArrayIteratorTemplate::GetTuple(vtkIdType id) { return &this->Pointer[id * this->Array->GetNumberOfComponents()]; } //----------------------------------------------------------------------------- template int vtkArrayIteratorTemplate::GetDataType() const { return this->Array->GetDataType(); } //----------------------------------------------------------------------------- template int vtkArrayIteratorTemplate::GetDataTypeSize() const { return this->Array->GetDataTypeSize(); } //----------------------------------------------------------------------------- template void vtkArrayIteratorTemplate::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); os << indent << "Array: "; if (this->Array) { os << "\n"; this->Array->PrintSelf(os, indent.GetNextIndent()); } else { os << "(none)" << "\n"; } } #endif