VTK  9.3.0
vtkMapperCollection.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
15 #ifndef vtkMapperCollection_h
16 #define vtkMapperCollection_h
17 
18 #include "vtkCollection.h"
19 #include "vtkMapper.h" // Needed for direct access to mapper methods in
20  // inline functions
21 #include "vtkRenderingCoreModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKRENDERINGCORE_EXPORT vtkMapperCollection : public vtkCollection
25 {
26 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  void AddItem(vtkMapper* a) { this->vtkCollection::AddItem(a); }
35 
39  vtkMapper* GetNextItem() { return static_cast<vtkMapper*>(this->GetNextItemAsObject()); }
40 
45  {
46  return this->Bottom ? static_cast<vtkMapper*>(this->Bottom->Item) : nullptr;
47  }
48 
54  {
55  return static_cast<vtkMapper*>(this->GetNextItemAsObject(cookie));
56  }
57 
58 protected:
59  vtkMapperCollection() = default;
60  ~vtkMapperCollection() override = default;
61 
62 private:
63  // hide the standard AddItem from the user and the compiler.
64  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
65 
67  void operator=(const vtkMapperCollection&) = delete;
68 };
69 
70 VTK_ABI_NAMESPACE_END
71 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
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
an ordered list of mappers
void AddItem(vtkMapper *a)
Add an mapper to the bottom of the list.
vtkMapper * GetNextMapper(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
static vtkMapperCollection * New()
~vtkMapperCollection() override=default
vtkMapperCollection()=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMapper * GetNextItem()
Get the next mapper in the list.
vtkMapper * GetLastItem()
Get the last mapper in the list.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
abstract base class for most VTK objects
Definition: vtkObject.h:52
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40