VTK
vtkIdListCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkIdListCollection.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 vtkIdListCollection_h
24 #define vtkIdListCollection_h
25 
26 #include "vtkCommonCoreModule.h" // For export macro
27 #include "vtkCollection.h"
28 
29 #include "vtkIdList.h" // Needed for inline methods
30 
31 class VTKCOMMONCORE_EXPORT vtkIdListCollection : public vtkCollection
32 {
33 public:
34  static vtkIdListCollection *New();
36 
40  void AddItem(vtkIdList *ds)
41  {
42  this->vtkCollection::AddItem(ds);
43  }
44 
49  return static_cast<vtkIdList *>(this->GetNextItemAsObject());};
50 
54  vtkIdList *GetItem(int i) {
55  return static_cast<vtkIdList *>(this->GetItemAsObject(i));};
56 
62  return static_cast<vtkIdList *>(this->GetNextItemAsObject(cookie));};
63 
64 protected:
66  ~vtkIdListCollection() override {}
67 
68 
69 private:
70  // hide the standard AddItem from the user and the compiler.
71  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
72 
73 private:
75  void operator=(const vtkIdListCollection&) = delete;
76 };
77 
78 
79 #endif
80 // VTK-HeaderTest-Exclude: vtkIdListCollection.h
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:44
abstract base class for most VTK objects
Definition: vtkObject.h:53
void AddItem(vtkIdList *ds)
Add an IdList to the bottom of the list.
vtkIdList * GetItem(int i)
Get the ith IdList in the list.
vtkIdList * GetNextIdList(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
list of point or cell ids
Definition: vtkIdList.h:30
static vtkCollection * New()
Construct with empty list.
vtkIdList * GetNextItem()
Get the next IdList in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
maintain an ordered list of IdList objects
create and manipulate ordered lists of objects
Definition: vtkCollection.h:48
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.