VTK  9.3.20240328
vtkPlaneCollection.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
35 #ifndef vtkPlaneCollection_h
36 #define vtkPlaneCollection_h
37 
38 #include "vtkCollection.h"
39 #include "vtkCommonDataModelModule.h" // For export macro
40 
41 #include "vtkPlane.h" // Needed for inline methods
42 
43 VTK_ABI_NAMESPACE_BEGIN
44 class VTKCOMMONDATAMODEL_EXPORT vtkPlaneCollection : public vtkCollection
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
54  void AddItem(vtkPlane*);
55 
59  vtkPlane* GetNextItem();
60 
64  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
65 
71 
72 protected:
73  vtkPlaneCollection() = default;
74  ~vtkPlaneCollection() override = default;
75 
76 private:
77  // hide the standard AddItem from the user and the compiler.
78  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
79 
80  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
81  void operator=(const vtkPlaneCollection&) = delete;
82 };
83 
85 {
86  this->vtkCollection::AddItem(f);
87 }
88 
90 {
91  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
92 }
93 
94 VTK_ABI_NAMESPACE_END
95 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
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 planes
vtkPlane * GetNextItem()
Get the next plane in the list.
vtkPlaneCollection()=default
static vtkPlaneCollection * New()
vtkPlane * GetNextPlane(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
~vtkPlaneCollection() override=default
vtkPlane * GetItem(int i)
Get the ith plane in the list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void AddItem(vtkPlane *)
Add a plane to the list.
perform various plane computations
Definition: vtkPlane.h:135
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40