00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkActor2DCollection.h,v $ 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 =========================================================================*/ 00037 #ifndef __vtkActor2DCollection_h 00038 #define __vtkActor2DCollection_h 00039 00040 #include "vtkPropCollection.h" 00041 00042 #include "vtkActor2D.h" // Needed for inline methods 00043 00044 class vtkViewport; 00045 00046 class VTK_FILTERING_EXPORT vtkActor2DCollection : public vtkPropCollection 00047 { 00048 public: 00051 static vtkActor2DCollection *New(); 00052 00053 vtkTypeRevisionMacro(vtkActor2DCollection,vtkPropCollection); 00054 00057 void Sort(); 00058 00061 void AddItem(vtkActor2D *a); 00062 00064 00065 int IsItemPresent(vtkActor2D *a); 00066 vtkActor2D *GetNextActor2D(); 00067 vtkActor2D *GetLastActor2D(); 00069 00071 00074 vtkActor2D *GetNextItem(); 00075 vtkActor2D *GetLastItem(); 00077 00078 00080 void RenderOverlay(vtkViewport* viewport); 00081 00082 //BTX 00084 00086 vtkActor2D *GetNextActor2D(vtkCollectionSimpleIterator &cookie) { 00087 return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));}; 00088 //ETX 00090 00091 protected: 00092 vtkActor2DCollection() {}; 00093 ~vtkActor2DCollection(); 00094 00095 virtual void DeleteElement(vtkCollectionElement *); 00096 00097 private: 00098 // hide the standard AddItem from the user and the compiler. 00099 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); }; 00100 void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); }; 00101 int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); }; 00102 00103 private: 00104 vtkActor2DCollection(const vtkActor2DCollection&); // Not implemented. 00105 void operator=(const vtkActor2DCollection&); // Not implemented. 00106 }; 00107 00108 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a) 00109 { 00110 return this->vtkCollection::IsItemPresent((vtkObject *)a); 00111 } 00112 00113 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D() 00114 { 00115 return static_cast<vtkActor2D *>(this->GetNextItemAsObject()); 00116 } 00117 00118 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D() 00119 { 00120 if ( this->Bottom == NULL ) 00121 { 00122 return NULL; 00123 } 00124 else 00125 { 00126 return static_cast<vtkActor2D *>(this->Bottom->Item); 00127 } 00128 } 00129 00130 inline vtkActor2D *vtkActor2DCollection::GetNextItem() 00131 { 00132 return this->GetNextActor2D(); 00133 } 00134 00135 inline vtkActor2D *vtkActor2DCollection::GetLastItem() 00136 { 00137 return this->GetLastActor2D(); 00138 } 00139 00140 #endif 00141 00142 00143 00144 00145