00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkActor2DCollection.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 =========================================================================*/ 00027 #ifndef __vtkActor2DCollection_h 00028 #define __vtkActor2DCollection_h 00029 00030 #include "vtkPropCollection.h" 00031 00032 #include "vtkActor2D.h" // Needed for inline methods 00033 00034 class vtkViewport; 00035 00036 class VTK_FILTERING_EXPORT vtkActor2DCollection : public vtkPropCollection 00037 { 00038 public: 00041 static vtkActor2DCollection *New(); 00042 00043 vtkTypeMacro(vtkActor2DCollection,vtkPropCollection); 00044 00047 void Sort(); 00048 00051 void AddItem(vtkActor2D *a); 00052 00054 00055 int IsItemPresent(vtkActor2D *a); 00056 vtkActor2D *GetNextActor2D(); 00057 vtkActor2D *GetLastActor2D(); 00059 00061 00064 vtkActor2D *GetNextItem(); 00065 vtkActor2D *GetLastItem(); 00067 00068 00070 void RenderOverlay(vtkViewport* viewport); 00071 00072 //BTX 00074 00076 vtkActor2D *GetNextActor2D(vtkCollectionSimpleIterator &cookie) { 00077 return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));}; 00078 //ETX 00080 00081 protected: 00082 vtkActor2DCollection() {}; 00083 ~vtkActor2DCollection(); 00084 00085 virtual void DeleteElement(vtkCollectionElement *); 00086 00087 private: 00088 // hide the standard AddItem from the user and the compiler. 00089 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); }; 00090 void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); }; 00091 int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); }; 00092 00093 private: 00094 vtkActor2DCollection(const vtkActor2DCollection&); // Not implemented. 00095 void operator=(const vtkActor2DCollection&); // Not implemented. 00096 }; 00097 00098 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a) 00099 { 00100 return this->vtkCollection::IsItemPresent(a); 00101 } 00102 00103 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D() 00104 { 00105 return static_cast<vtkActor2D *>(this->GetNextItemAsObject()); 00106 } 00107 00108 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D() 00109 { 00110 if ( this->Bottom == NULL ) 00111 { 00112 return NULL; 00113 } 00114 else 00115 { 00116 return static_cast<vtkActor2D *>(this->Bottom->Item); 00117 } 00118 } 00119 00120 inline vtkActor2D *vtkActor2DCollection::GetNextItem() 00121 { 00122 return this->GetNextActor2D(); 00123 } 00124 00125 inline vtkActor2D *vtkActor2DCollection::GetLastItem() 00126 { 00127 return this->GetLastActor2D(); 00128 } 00129 00130 #endif 00131 00132 00133 00134 00135