VTK: Common/DataModel/vtkDataSetCollection.h Source File

| VTK 9.3.1

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:
32 static vtkDataSetCollection* New();
33 vtkTypeMacro(vtkDataSetCollection, vtkCollection);
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
61 vtkDataSet* GetNextDataSet(vtkCollectionSimpleIterator& cookie)
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
74 vtkDataSetCollection(const vtkDataSetCollection&) = delete;
75 void operator=(const vtkDataSetCollection&) = delete;
76 };
77
78 VTK_ABI_NAMESPACE_END
79 #endif
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkCollection::GetItemAsObject
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:177
vtkDataSetCollection
maintain an unordered list of dataset objects
Definition: vtkDataSetCollection.h:30
vtkDataSetCollection::GetNextItem
vtkDataSet * GetNextItem()
Get the next dataset in the list.
Definition: vtkDataSetCollection.h:45
vtkDataSetCollection::GetItem
vtkDataSet * GetItem(int i)
Get the ith dataset in the list.
Definition: vtkDataSetCollection.h:53
vtkDataSetCollection::AddItem
void AddItem(vtkDataSet *ds)
Add a dataset to the bottom of the list.
Definition: vtkDataSetCollection.h:39
vtkDataSetCollection::GetDataSet
vtkDataSet * GetDataSet(int i)
Get the ith dataset in the list.
Definition: vtkDataSetCollection.h:54
vtkDataSetCollection::GetNextDataSet
vtkDataSet * GetNextDataSet()
Get the next dataset in the list.
Definition: vtkDataSetCollection.h:46
vtkDataSetCollection::vtkDataSetCollection
vtkDataSetCollection()=default
vtkDataSetCollection::GetNextDataSet
vtkDataSet * GetNextDataSet(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkDataSetCollection.h:61
vtkDataSetCollection::~vtkDataSetCollection
~vtkDataSetCollection() override=default
vtkDataSetCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataSetCollection::New
static vtkDataSetCollection * New()
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkCollection.h
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkDataSet.h