VTK  9.1.0
vtkProp3DCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProp3DCollection.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 =========================================================================*/
56 #ifndef vtkProp3DCollection_h
57 #define vtkProp3DCollection_h
58 
59 #include "vtkProp3D.h" // Needed for inline methods
60 #include "vtkPropCollection.h"
61 #include "vtkRenderingCoreModule.h" // For export macro
62 
63 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
64 {
65 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
73  void AddItem(vtkProp3D* p);
74 
78  vtkProp3D* GetNextProp3D();
79 
83  vtkProp3D* GetLastProp3D();
84 
90  {
91  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
92  }
93 
94 protected:
95  vtkProp3DCollection() = default;
96  ~vtkProp3DCollection() override = default;
97 
98 private:
99  // hide the standard AddItem from the user and the compiler.
100  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
101  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
102 
103 private:
104  vtkProp3DCollection(const vtkProp3DCollection&) = delete;
105  void operator=(const vtkProp3DCollection&) = delete;
106 };
107 
109 {
110  this->vtkCollection::AddItem(a);
111 }
112 
114 {
115  return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
116 }
117 
119 {
120  if (this->Bottom == nullptr)
121  {
122  return nullptr;
123  }
124  else
125  {
126  return static_cast<vtkProp3D*>(this->Bottom->Item);
127  }
128 }
129 
130 #endif
vtkCollectionElement * Bottom
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:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
an ordered list of 3D props
vtkProp3D * GetNextProp3D()
Get the next actor in the list.
~vtkProp3DCollection() override=default
vtkProp3D * GetNextProp3D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkProp3DCollection()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkProp3DCollection * New()
void AddItem(vtkProp3D *p)
Add an actor to the bottom of the list.
vtkProp3D * GetLastProp3D()
Get the last actor in the list.
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:93
an ordered list of Props
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48