OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkStack.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkStack.h,v $
5   Language:  C++
6   Date:      $Date: 2002/02/01 06:39:45 $
7   Version:   $Revision: 1.1.1.1 $
8
9
10 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15
16  * Redistributions of source code must retain the above copyright notice,
17    this list of conditions and the following disclaimer.
18
19  * Redistributions in binary form must reproduce the above copyright notice,
20    this list of conditions and the following disclaimer in the documentation
21    and/or other materials provided with the distribution.
22
23  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
24    of any contributors may be used to endorse or promote products derived
25    from this software without specific prior written permission.
26
27  * Modified source versions must be plainly marked as such, and must not be
28    misrepresented as being the original software.
29
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
31 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
34 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
41 =========================================================================*/
42 // .NAME vtkStack - create and manipulate lists of objects
43 // .SECTION Description
44 // vtkStack is a general object for creating and manipulating lists
45 // of objects. vtkStack also serves as a base class for lists of
46 // specific types of objects.
47
48 #ifndef __vtkStack_h
49 #define __vtkStack_h
50
51 #include "vtkObject.h"
52
53 //BTX begin tcl exclude
54 class vtkStackElement //;prevents pick-up by man page generator
55 {
56  public:
57   vtkStackElement():Item(NULL),Next(NULL) {};
58   vtkObject *Item;
59   vtkStackElement *Next;
60 };
61 //ETX end tcl exclude
62
63 class VTK_EXPORT vtkStack : public vtkObject
64 {
65 public:
66   static vtkStack *New();
67
68   vtkTypeMacro(vtkStack,vtkObject);
69   void PrintSelf(ostream& os, vtkIndent indent);
70
71   // Description:
72   // Add an object to the top of the stack. Does not prevent duplicate entries.
73   void Push(vtkObject *);
74
75   // Description:
76   // Remove an object from the top of the list.
77   vtkObject *Pop();
78
79   // Description:
80   // Return the number of objects in the stack.
81   vtkObject *GetTop();
82
83   // Description:
84   // Return the number of objects in the stack.
85   int  GetNumberOfItems();
86
87 protected:
88   vtkStack();
89   ~vtkStack();
90   vtkStack(const vtkStack&) {};
91   void operator=(const vtkStack&) {};
92
93   int NumberOfItems;
94   vtkStackElement *Top;
95   vtkStackElement *Bottom;
96 };
97
98 #endif