VTK
vtkDataObjectCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataObjectCollection.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 =========================================================================*/
26 #ifndef vtkDataObjectCollection_h
27 #define vtkDataObjectCollection_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkCollection.h"
31 
32 #include "vtkDataObject.h" // Needed for inline methods
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectCollection : public vtkCollection
35 {
36 public:
37  static vtkDataObjectCollection *New();
39 
44  {
45  this->vtkCollection::AddItem(ds);
46  }
47 
52  {
53  return static_cast<vtkDataObject *>(this->GetNextItemAsObject());
54  }
55 
60  {
61  return static_cast<vtkDataObject *>(this->GetItemAsObject(i));
62  }
63 
69  {
70  return static_cast<vtkDataObject *>(this->GetNextItemAsObject(cookie));
71  }
72 
73 protected:
76 
77 
78 private:
79  // hide the standard AddItem from the user and the compiler.
80  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
81 
82 private:
84  void operator=(const vtkDataObjectCollection&) = delete;
85 };
86 
87 
88 #endif
89 // VTK-HeaderTest-Exclude: vtkDataObjectCollection.h
vtkDataObjectCollection::GetItem
vtkDataObject * GetItem(int i)
Get the ith data object in the list.
Definition: vtkDataObjectCollection.h:59
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
vtkDataObjectCollection
maintain an unordered list of data objects
Definition: vtkDataObjectCollection.h:34
vtkDataObjectCollection::AddItem
void AddItem(vtkDataObject *ds)
Add a data object to the bottom of the list.
Definition: vtkDataObjectCollection.h:43
vtkCollection.h
vtkDataObjectCollection::~vtkDataObjectCollection
~vtkDataObjectCollection() override
Definition: vtkDataObjectCollection.h:75
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:177
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
vtkDataObjectCollection::vtkDataObjectCollection
vtkDataObjectCollection()
Definition: vtkDataObjectCollection.h:74
vtkDataObjectCollection::GetNextItem
vtkDataObject * GetNextItem()
Get the next data object in the list.
Definition: vtkDataObjectCollection.h:51
vtkCollection::GetItemAsObject
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
vtkDataObject.h
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDataObjectCollection::GetNextDataObject
vtkDataObject * GetNextDataObject(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkDataObjectCollection.h:68