VTK  9.2.6
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 
40 class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
41 {
42 public:
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 
77 protected:
78  vtkDataSetCollection() = default;
79  ~vtkDataSetCollection() override = default;
80 
81 private:
82  // hide the standard AddItem from the user and the compiler.
83  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
84 
85 private:
87  void operator=(const vtkDataSetCollection&) = delete;
88 };
89 
90 #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:72
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51