VTK
dox/Rendering/Core/vtkActor2DCollection.h
Go to the documentation of this file.
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 "vtkRenderingCoreModule.h" // For export macro
00031 #include "vtkPropCollection.h"
00032 
00033 #include "vtkActor2D.h" // Needed for inline methods
00034 
00035 class vtkViewport;
00036 
00037 class VTKRENDERINGCORE_EXPORT vtkActor2DCollection : public vtkPropCollection
00038 {
00039  public:
00042   static vtkActor2DCollection *New();
00043 
00044   vtkTypeMacro(vtkActor2DCollection,vtkPropCollection);
00045 
00048   void Sort();
00049 
00052   void AddItem(vtkActor2D *a);
00053 
00055 
00056   int IsItemPresent(vtkActor2D *a);
00057   vtkActor2D *GetNextActor2D();
00058   vtkActor2D *GetLastActor2D();
00060 
00062 
00065  vtkActor2D *GetNextItem();
00066  vtkActor2D *GetLastItem();
00068 
00069 
00071   void RenderOverlay(vtkViewport* viewport);
00072 
00073   //BTX
00075 
00077   vtkActor2D *GetNextActor2D(vtkCollectionSimpleIterator &cookie) {
00078     return static_cast<vtkActor2D *>(this->GetNextItemAsObject(cookie));};
00079   //ETX
00081 
00082 protected:
00083   vtkActor2DCollection() {}
00084   ~vtkActor2DCollection();
00085 
00086   virtual void DeleteElement(vtkCollectionElement *);
00087 
00088 private:
00089   // hide the standard AddItem from the user and the compiler.
00090   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00091   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
00092   int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
00093 
00094 private:
00095   vtkActor2DCollection(const vtkActor2DCollection&);  // Not implemented.
00096   void operator=(const vtkActor2DCollection&);  // Not implemented.
00097 };
00098 
00099 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a)
00100 {
00101   return this->vtkCollection::IsItemPresent(a);
00102 }
00103 
00104 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D()
00105 {
00106   return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
00107 }
00108 
00109 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D()
00110 {
00111   if ( this->Bottom == NULL )
00112     {
00113     return NULL;
00114     }
00115   else
00116     {
00117     return static_cast<vtkActor2D *>(this->Bottom->Item);
00118     }
00119 }
00120 
00121 inline vtkActor2D *vtkActor2DCollection::GetNextItem()
00122 {
00123   return this->GetNextActor2D();
00124 }
00125 
00126 inline vtkActor2D *vtkActor2DCollection::GetLastItem()
00127 {
00128   return this->GetLastActor2D();
00129 }
00130 
00131 #endif
00132 
00133 
00134 
00135 
00136 
00137 // VTK-HeaderTest-Exclude: vtkActor2DCollection.h