VTK  9.2.5
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 
60 class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
61 {
62 public:
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 
97 protected:
98  vtkDataSetCollection() = default;
99  ~vtkDataSetCollection() override = default;
100 
101 private:
102  // hide the standard AddItem from the user and the compiler.
103  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
104 
105 private:
107  void operator=(const vtkDataSetCollection&) = delete;
108 };
109 
110 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:56
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:172
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51