VTK  9.3.1
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
16 #ifndef vtkPlaneCollection_h
17 #define vtkPlaneCollection_h
18 
19 #include "vtkCollection.h"
20 #include "vtkCommonDataModelModule.h" // For export macro
21 
22 #include "vtkPlane.h" // Needed for inline methods
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKCOMMONDATAMODEL_EXPORT vtkPlaneCollection : public vtkCollection
26 {
27 public:
29  static vtkPlaneCollection* New();
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
35  void AddItem(vtkPlane*);
36 
40  vtkPlane* GetNextItem();
41 
45  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
46 
51  vtkPlane* GetNextPlane(vtkCollectionSimpleIterator& cookie);
52 
53 protected:
54  vtkPlaneCollection() = default;
55  ~vtkPlaneCollection() override = default;
56 
57 private:
58  // hide the standard AddItem from the user and the compiler.
59  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
60 
61  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
62  void operator=(const vtkPlaneCollection&) = delete;
63 };
64 
66 {
67  this->vtkCollection::AddItem(f);
68 }
69 
71 {
72  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
73 }
74 
75 VTK_ABI_NAMESPACE_END
76 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkPlane * GetItem(int i)
Get the ith plane in the list.
abstract base class for most VTK objects
Definition: vtkObject.h:51
maintain a list of planes
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCollection * New()
Construct with empty list.
perform various plane computations
Definition: vtkPlane.h:25
vtkPlane * GetNextItem()
Get the next plane in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
void AddItem(vtkPlane *)
Add a plane to the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.