00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPropCollection.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 =========================================================================*/ 00032 #ifndef __vtkPropCollection_h 00033 #define __vtkPropCollection_h 00034 00035 #include "vtkCollection.h" 00036 00037 #include "vtkProp.h" // Needed for inline methods 00038 00039 class VTK_COMMON_EXPORT vtkPropCollection : public vtkCollection 00040 { 00041 public: 00042 static vtkPropCollection *New(); 00043 vtkTypeMacro(vtkPropCollection,vtkCollection); 00044 00046 void AddItem(vtkProp *a); 00047 00049 vtkProp *GetNextProp(); 00050 00052 vtkProp *GetLastProp(); 00053 00058 int GetNumberOfPaths(); 00059 00060 //BTX 00062 00064 vtkProp *GetNextProp(vtkCollectionSimpleIterator &cookie) { 00065 return static_cast<vtkProp *>(this->GetNextItemAsObject(cookie));}; 00066 //ETX 00068 00069 protected: 00070 vtkPropCollection() {}; 00071 ~vtkPropCollection() {}; 00072 00073 00074 private: 00075 // hide the standard AddItem from the user and the compiler. 00076 void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); }; 00077 00078 private: 00079 vtkPropCollection(const vtkPropCollection&); // Not implemented. 00080 void operator=(const vtkPropCollection&); // Not implemented. 00081 }; 00082 00083 inline void vtkPropCollection::AddItem(vtkProp *a) 00084 { 00085 this->vtkCollection::AddItem(a); 00086 } 00087 00088 inline vtkProp *vtkPropCollection::GetNextProp() 00089 { 00090 return static_cast<vtkProp *>(this->GetNextItemAsObject()); 00091 } 00092 00093 inline vtkProp *vtkPropCollection::GetLastProp() 00094 { 00095 if ( this->Bottom == NULL ) 00096 { 00097 return NULL; 00098 } 00099 else 00100 { 00101 return static_cast<vtkProp *>(this->Bottom->Item); 00102 } 00103 } 00104 00105 #endif 00106 00107 00108 00109 00110