VTK  9.0.1
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 =========================================================================*/
23 #ifndef vtkDataSetCollection_h
24 #define vtkDataSetCollection_h
25 
26 #include "vtkCollection.h"
27 #include "vtkCommonDataModelModule.h" // For export macro
28 
29 #include "vtkDataSet.h" // Needed for inline methods.
30 
31 class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
32 {
33 public:
34  static vtkDataSetCollection* New();
36 
40  void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
41 
43 
46  vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
47  vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
49 
51 
54  vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
55  vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
57 
63  {
64  return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
65  }
66 
67 protected:
69  ~vtkDataSetCollection() override {}
70 
71 private:
72  // hide the standard AddItem from the user and the compiler.
73  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
74 
75 private:
77  void operator=(const vtkDataSetCollection&) = delete;
78 };
79 
80 #endif
81 // VTK-HeaderTest-Exclude: vtkDataSetCollection.h
vtkDataSetCollection::vtkDataSetCollection
vtkDataSetCollection()
Definition: vtkDataSetCollection.h:68
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkDataSetCollection::GetNextItem
vtkDataSet * GetNextItem()
Get the next dataset in the list.
Definition: vtkDataSetCollection.h:46
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkDataSetCollection::GetNextDataSet
vtkDataSet * GetNextDataSet(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkDataSetCollection.h:62
vtkDataSetCollection::GetDataSet
vtkDataSet * GetDataSet(int i)
Definition: vtkDataSetCollection.h:55
vtkCollection.h
vtkDataSetCollection::GetItem
vtkDataSet * GetItem(int i)
Get the ith dataset in the list.
Definition: vtkDataSetCollection.h:54
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkDataSetCollection::~vtkDataSetCollection
~vtkDataSetCollection() override
Definition: vtkDataSetCollection.h:69
vtkCollection::GetItemAsObject
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
vtkDataSet.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkDataSetCollection::GetNextDataSet
vtkDataSet * GetNextDataSet()
Definition: vtkDataSetCollection.h:47
vtkDataSetCollection
maintain an unordered list of dataset objects
Definition: vtkDataSetCollection.h:31
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkDataSetCollection::AddItem
void AddItem(vtkDataSet *ds)
Add a dataset to the bottom of the list.
Definition: vtkDataSetCollection.h:40