/*========================================================================= 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() { vtkObject* ret = vtkObjectFactory::CreateInstance("vtkArrayIteratorTemplate"); if (ret) { return static_cast*> (ret); } return new vtkArrayIteratorTemplate; } template vtkCxxSetObjectMacro(vtkArrayIteratorTemplate, Array, vtkAbstractArray); //----------------------------------------------------------------------------- template vtkArrayIteratorTemplate::vtkArrayIteratorTemplate() { this->Array = 0; this->Pointer = 0; } //----------------------------------------------------------------------------- template vtkArrayIteratorTemplate::~vtkArrayIteratorTemplate() { this->SetArray(0); this->Pointer = 0; } //----------------------------------------------------------------------------- template void vtkArrayIteratorTemplate::Initialize(vtkAbstractArray* a) { this->SetArray(a); this->Pointer = 0; 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() { return this->Array->GetDataType(); } //----------------------------------------------------------------------------- template int vtkArrayIteratorTemplate::GetDataTypeSize() { 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