OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkActor2DCollection.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkActor2DCollection.h,v $
5   Language:  C++
6   Date:      $Date: 2002/12/26 18:24:21 $
7   Version:   $Revision: 1.28 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkActor2DCollection
19 // .SECTION Description
20 // vtkActor2DCollection is a subclass of vtkCollection.  vtkActor2DCollection
21 // maintains a collection of vtkActor2D objects that is sorted by layer
22 // number, with lower layer numbers at the start of the list.  This allows
23 // the vtkActor2D objects to be rendered in the correct order. 
24
25 // .SECTION See Also
26 // vtkActor2D vtkCollection
27
28 #ifndef __vtkActor2DCollection_h
29 #define __vtkActor2DCollection_h
30
31 #include "vtkPropCollection.h"
32
33 #include "vtkActor2D.h" // Needed for inline methods
34
35 class vtkViewport;
36
37 class VTK_COMMON_EXPORT vtkActor2DCollection : public vtkPropCollection
38 {
39  public:
40   // Description:
41   // Desctructor for the vtkActor2DCollection class. This removes all 
42   // objects from the collection.
43   static vtkActor2DCollection *New();
44
45   vtkTypeRevisionMacro(vtkActor2DCollection,vtkPropCollection);
46
47   // Description:
48   // Sorts the vtkActor2DCollection by layer number.  Smaller layer
49   // numbers are first.  Layer numbers can be any integer value.
50   void Sort();
51   
52   // Description:
53   // Add an actor to the list.  The new actor is inserted in the list
54   // according to it's layer number.
55   void AddItem(vtkActor2D *a);
56
57   // Description:
58   // Standard Collection methods
59   int IsItemPresent(vtkActor2D *a);
60   vtkActor2D *GetNextActor2D();
61   vtkActor2D *GetLastActor2D();
62
63   // Description:
64  // Access routines that are provided for compatibility with previous
65  // version of VTK.  Please use the GetNextActor2D(), GetLastActor2D()
66  // variants where possible.
67  vtkActor2D *GetNextItem();
68  vtkActor2D *GetLastItem();
69
70     
71   // Description:
72   // Sort and then render the collection of 2D actors.  
73   void RenderOverlay(vtkViewport* viewport);
74
75
76 protected:
77   vtkActor2DCollection() {};
78   ~vtkActor2DCollection();
79
80   virtual void DeleteElement(vtkCollectionElement *); 
81
82 private:
83   // hide the standard AddItem from the user and the compiler.
84   void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
85   void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
86   int IsItemPresent(vtkObject *o) { return this->vtkCollection::IsItemPresent(o); };
87
88 private:
89   vtkActor2DCollection(const vtkActor2DCollection&);  // Not implemented.
90   void operator=(const vtkActor2DCollection&);  // Not implemented.
91 };
92
93 inline int vtkActor2DCollection::IsItemPresent(vtkActor2D *a) 
94 {
95   return this->vtkCollection::IsItemPresent((vtkObject *)a);
96 }
97
98 inline vtkActor2D *vtkActor2DCollection::GetNextActor2D() 
99
100   return static_cast<vtkActor2D *>(this->GetNextItemAsObject());
101 }
102
103 inline vtkActor2D *vtkActor2DCollection::GetLastActor2D() 
104
105   if ( this->Bottom == NULL )
106     {
107     return NULL;
108     }
109   else
110     {
111     return static_cast<vtkActor2D *>(this->Bottom->Item);
112     }
113 }
114
115 inline vtkActor2D *vtkActor2DCollection::GetNextItem() 
116
117   return this->GetNextActor2D();
118 }
119
120 inline vtkActor2D *vtkActor2DCollection::GetLastItem() 
121 {
122   return this->GetLastActor2D();
123 }
124
125 #endif
126
127
128
129
130