VTK  9.3.0
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
27 #ifndef vtkProp3DCollection_h
28 #define vtkProp3DCollection_h
29 
30 #include "vtkProp3D.h" // Needed for inline methods
31 #include "vtkPropCollection.h"
32 #include "vtkRenderingCoreModule.h" // For export macro
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
45  void AddItem(vtkProp3D* p);
46 
50  vtkProp3D* GetNextProp3D();
51 
55  vtkProp3D* GetLastProp3D();
56 
62  {
63  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
64  }
65 
66 protected:
67  vtkProp3DCollection() = default;
68  ~vtkProp3DCollection() override = default;
69 
70 private:
71  // hide the standard AddItem from the user and the compiler.
72  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
73  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
74 
76  void operator=(const vtkProp3DCollection&) = delete;
77 };
78 
80 {
81  this->vtkCollection::AddItem(a);
82 }
83 
85 {
86  return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
87 }
88 
90 {
91  if (this->Bottom == nullptr)
92  {
93  return nullptr;
94  }
95  else
96  {
97  return static_cast<vtkProp3D*>(this->Bottom->Item);
98  }
99 }
100 
101 VTK_ABI_NAMESPACE_END
102 #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:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
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:48
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:55
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40