VTK  9.0.3
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 =========================================================================*/
25 #ifndef vtkPlaneCollection_h
26 #define vtkPlaneCollection_h
27 
28 #include "vtkCollection.h"
29 #include "vtkCommonDataModelModule.h" // For export macro
30 
31 #include "vtkPlane.h" // Needed for inline methods
32 
33 class VTKCOMMONDATAMODEL_EXPORT vtkPlaneCollection : public vtkCollection
34 {
35 public:
38 
42  void AddItem(vtkPlane*);
43 
47  vtkPlane* GetNextItem();
48 
52  vtkPlane* GetItem(int i) { return static_cast<vtkPlane*>(this->GetItemAsObject(i)); }
53 
59 
60 protected:
62  ~vtkPlaneCollection() override {}
63 
64 private:
65  // hide the standard AddItem from the user and the compiler.
66  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
67 
68 private:
69  vtkPlaneCollection(const vtkPlaneCollection&) = delete;
70  void operator=(const vtkPlaneCollection&) = delete;
71 };
72 
74 {
75  this->vtkCollection::AddItem(f);
76 }
77 
79 {
80  return static_cast<vtkPlane*>(this->GetNextItemAsObject());
81 }
82 
83 #endif
84 // VTK-HeaderTest-Exclude: vtkPlaneCollection.h
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
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.
abstract base class for most VTK objects
Definition: vtkObject.h:54
maintain a list of planes
~vtkPlaneCollection() override
vtkPlane * GetNextItem()
Get the next plane in the list.
static vtkPlaneCollection * New()
vtkPlane * GetNextPlane(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkPlane * GetItem(int i)
Get the ith plane in the list.
void AddItem(vtkPlane *)
Add a plane to the list.
perform various plane computations
Definition: vtkPlane.h:32
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48