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=========================================================================*/
32#ifndef vtkDataSetCollection_h
33#define vtkDataSetCollection_h
34
35#include "vtkCollection.h"
36#include "vtkCommonDataModelModule.h" // For export macro
37
38#include "vtkDataSet.h" // Needed for inline methods.
39
40class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
50 void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
51
53
56 vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
57 vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
59
61
64 vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
65 vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
67
73 {
74 return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
75 }
76
77protected:
79 ~vtkDataSetCollection() override = default;
80
81private:
82 // hide the standard AddItem from the user and the compiler.
83 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
84
85private:
87 void operator=(const vtkDataSetCollection&) = delete;
88};
89
90#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:66
a simple class to control print indentation
Definition: vtkIndent.h:43
abstract base class for most VTK objects
Definition: vtkObject.h:63
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48