VTK  9.0.3
vtkDataSetCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataSetCollection.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 vtkDataSetCollection_h
24 #define vtkDataSetCollection_h
25 
26 #include "vtkCollection.h"
27 #include "vtkCommonDataModelModule.h" // For export macro
28 
29 #include "vtkDataSet.h" // Needed for inline methods.
30 
31 class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
32 {
33 public:
36 
40  void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
41 
43 
46  vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
47  vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
49 
51 
54  vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
55  vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
57 
63  {
64  return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
65  }
66 
67 protected:
69  ~vtkDataSetCollection() override {}
70 
71 private:
72  // hide the standard AddItem from the user and the compiler.
73  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
74 
75 private:
77  void operator=(const vtkDataSetCollection&) = delete;
78 };
79 
80 #endif
81 // VTK-HeaderTest-Exclude: vtkDataSetCollection.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 unordered list of dataset objects
vtkDataSet * GetNextItem()
Get the next dataset in the list.
vtkDataSet * GetItem(int i)
Get the ith dataset in the list.
void AddItem(vtkDataSet *ds)
Add a dataset to the bottom of the list.
vtkDataSet * GetDataSet(int i)
vtkDataSet * GetNextDataSet()
vtkDataSet * GetNextDataSet(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
static vtkDataSetCollection * New()
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
abstract base class for most VTK objects
Definition: vtkObject.h:63
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48