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 =========================================================================*/
23 #ifndef vtkDataObjectCollection_h
24 #define vtkDataObjectCollection_h
25 
26 #include "vtkCommonDataModelModule.h" // For export macro
27 #include "vtkCollection.h"
28 
29 #include "vtkDataObject.h" // Needed for inline methods
30 
31 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectCollection : public vtkCollection
32 {
33 public:
34  static vtkDataObjectCollection *New();
36 
41  {
42  this->vtkCollection::AddItem(ds);
43  }
44 
49  {
50  return static_cast<vtkDataObject *>(this->GetNextItemAsObject());
51  }
52 
57  {
58  return static_cast<vtkDataObject *>(this->GetItemAsObject(i));
59  }
60 
66  {
67  return static_cast<vtkDataObject *>(this->GetNextItemAsObject(cookie));
68  }
69 
70 protected:
73 
74 
75 private:
76  // hide the standard AddItem from the user and the compiler.
77  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
78 
79 private:
81  void operator=(const vtkDataObjectCollection&) = delete;
82 };
83 
84 
85 #endif
86 // VTK-HeaderTest-Exclude: vtkDataObjectCollection.h
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:44
vtkDataObject * GetNextDataObject(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkDataObject * GetItem(int i)
Get the ith data object in the list.
maintain an unordered list of data objects
static vtkCollection * New()
Construct with empty list.
vtkDataObject * GetNextItem()
Get the next data object in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:48
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
general representation of visualization data
Definition: vtkDataObject.h:58
vtkObject * GetItemAsObject(int i)
Get the i&#39;th item in the collection.
void AddItem(vtkDataObject *ds)
Add a data object to the bottom of the list.