VTK
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 =========================================================================*/
29 #ifndef vtkTextPropertyCollection_h
30 #define vtkTextPropertyCollection_h
31 
32 #include "vtkRenderingCoreModule.h" // For export macro
33 #include "vtkCollection.h"
34 #include "vtkTextProperty.h" // for inline functions
35 
36 class VTKRENDERINGCORE_EXPORT vtkTextPropertyCollection : public vtkCollection
37 {
38  public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void AddItem(vtkTextProperty *a);
47 
51  vtkTextProperty *GetNextItem();
52 
56  vtkTextProperty *GetItem(int idx);
57 
61  vtkTextProperty *GetLastItem();
62 
67  vtkTextProperty *GetNextTextProperty(vtkCollectionSimpleIterator &cookie);
68 
69 protected:
71  ~vtkTextPropertyCollection() override;
72 
73 private:
74  // hide the standard AddItem from the user and the compiler.
75  void AddItem(vtkObject *o);
76 
77 private:
78  vtkTextPropertyCollection(const vtkTextPropertyCollection&) = delete;
79  void operator=(const vtkTextPropertyCollection&) = delete;
80 };
81 
82 inline void vtkTextPropertyCollection::AddItem(vtkTextProperty *a)
83 {
84  this->vtkCollection::AddItem(a);
85 }
86 
88 {
89  return static_cast<vtkTextProperty *>(this->GetNextItemAsObject());
90 }
91 
93 {
94  return static_cast<vtkTextProperty *>(this->GetItemAsObject(idx));
95 }
96 
98 {
99  if ( this->Bottom == nullptr )
100  {
101  return nullptr;
102  }
103  else
104  {
105  return static_cast<vtkTextProperty *>(this->Bottom->Item);
106  }
107 }
108 
109 inline vtkTextProperty *
111 {
112  return static_cast<vtkTextProperty *>(this->GetNextItemAsObject(it));
113 }
114 
116 {
117  this->vtkCollection::AddItem(o);
118 }
119 
120 #endif
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
vtkTextProperty * GetNextTextProperty(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
vtkTextProperty * GetItem(int idx)
Get the vtkTextProperty at the specified index.
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkTextProperty * GetLastItem()
Get the last TextProperty in the list.
void AddItem(vtkTextProperty *a)
Add a vtkTextProperty to the bottom of the list.
vtkTextProperty * GetNextItem()
Get the next vtkTextProperty in the list.
an ordered list of vtkTextProperty objects.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkCollection * New()
Construct with empty list.
represent text properties.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
vtkObject * GetItemAsObject(int i)
Get the i&#39;th item in the collection.