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 =========================================================================*/
47 #ifndef vtkPlaneCollection_h
48 #define vtkPlaneCollection_h
49 
50 #include "vtkCollection.h"
51 #include "vtkCommonDataModelModule.h" // For export macro
52 
53 #include "vtkPlane.h" // Needed for inline methods
54 
55 class VTKCOMMONDATAMODEL_EXPORT vtkPlaneCollection : public vtkCollection
56 {
57 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
65  void AddItem(vtkPlane*);
66 
70  vtkPlane* GetNextItem();
71 
75  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
76 
82 
83 protected:
84  vtkPlaneCollection() = default;
85  ~vtkPlaneCollection() override = default;
86 
87 private:
88  // hide the standard AddItem from the user and the compiler.
89  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
90 
91 private:
92  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
93  void operator=(const vtkPlaneCollection&) = delete;
94 };
95 
97 {
98  this->vtkCollection::AddItem(f);
99 }
100 
102 {
103  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
104 }
105 
106 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:56
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:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
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:146
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51