VTK  9.3.20240328
vtkPolyDataCollection.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
43 #ifndef vtkPolyDataCollection_h
44 #define vtkPolyDataCollection_h
45 
46 #include "vtkCollection.h"
47 #include "vtkCommonDataModelModule.h" // For export macro
48 
49 #include "vtkPolyData.h" // Needed for static cast
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 class VTKCOMMONDATAMODEL_EXPORT vtkPolyDataCollection : public vtkCollection
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
62  void AddItem(vtkPolyData* pd) { this->vtkCollection::AddItem(pd); }
63 
67  vtkPolyData* GetNextItem() { return static_cast<vtkPolyData*>(this->GetNextItemAsObject()); }
68 
74  {
75  return static_cast<vtkPolyData*>(this->GetNextItemAsObject(cookie));
76  }
77 
78 protected:
79  vtkPolyDataCollection() = default;
80  ~vtkPolyDataCollection() override = default;
81 
82 private:
83  // hide the standard AddItem from the user and the compiler.
84  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
85 
87  void operator=(const vtkPolyDataCollection&) = delete;
88 };
89 
90 VTK_ABI_NAMESPACE_END
91 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
maintain a list of polygonal data objects
vtkPolyData * GetNextPolyData(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void AddItem(vtkPolyData *pd)
Add a poly data to the bottom of the list.
vtkPolyDataCollection()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyData * GetNextItem()
Get the next poly data in the list.
static vtkPolyDataCollection * New()
~vtkPolyDataCollection() override=default
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40