VTK  9.2.6
vtkMapperCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMapperCollection.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 vtkMapperCollection_h
28 #define vtkMapperCollection_h
29 
30 #include "vtkCollection.h"
31 #include "vtkMapper.h" // Needed for direct access to mapper methods in
32  // inline functions
33 #include "vtkRenderingCoreModule.h" // For export macro
34 
35 class VTKRENDERINGCORE_EXPORT vtkMapperCollection : public vtkCollection
36 {
37 public:
38  static vtkMapperCollection* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
45  void AddItem(vtkMapper* a) { this->vtkCollection::AddItem(a); }
46 
50  vtkMapper* GetNextItem() { return static_cast<vtkMapper*>(this->GetNextItemAsObject()); }
51 
56  {
57  return this->Bottom ? static_cast<vtkMapper*>(this->Bottom->Item) : nullptr;
58  }
59 
65  {
66  return static_cast<vtkMapper*>(this->GetNextItemAsObject(cookie));
67  }
68 
69 protected:
70  vtkMapperCollection() = default;
71  ~vtkMapperCollection() override = default;
72 
73 private:
74  // hide the standard AddItem from the user and the compiler.
75  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
76 
77 private:
79  void operator=(const vtkMapperCollection&) = delete;
80 };
81 
82 #endif
an ordered list of mappers
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkMapper * GetNextMapper(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCollection * New()
Construct with empty list.
void AddItem(vtkMapper *a)
Add an mapper to the bottom of the list.
vtkMapper * GetLastItem()
Get the last mapper in the list.
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:87
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:55
vtkMapper * GetNextItem()
Get the next mapper in the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.