VTK  9.2.6
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 =========================================================================*/
59 #ifndef vtkProp3DCollection_h
60 #define vtkProp3DCollection_h
61 
62 #include "vtkProp3D.h" // Needed for inline methods
63 #include "vtkPropCollection.h"
64 #include "vtkRenderingCoreModule.h" // For export macro
65 
66 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
67 {
68 public:
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
76  void AddItem(vtkProp3D* p);
77 
81  vtkProp3D* GetNextProp3D();
82 
86  vtkProp3D* GetLastProp3D();
87 
93  {
94  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
95  }
96 
97 protected:
98  vtkProp3DCollection() = default;
99  ~vtkProp3DCollection() override = default;
100 
101 private:
102  // hide the standard AddItem from the user and the compiler.
103  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
104  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
105 
106 private:
107  vtkProp3DCollection(const vtkProp3DCollection&) = delete;
108  void operator=(const vtkProp3DCollection&) = delete;
109 };
110 
112 {
113  this->vtkCollection::AddItem(a);
114 }
115 
117 {
118  return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
119 }
120 
122 {
123  if (this->Bottom == nullptr)
124  {
125  return nullptr;
126  }
127  else
128  {
129  return static_cast<vtkProp3D*>(this->Bottom->Item);
130  }
131 }
132 
133 #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:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
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:99
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:76
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51