VTK  9.5.20250630
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
44
45VTK_ABI_NAMESPACE_BEGIN
46class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkProp3DCollection : public vtkPropCollection
47{
48public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
56 void AddItem(vtkProp3D* p);
57
61 vtkProp3D* GetNextProp3D();
62
66 vtkProp3D* GetLastProp3D();
67
73 {
74 return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
75 }
76
77protected:
79 ~vtkProp3DCollection() override = default;
80
81private:
82 // hide the standard AddItem from the user and the compiler.
83 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
84 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
85
87 void operator=(const vtkProp3DCollection&) = delete;
88};
89
91{
93}
94
96{
97 return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
98}
99
101{
102 if (this->Bottom == nullptr)
103 {
104 return nullptr;
105 }
106 else
107 {
108 return static_cast<vtkProp3D*>(this->Bottom->Item);
109 }
110}
111
112VTK_ABI_NAMESPACE_END
113#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
#define VTK_MARSHALAUTO