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 =========================================================================*/
30 #ifndef vtkProp3DCollection_h
31 #define vtkProp3DCollection_h
32 
33 #include "vtkProp3D.h" // Needed for inline methods
34 #include "vtkPropCollection.h"
35 #include "vtkRenderingCoreModule.h" // For export macro
36 
37 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
38 {
39 public:
40  static vtkProp3DCollection* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void AddItem(vtkProp3D* p);
48 
52  vtkProp3D* GetNextProp3D();
53 
57  vtkProp3D* GetLastProp3D();
58 
64  {
65  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
66  }
67 
68 protected:
69  vtkProp3DCollection() = default;
70  ~vtkProp3DCollection() override = default;
71 
72 private:
73  // hide the standard AddItem from the user and the compiler.
74  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
75  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
76 
77 private:
79  void operator=(const vtkProp3DCollection&) = delete;
80 };
81 
83 {
84  this->vtkCollection::AddItem(a);
85 }
86 
88 {
89  return static_cast<vtkProp3D*>(this->GetNextItemAsObject());
90 }
91 
93 {
94  if (this->Bottom == nullptr)
95  {
96  return nullptr;
97  }
98  else
99  {
100  return static_cast<vtkProp3D*>(this->Bottom->Item);
101  }
102 }
103 
104 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:49
vtkProp3D * GetNextProp3D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
an ordered list of Props
a simple class to control print indentation
Definition: vtkIndent.h:39
an ordered list of 3D props
vtkCollectionElement * Bottom
void AddItem(vtkObject *)
Add an object to the bottom of the list.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
vtkProp3D * GetNextProp3D()
Get the next actor in the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()
void AddItem(vtkProp3D *p)
Add an actor to the bottom of the list.
vtkProp3D * GetLastProp3D()
Get the last actor in the list.