VTK  9.0.1
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 =========================================================================*/
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 class VTKRENDERINGCORE_EXPORT vtkProp3DCollection : public vtkPropCollection
35 {
36 public:
37  static vtkProp3DCollection* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void AddItem(vtkProp3D* p);
45 
49  vtkProp3D* GetNextProp3D();
50 
54  vtkProp3D* GetLastProp3D();
55 
61  {
62  return static_cast<vtkProp3D*>(this->GetNextItemAsObject(cookie));
63  }
64 
65 protected:
67  ~vtkProp3DCollection() override {}
68 
69 private:
70  // hide the standard AddItem from the user and the compiler.
71  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
72  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
73 
74 private:
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 #endif
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkCollectionElement::Item
vtkObject * Item
Definition: vtkCollection.h:45
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkProp3DCollection::vtkProp3DCollection
vtkProp3DCollection()
Definition: vtkProp3DCollection.h:66
vtkProp3DCollection::GetNextProp3D
vtkProp3D * GetNextProp3D(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkProp3DCollection.h:60
vtkProp3DCollection::GetNextProp3D
vtkProp3D * GetNextProp3D()
Get the next actor in the list.
Definition: vtkProp3DCollection.h:84
vtkCollection::Bottom
vtkCollectionElement * Bottom
Definition: vtkCollection.h:166
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPropCollection::AddItem
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
Definition: vtkPropCollection.h:86
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkProp3DCollection::GetLastProp3D
vtkProp3D * GetLastProp3D()
Get the last actor in the list.
Definition: vtkProp3DCollection.h:89
vtkPropCollection::New
static vtkPropCollection * New()
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkProp3DCollection::AddItem
void AddItem(vtkProp3D *p)
Add an actor to the bottom of the list.
Definition: vtkProp3DCollection.h:79
vtkProp3DCollection::~vtkProp3DCollection
~vtkProp3DCollection() override
Definition: vtkProp3DCollection.h:67
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkProp3DCollection
an ordered list of 3D props
Definition: vtkProp3DCollection.h:34
vtkPropCollection.h
vtkProp3D.h