VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 #include "vtkPlane.h" // Needed for inline methods
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkPlaneCollection : public vtkCollection
27 {
28 public:
30  static vtkPlaneCollection* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  void AddItem(vtkPlane*);
37 
41  vtkPlane* GetNextItem();
42 
46  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
47 
52  vtkPlane* GetNextPlane(vtkCollectionSimpleIterator& cookie);
53 
54 protected:
55  vtkPlaneCollection() = default;
56  ~vtkPlaneCollection() 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  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
63  void operator=(const vtkPlaneCollection&) = delete;
64 };
65 
67 {
68  this->vtkCollection::AddItem(f);
69 }
70 
72 {
73  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
74 }
75 
76 VTK_ABI_NAMESPACE_END
77 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:35
vtkPlane * GetItem(int i)
Get the ith plane in the list.
abstract base class for most VTK objects
Definition: vtkObject.h:52
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 an empty collection.
perform various plane computations
Definition: vtkPlane.h:31
vtkObject * GetItemAsObject(int i) VTK_FUTURE_CONST
Get the i'th item in the collection.
vtkPlane * GetNextItem()
Get the next plane in the list.
void AddItem(vtkObject *)
Add given item to the bottom (end) of the collection.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:39
void AddItem(vtkPlane *)
Add a plane to the list.
#define VTK_MARSHALAUTO
vtkObject * GetNextItemAsObject()
Get the next item in the collection.