VTK  9.2.6
vtkPlaneCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlaneCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkPlaneCollection_h
29 #define vtkPlaneCollection_h
30 
31 #include "vtkCollection.h"
32 #include "vtkCommonDataModelModule.h" // For export macro
33 
34 #include "vtkPlane.h" // Needed for inline methods
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkPlaneCollection : public vtkCollection
37 {
38 public:
40  static vtkPlaneCollection* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void AddItem(vtkPlane*);
47 
51  vtkPlane* GetNextItem();
52 
56  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
57 
62  vtkPlane* GetNextPlane(vtkCollectionSimpleIterator& cookie);
63 
64 protected:
65  vtkPlaneCollection() = default;
66  ~vtkPlaneCollection() override = default;
67 
68 private:
69  // hide the standard AddItem from the user and the compiler.
70  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
71 
72 private:
73  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
74  void operator=(const vtkPlaneCollection&) = delete;
75 };
76 
78 {
79  this->vtkCollection::AddItem(f);
80 }
81 
83 {
84  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
85 }
86 
87 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
vtkPlane * GetItem(int i)
Get the ith plane in the list.
abstract base class for most VTK objects
Definition: vtkObject.h:62
maintain a list of planes
a simple class to control print indentation
Definition: vtkIndent.h:39
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:36
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:55
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.