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
11#ifndef vtkDataSetCollection_h
12#define vtkDataSetCollection_h
13
14#include "vtkCollection.h"
15#include "vtkCommonDataModelModule.h" // For export macro
16
17#include "vtkDataSet.h" // Needed for inline methods.
18
19VTK_ABI_NAMESPACE_BEGIN
20class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
21{
22public:
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
30 void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
31
33
36 vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
37 vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
39
41
44 vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
45 vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
47
53 {
54 return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
55 }
56
57protected:
59 ~vtkDataSetCollection() override = default;
60
61private:
62 // hide the standard AddItem from the user and the compiler.
63 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
64
66 void operator=(const vtkDataSetCollection&) = delete;
67};
68
69VTK_ABI_NAMESPACE_END
70#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 unordered list of dataset objects
void AddItem(vtkDataSet *ds)
Add a dataset to the bottom of the list.
vtkDataSet * GetNextDataSet(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkDataSet * GetNextDataSet()
Get the next dataset in the list.
vtkDataSet * GetDataSet(int i)
Get the ith dataset in the list.
vtkDataSet * GetItem(int i)
Get the ith dataset in the list.
vtkDataSetCollection()=default
static vtkDataSetCollection * New()
~vtkDataSetCollection() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataSet * GetNextItem()
Get the next dataset in the list.
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
void * vtkCollectionSimpleIterator