VTK  9.1.0
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=========================================================================*/
52#ifndef vtkDataSetCollection_h
53#define vtkDataSetCollection_h
54
55#include "vtkCollection.h"
56#include "vtkCommonDataModelModule.h" // For export macro
57
58#include "vtkDataSet.h" // Needed for inline methods.
59
60class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
70 void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
71
73
76 vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
77 vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
79
81
84 vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
85 vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
87
93 {
94 return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
95 }
96
97protected:
99 ~vtkDataSetCollection() override = default;
100
101private:
102 // hide the standard AddItem from the user and the compiler.
103 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
104
105private:
107 void operator=(const vtkDataSetCollection&) = delete;
108};
109
110#endif
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
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:166
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48