VTK: Common/Core/vtkIdListCollection.h Source File

| VTK 9.3.1

vtkIdListCollection.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkIdListCollection_h
15 #define vtkIdListCollection_h
16
17 #include "vtkCollection.h"
18 #include "vtkCommonCoreModule.h" // For export macro
19
20 #include "vtkIdList.h" // Needed for inline methods
21
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKCOMMONCORE_EXPORT vtkIdListCollection : public vtkCollection
24 {
25 public:
26 static vtkIdListCollection* New();
27 vtkTypeMacro(vtkIdListCollection, vtkCollection);
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
33 void AddItem(vtkIdList* ds) { this->vtkCollection::AddItem(ds); }
34
38 vtkIdList* GetNextItem() { return static_cast<vtkIdList*>(this->GetNextItemAsObject()); }
39
43 vtkIdList* GetItem(int i) { return static_cast<vtkIdList*>(this->GetItemAsObject(i)); }
44
49 vtkIdList* GetNextIdList(vtkCollectionSimpleIterator& cookie)
50 {
51 return static_cast<vtkIdList*>(this->GetNextItemAsObject(cookie));
52 }
53
54 protected:
55 vtkIdListCollection() = default;
56 ~vtkIdListCollection() override = default;
57
58 private:
59 // hide the standard AddItem from the user and the compiler.
60 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
61
62 vtkIdListCollection(const vtkIdListCollection&) = delete;
63 void operator=(const vtkIdListCollection&) = delete;
64 };
65
66 VTK_ABI_NAMESPACE_END
67 #endif
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkCollection::GetItemAsObject
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:177
vtkIdListCollection
maintain an ordered list of IdList objects
Definition: vtkIdListCollection.h:24
vtkIdListCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdListCollection::AddItem
void AddItem(vtkIdList *ds)
Add an IdList to the bottom of the list.
Definition: vtkIdListCollection.h:33
vtkIdListCollection::GetItem
vtkIdList * GetItem(int i)
Get the ith IdList in the list.
Definition: vtkIdListCollection.h:43
vtkIdListCollection::GetNextItem
vtkIdList * GetNextItem()
Get the next IdList in the list.
Definition: vtkIdListCollection.h:38
vtkIdListCollection::~vtkIdListCollection
~vtkIdListCollection() override=default
vtkIdListCollection::vtkIdListCollection
vtkIdListCollection()=default
vtkIdListCollection::GetNextIdList
vtkIdList * GetNextIdList(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkIdListCollection.h:49
vtkIdListCollection::New
static vtkIdListCollection * New()
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkCollection.h
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkIdList.h