VTK  9.3.20240419
vtkTextPropertyCollection.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
17 #ifndef vtkTextPropertyCollection_h
18 #define vtkTextPropertyCollection_h
19 
20 #include "vtkCollection.h"
21 #include "vtkRenderingCoreModule.h" // For export macro
22 #include "vtkTextProperty.h" // for inline functions
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKRENDERINGCORE_EXPORT vtkTextPropertyCollection : public vtkCollection
26 {
27 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
35  void AddItem(vtkTextProperty* a);
36 
40  vtkTextProperty* GetNextItem();
41 
45  vtkTextProperty* GetItem(int idx);
46 
50  vtkTextProperty* GetLastItem();
51 
56  vtkTextProperty* GetNextTextProperty(vtkCollectionSimpleIterator& cookie);
57 
58 protected:
61 
62 private:
63  // hide the standard AddItem from the user and the compiler.
64  void AddItem(vtkObject* o);
65 
67  void operator=(const vtkTextPropertyCollection&) = delete;
68 };
69 
71 {
72  this->vtkCollection::AddItem(a);
73 }
74 
76 {
77  return static_cast<vtkTextProperty*>(this->GetNextItemAsObject());
78 }
79 
81 {
82  return static_cast<vtkTextProperty*>(this->GetItemAsObject(idx));
83 }
84 
86 {
87  if (this->Bottom == nullptr)
88  {
89  return nullptr;
90  }
91  else
92  {
93  return static_cast<vtkTextProperty*>(this->Bottom->Item);
94  }
95 }
96 
99 {
100  return static_cast<vtkTextProperty*>(this->GetNextItemAsObject(it));
101 }
102 
104 {
105  this->vtkCollection::AddItem(o);
106 }
107 
108 VTK_ABI_NAMESPACE_END
109 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:46
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
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:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
an ordered list of vtkTextProperty objects.
vtkTextProperty * GetNextTextProperty(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void AddItem(vtkTextProperty *a)
Add a vtkTextProperty to the bottom of the list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTextPropertyCollection * New()
vtkTextProperty * GetNextItem()
Get the next vtkTextProperty in the list.
vtkTextProperty * GetLastItem()
Get the last TextProperty in the list.
~vtkTextPropertyCollection() override
vtkTextProperty * GetItem(int idx)
Get the vtkTextProperty at the specified index.
represent text properties.
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:41