VTK  9.0.1
vtkTextPropertyCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTextPropertyCollection.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 =========================================================================*/
26 #ifndef vtkTextPropertyCollection_h
27 #define vtkTextPropertyCollection_h
28 
29 #include "vtkCollection.h"
30 #include "vtkRenderingCoreModule.h" // For export macro
31 #include "vtkTextProperty.h" // for inline functions
32 
33 class VTKRENDERINGCORE_EXPORT vtkTextPropertyCollection : public vtkCollection
34 {
35 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void AddItem(vtkTextProperty* a);
44 
48  vtkTextProperty* GetNextItem();
49 
53  vtkTextProperty* GetItem(int idx);
54 
58  vtkTextProperty* GetLastItem();
59 
64  vtkTextProperty* GetNextTextProperty(vtkCollectionSimpleIterator& cookie);
65 
66 protected:
68  ~vtkTextPropertyCollection() override;
69 
70 private:
71  // hide the standard AddItem from the user and the compiler.
72  void AddItem(vtkObject* o);
73 
74 private:
76  void operator=(const vtkTextPropertyCollection&) = delete;
77 };
78 
80 {
81  this->vtkCollection::AddItem(a);
82 }
83 
85 {
86  return static_cast<vtkTextProperty*>(this->GetNextItemAsObject());
87 }
88 
90 {
91  return static_cast<vtkTextProperty*>(this->GetItemAsObject(idx));
92 }
93 
95 {
96  if (this->Bottom == nullptr)
97  {
98  return nullptr;
99  }
100  else
101  {
102  return static_cast<vtkTextProperty*>(this->Bottom->Item);
103  }
104 }
105 
108 {
109  return static_cast<vtkTextProperty*>(this->GetNextItemAsObject(it));
110 }
111 
113 {
114  this->vtkCollection::AddItem(o);
115 }
116 
117 #endif
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkTextPropertyCollection::GetNextTextProperty
vtkTextProperty * GetNextTextProperty(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkTextPropertyCollection.h:106
vtkCollection.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkTextPropertyCollection
an ordered list of vtkTextProperty objects.
Definition: vtkTextPropertyCollection.h:33
vtkTextPropertyCollection::AddItem
void AddItem(vtkTextProperty *a)
Add a vtkTextProperty to the bottom of the list.
Definition: vtkTextPropertyCollection.h:79
vtkTextPropertyCollection::GetNextItem
vtkTextProperty * GetNextItem()
Get the next vtkTextProperty in the list.
Definition: vtkTextPropertyCollection.h:84
vtkTextPropertyCollection::GetLastItem
vtkTextProperty * GetLastItem()
Get the last TextProperty in the list.
Definition: vtkTextPropertyCollection.h:94
vtkTextProperty.h
vtkCollectionElement::Item
vtkObject * Item
Definition: vtkCollection.h:45
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkCollection::Bottom
vtkCollectionElement * Bottom
Definition: vtkCollection.h:166
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCollection::GetItemAsObject
vtkObject * GetItemAsObject(int i)
Get the i'th item in the collection.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkTextPropertyCollection::GetItem
vtkTextProperty * GetItem(int idx)
Get the vtkTextProperty at the specified index.
Definition: vtkTextPropertyCollection.h:89
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.