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
18 #ifndef vtkProp3DCollection_h
19 #define vtkProp3DCollection_h
20 
21 #include "vtkProp3D.h" // Needed for inline methods
22 #include "vtkPropCollection.h"
23 #include "vtkRenderingCoreModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  void AddItem(vtkProp3D* p);
37 
41  vtkProp3D* GetNextProp3D();
42 
46  vtkProp3D* GetLastProp3D();
47 
53  {
54  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
55  }
56 
57 protected:
58  vtkProp3DCollection() = default;
59  ~vtkProp3DCollection() override = default;
60 
61 private:
62  // hide the standard AddItem from the user and the compiler.
63  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
64  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
65 
67  void operator=(const vtkProp3DCollection&) = delete;
68 };
69 
71 {
72  this->vtkCollection::AddItem(a);
73 }
74 
76 {
77  return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
78 }
79 
81 {
82  if (this->Bottom == nullptr)
83  {
84  return nullptr;
85  }
86  else
87  {
88  return static_cast<vtkProp3D*>(this->Bottom->Item);
89  }
90 }
91 
92 VTK_ABI_NAMESPACE_END
93 #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:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:39
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:46
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40