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