VTK  9.2.6
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 =========================================================================*/
26 #ifndef vtkDataArrayCollection_h
27 #define vtkDataArrayCollection_h
28 
29 #include "vtkCollection.h"
30 #include "vtkCommonCoreModule.h" // For export macro
31 
32 #include "vtkDataArray.h" // Needed for inline methods
33 
34 class VTKCOMMONCORE_EXPORT vtkDataArrayCollection : public vtkCollection
35 {
36 public:
37  static vtkDataArrayCollection* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void AddItem(vtkDataArray* ds) { this->vtkCollection::AddItem(ds); }
45 
49  vtkDataArray* GetNextItem() { return static_cast<vtkDataArray*>(this->GetNextItemAsObject()); }
50 
54  vtkDataArray* GetItem(int i) { return static_cast<vtkDataArray*>(this->GetItemAsObject(i)); }
55 
61  {
62  return static_cast<vtkDataArray*>(this->GetNextItemAsObject(cookie));
63  }
64 
65 protected:
66  vtkDataArrayCollection() = default;
67  ~vtkDataArrayCollection() override = default;
68 
69 private:
70  // hide the standard AddItem from the user and the compiler.
71  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
72 
73 private:
75  void operator=(const vtkDataArrayCollection&) = delete;
76 };
77 
78 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkDataArray * GetItem(int i)
Get the ith dataarray in the list.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCollection * New()
Construct with empty list.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:55
maintain an ordered list of dataarray objects
vtkDataArray * GetNextDataArray(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkDataArray * GetNextItem()
Get the next dataarray in the list.
void AddItem(vtkDataArray *ds)
Add a dataarray to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.