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=========================================================================*/
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
31class VTKCOMMONDATAMODEL_EXPORT vtkDataSetCollection : public vtkCollection
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
41 void AddItem(vtkDataSet* ds) { this->vtkCollection::AddItem(ds); }
42
44
47 vtkDataSet* GetNextItem() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
48 vtkDataSet* GetNextDataSet() { return static_cast<vtkDataSet*>(this->GetNextItemAsObject()); }
50
52
55 vtkDataSet* GetItem(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
56 vtkDataSet* GetDataSet(int i) { return static_cast<vtkDataSet*>(this->GetItemAsObject(i)); }
58
64 {
65 return static_cast<vtkDataSet*>(this->GetNextItemAsObject(cookie));
66 }
67
68protected:
70 ~vtkDataSetCollection() override = default;
71
72private:
73 // hide the standard AddItem from the user and the compiler.
74 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
75
76private:
78 void operator=(const vtkDataSetCollection&) = delete;
79};
80
81#endif
create and manipulate ordered lists of objects
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:63
a simple class to control print indentation
Definition vtkIndent.h:40
abstract base class for most VTK objects
Definition vtkObject.h:63
void * vtkCollectionSimpleIterator