Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Common/vtkActor2DCollection.h

Go to the documentation of this file.
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 =========================================================================*/
00026 #ifndef __vtkActor2DCollection_h
00027 #define __vtkActor2DCollection_h
00028 
00029 #include "vtkPropCollection.h"
00030 
00031 #include "vtkActor2D.h" // Needed for inline methods
00032 
00033 class vtkViewport;
00034 
00035 class VTK_COMMON_EXPORT vtkActor2DCollection : public vtkPropCollection
00036 {
00037  public:
00040   static vtkActor2DCollection *New();
00041 
00042   vtkTypeRevisionMacro(vtkActor2DCollection,vtkPropCollection);
00043 
00046   void Sort();
00047   
00050   void AddItem(vtkActor2D *a);
00051 
00053 
00054   int IsItemPresent(vtkActor2D *a);
00055   vtkActor2D *GetNextActor2D();
00056   vtkActor2D *GetLastActor2D();
00058 
00060 
00063  vtkActor2D *GetNextItem();
00064  vtkActor2D *GetLastItem();
00066 
00067     
00069   void RenderOverlay(vtkViewport* viewport);
00070 
00071 
00072 protected:
00073   vtkActor2DCollection() {};
00074   ~vtkActor2DCollection();
00075 
00076   virtual void DeleteElement(vtkCollectionElement *); 
00077 
00078 private:
00079   // hide the standard AddItem from the user and the compiler.
00080   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
00081   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
00082   int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
00083 
00084 private:
00085   vtkActor2DCollection(const vtkActor2DCollection&);  // Not implemented.
00086   void operator=(const vtkActor2DCollection&);  // Not implemented.
00087 };
00088 
00089 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a) 
00090 {
00091   return this->vtkCollection::IsItemPresent((vtkObject *)a);
00092 }
00093 
00094 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D() 
00095 { 
00096   return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
00097 }
00098 
00099 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D() 
00100 { 
00101   if ( this->Bottom == NULL )
00102     {
00103     return NULL;
00104     }
00105   else
00106     {
00107     return static_cast<vtkActor2D *>(this->Bottom->Item);
00108     }
00109 }
00110 
00111 inline vtkActor2D *vtkActor2DCollection::GetNextItem() 
00112 { 
00113   return this->GetNextActor2D();
00114 }
00115 
00116 inline vtkActor2D *vtkActor2DCollection::GetLastItem() 
00117 {
00118   return this->GetLastActor2D();
00119 }
00120 
00121 #endif
00122 
00123 
00124 
00125 
00126