VTK  9.3.0
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
14 #ifndef vtkPolyDataCollection_h
15 #define vtkPolyDataCollection_h
16 
17 #include "vtkCollection.h"
18 #include "vtkCommonDataModelModule.h" // For export macro
19 
20 #include "vtkPolyData.h" // Needed for static cast
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKCOMMONDATAMODEL_EXPORT vtkPolyDataCollection : public vtkCollection
24 {
25 public:
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
33  void AddItem(vtkPolyData* pd) { this->vtkCollection::AddItem(pd); }
34 
38  vtkPolyData* GetNextItem() { return static_cast<vtkPolyData*>(this->GetNextItemAsObject()); }
39 
45  {
46  return static_cast<vtkPolyData*>(this->GetNextItemAsObject(cookie));
47  }
48 
49 protected:
50  vtkPolyDataCollection() = default;
51  ~vtkPolyDataCollection() override = default;
52 
53 private:
54  // hide the standard AddItem from the user and the compiler.
55  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
56 
58  void operator=(const vtkPolyDataCollection&) = delete;
59 };
60 
61 VTK_ABI_NAMESPACE_END
62 #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:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:80
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40