Main Page Class Hierarchy Alphabetical List Compound List File List Compound 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   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00042 #ifndef __vtkActor2DCollection_h
    00043 #define __vtkActor2DCollection_h
    00044
    00045 #include "vtkPropCollection.h"
    00046
    00047 #include "vtkActor2D.h" // Needed for inline methods
    00048
    00049 class vtkViewport;
    00050
    00051 class VTK_COMMON_EXPORT vtkActor2DCollection : public vtkPropCollection
    00052 {
    00053  public:
    00056   static vtkActor2DCollection *New();
    00057
    00058   vtkTypeRevisionMacro(vtkActor2DCollection,vtkPropCollection);
    00059
    00062   void Sort();
    00063
    00066   void AddItem(vtkActor2D *a);
    00067
    00069
    00070   int IsItemPresent(vtkActor2D *a);
    00071   vtkActor2D *GetNextActor2D();
    00072   vtkActor2D *GetLastActor2D();
    00074
    00076
    00079  vtkActor2D *GetNextItem();
    00080  vtkActor2D *GetLastItem();
    00082
    00083
    00085   void RenderOverlay(vtkViewport* viewport);
    00086
    00087
    00088 protected:
    00089   vtkActor2DCollection() {};
    00090   ~vtkActor2DCollection();
    00091
    00092   virtual void DeleteElement(vtkCollectionElement *);
    00093
    00094 private:
    00095   // hide the standard AddItem from the user and the compiler.
    00096   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
    00097   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
    00098   int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
    00099
    00100 private:
    00101   vtkActor2DCollection(const vtkActor2DCollection&);  // Not implemented.
    00102   void operator=(const vtkActor2DCollection&);  // Not implemented.
    00103 };
    00104
    00105 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a)
    00106 {
    00107   return this->vtkCollection::IsItemPresent((vtkObject *)a);
    00108 }
    00109
    00110 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D()
    00111 {
    00112   return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
    00113 }
    00114
    00115 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D()
    00116 {
    00117   if ( this->Bottom == NULL )
    00118     {
    00119     return NULL;
    00120     }
    00121   else
    00122     {
    00123     return static_cast<vtkActor2D *>(this->Bottom->Item);
    00124     }
    00125 }
    00126
    00127 inline vtkActor2D *vtkActor2DCollection::GetNextItem()
    00128 {
    00129   return this->GetNextActor2D();
    00130 }
    00131
    00132 inline vtkActor2D *vtkActor2DCollection::GetLastItem()
    00133 {
    00134   return this->GetLastActor2D();
    00135 }
    00136
    00137 #endif
    00138
    00139
    00140
    00141
    00142