VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTextPropertyCollection.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00028 #ifndef __vtkTextPropertyCollection_h 00029 #define __vtkTextPropertyCollection_h 00030 00031 #include "vtkRenderingCoreModule.h" // For export macro 00032 #include "vtkCollection.h" 00033 #include "vtkTextProperty.h" // for inline functions 00034 00035 class VTKRENDERINGCORE_EXPORT vtkTextPropertyCollection : public vtkCollection 00036 { 00037 public: 00038 static vtkTextPropertyCollection *New(); 00039 vtkTypeMacro(vtkTextPropertyCollection, vtkCollection) 00040 virtual void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 void AddItem(vtkTextProperty *a); 00044 00046 vtkTextProperty *GetNextItem(); 00047 00049 vtkTextProperty *GetItem(int idx); 00050 00052 vtkTextProperty *GetLastItem(); 00053 00056 vtkTextProperty *GetNextTextProperty(vtkCollectionSimpleIterator &cookie); 00057 00058 protected: 00059 vtkTextPropertyCollection(); 00060 ~vtkTextPropertyCollection(); 00061 00062 private: 00063 // hide the standard AddItem from the user and the compiler. 00064 void AddItem(vtkObject *o); 00065 00066 private: 00067 vtkTextPropertyCollection(const vtkTextPropertyCollection&); // Not implemented. 00068 void operator=(const vtkTextPropertyCollection&); // Not implemented. 00069 }; 00070 00071 inline void vtkTextPropertyCollection::AddItem(vtkTextProperty *a) 00072 { 00073 this->vtkCollection::AddItem(a); 00074 } 00075 00076 inline vtkTextProperty *vtkTextPropertyCollection::GetNextItem() 00077 { 00078 return static_cast<vtkTextProperty *>(this->GetNextItemAsObject()); 00079 } 00080 00081 inline vtkTextProperty *vtkTextPropertyCollection::GetItem(int idx) 00082 { 00083 return static_cast<vtkTextProperty *>(this->GetItemAsObject(idx)); 00084 } 00085 00086 inline vtkTextProperty *vtkTextPropertyCollection::GetLastItem() 00087 { 00088 if ( this->Bottom == NULL ) 00089 { 00090 return NULL; 00091 } 00092 else 00093 { 00094 return static_cast<vtkTextProperty *>(this->Bottom->Item); 00095 } 00096 } 00097 00098 inline vtkTextProperty * 00099 vtkTextPropertyCollection::GetNextTextProperty(vtkCollectionSimpleIterator &it) 00100 { 00101 return static_cast<vtkTextProperty *>(this->GetNextItemAsObject(it)); 00102 } 00103 00104 inline void vtkTextPropertyCollection::AddItem(vtkObject *o) 00105 { 00106 this->vtkCollection::AddItem(o); 00107 } 00108 00109 #endif