VTK  9.3.20240424
vtkProp3DCollection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
37#ifndef vtkProp3DCollection_h
38#define vtkProp3DCollection_h
39
40#include "vtkProp3D.h" // Needed for inline methods
41#include "vtkPropCollection.h"
42#include "vtkRenderingCoreModule.h" // For export macro
43
44VTK_ABI_NAMESPACE_BEGIN
45class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 void AddItem(vtkProp3D* p);
56
60 vtkProp3D* GetNextProp3D();
61
65 vtkProp3D* GetLastProp3D();
66
72 {
73 return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
74 }
75
76protected:
78 ~vtkProp3DCollection() override = default;
79
80private:
81 // hide the standard AddItem from the user and the compiler.
82 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
83 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
84
86 void operator=(const vtkProp3DCollection&) = delete;
87};
88
90{
92}
93
95{
96 return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
97}
98
100{
101 if (this->Bottom == nullptr)
102 {
103 return nullptr;
104 }
105 else
106 {
107 return static_cast<vtkProp3D*>(this->Bottom->Item);
108 }
109}
110
111VTK_ABI_NAMESPACE_END
112#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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
an ordered list of 3D props
vtkProp3D * GetNextProp3D()
Get the next actor in the list.
~vtkProp3DCollection() override=default
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 * GetNextProp3D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkProp3D * GetLastProp3D()
Get the last actor in the list.
represents an 3D object for placement in a rendered scene
Definition vtkProp3D.h:89
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:66
void * vtkCollectionSimpleIterator