VTK  9.0.3
vtkDataArrayCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataArrayCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkDataArrayCollection_h
24 #define vtkDataArrayCollection_h
25 
26 #include "vtkCollection.h"
27 #include "vtkCommonCoreModule.h" // For export macro
28 
29 #include "vtkDataArray.h" // Needed for inline methods
30 
31 class VTKCOMMONCORE_EXPORT vtkDataArrayCollection : public vtkCollection
32 {
33 public:
36 
40  void AddItem(vtkDataArray* ds) { this->vtkCollection::AddItem(ds); }
41 
45  vtkDataArray* GetNextItem() { return static_cast<vtkDataArray*>(this->GetNextItemAsObject()); }
46 
50  vtkDataArray* GetItem(int i) { return static_cast<vtkDataArray*>(this->GetItemAsObject(i)); }
51 
57  {
58  return static_cast<vtkDataArray*>(this->GetNextItemAsObject(cookie));
59  }
60 
61 protected:
64 
65 private:
66  // hide the standard AddItem from the user and the compiler.
67  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
68 
69 private:
71  void operator=(const vtkDataArrayCollection&) = delete;
72 };
73 
74 #endif
75 // VTK-HeaderTest-Exclude: vtkDataArrayCollection.h
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
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
static vtkDataArrayCollection * New()
vtkDataArray * GetNextItem()
Get the next dataarray in the list.
void AddItem(vtkDataArray *ds)
Add a dataarray to the bottom of the list.
vtkDataArray * GetItem(int i)
Get the ith dataarray in the list.
vtkDataArray * GetNextDataArray(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
abstract base class for most VTK objects
Definition: vtkObject.h:63
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48