VTK  9.3.0
vtkDataSetCollection.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
20 #ifndef vtkDataSetCollection_h
21 #define vtkDataSetCollection_h
22 
23 #include "vtkCollection.h"
24 #include "vtkCommonDataModelModule.h" // For export macro
25 
26 #include "vtkDataSet.h" // Needed for inline methods.
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
39  void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
40 
42 
45  vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
46  vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
48 
50 
53  vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
54  vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
56 
62  {
63  return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
64  }
65 
66 protected:
67  vtkDataSetCollection() = default;
68  ~vtkDataSetCollection() override = default;
69 
70 private:
71  // hide the standard AddItem from the user and the compiler.
72  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
73 
75  void operator=(const vtkDataSetCollection&) = delete;
76 };
77 
78 VTK_ABI_NAMESPACE_END
79 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
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)
Get the ith dataset in the list.
vtkDataSet * GetNextDataSet()
Get the next dataset in the list.
vtkDataSetCollection()=default
vtkDataSet * GetNextDataSet(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
~vtkDataSetCollection() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkDataSetCollection * New()
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40