VTK  9.4.20241221
vtkDataArrayCollection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
14#ifndef vtkDataArrayCollection_h
15#define vtkDataArrayCollection_h
16
17#include "vtkCollection.h"
18#include "vtkCommonCoreModule.h" // For export macro
19
20#include "vtkDataArray.h" // Needed for inline methods
21
22VTK_ABI_NAMESPACE_BEGIN
23class VTKCOMMONCORE_EXPORT vtkDataArrayCollection : public vtkCollection
24{
25public:
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
34
38 vtkDataArray* GetNextItem() { return static_cast<vtkDataArray*>(this->GetNextItemAsObject()); }
39
43 vtkDataArray* GetItem(int i) { return static_cast<vtkDataArray*>(this->GetItemAsObject(i)); }
44
50 {
51 return static_cast<vtkDataArray*>(this->GetNextItemAsObject(cookie));
52 }
53
54protected:
56 ~vtkDataArrayCollection() override = default;
57
58private:
59 // hide the standard AddItem from the user and the compiler.
60 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
61
63 void operator=(const vtkDataArrayCollection&) = delete;
64};
65
66VTK_ABI_NAMESPACE_END
67#endif
create and manipulate ordered lists of objects
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
maintain an ordered list of dataarray objects
~vtkDataArrayCollection() override=default
static vtkDataArrayCollection * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataArrayCollection()=default
vtkDataArray * GetItem(int i)
Get the ith dataarray in the list.
void AddItem(vtkDataArray *ds)
Add a dataarray to the bottom of the list.
vtkDataArray * GetNextDataArray(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkDataArray * GetNextItem()
Get the next dataarray in the list.
abstract superclass for arrays of numeric data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
void * vtkCollectionSimpleIterator