fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / Base / OSGViewport.h
blob593c2af4c0951a357eda1e96a30702ded9dae8af
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGVIEWPORT_H_
41 #define _OSGVIEWPORT_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGViewportBase.h"
47 #include "OSGWindowDrawTask.h"
49 OSG_BEGIN_NAMESPACE
51 /*! \brief Viewport base class. See \ref
52 PageSystemWindowViewports for a description.
54 \ingroup GrpSystemWindowBase
55 \ingroup GrpLibOSGSystem
56 \includebasedoc
59 class OSG_SYSTEM_DLLMAPPING Viewport : public ViewportBase
61 /*========================== PUBLIC =================================*/
63 public:
65 typedef ViewportBase Inherited;
67 /*---------------------------------------------------------------------*/
68 /*! \name access */
69 /*! \{ */
71 virtual Int32 calcPixelLeft ( void ) const;
72 virtual Int32 calcPixelRight ( void ) const;
73 virtual Int32 calcPixelBottom ( void ) const;
74 virtual Int32 calcPixelTop ( void ) const;
76 Int32 calcPixelWidth ( void ) const;
77 Int32 calcPixelHeight ( void ) const;
79 virtual bool calcIsFullWindow ( void ) const;
81 Window *getParent ( void ) const;
83 void calcNormalizedCoordinates( Real32& normX,
84 Real32& normY,
85 const Int32 vpX ,
86 const Int32 vpY ) const;
88 #ifdef OSG_1_COMPAT
89 Int32 getPixelLeft ( void ) const;
90 Int32 getPixelRight ( void ) const;
91 Int32 getPixelBottom ( void ) const;
92 Int32 getPixelTop ( void ) const;
94 Int32 getPixelWidth ( void ) const;
95 Int32 getPixelHeight ( void ) const;
97 bool isFullWindow ( void ) const;
100 void getNormalizedCoordinates ( Real32& normX,
101 Real32& normY,
102 const Int32 vpX ,
103 const Int32 vpY ) const;
104 #endif
106 /*! \} */
107 /*---------------------------------------------------------------------*/
108 /*! \name your_category */
109 /*! \{ */
111 virtual void activateSize(void );
112 virtual void activate (void );
113 virtual void deactivate (void );
115 virtual void render (RenderActionBase *action);
117 /*! \} */
118 /*---------------------------------------------------------------------*/
119 /*! \name Sync */
120 /*! \{ */
122 /*! \} */
123 /*---------------------------------------------------------------------*/
124 /*! \name Sync */
125 /*! \{ */
127 /*! \} */
128 /*---------------------------------------------------------------------*/
129 /*! \name change */
130 /*! \{ */
132 virtual void changed(ConstFieldMaskArg whichField,
133 UInt32 origin,
134 BitVector detail);
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name dump */
139 /*! \{ */
141 virtual void dump( UInt32 uiIndent = 0,
142 const BitVector bvFlags = 0) const;
144 /*! \} */
145 /*========================= PROTECTED ===============================*/
147 protected:
149 ViewportDrawTaskRefPtr _pForegroundTask;
151 /*---------------------------------------------------------------------*/
152 /*! \name Constructors */
153 /*! \{ */
155 Viewport(void);
156 Viewport(const Viewport &source);
158 /*! \} */
159 /*---------------------------------------------------------------------*/
160 /*! \name Destructors */
161 /*! \{ */
163 virtual ~Viewport(void);
165 /*! \} */
166 /*---------------------------------------------------------------------*/
167 /*! \name Destructors */
168 /*! \{ */
170 static void initMethod(InitPhase ePhase);
172 /*! \} */
173 /*---------------------------------------------------------------------*/
174 /*! \name MT Construction */
175 /*! \{ */
177 void renderForegrounds(Window *pWin,
178 Int32 iDrawerId,
179 Int32 iDrawableId);
181 /*! \} */
182 /*---------------------------------------------------------------------*/
183 /*! \name MT Construction */
184 /*! \{ */
186 void onCreate (const Viewport *source = NULL);
188 void onCreateAspect (const Viewport *createAspect,
189 const Viewport *source = NULL);
191 void onDestroy ( UInt32 uiContainerId);
193 void onDestroyAspect( UInt32 uiContainerId,
194 UInt32 uiAspect );
196 /*! \} */
197 /*========================= PRIVATE ===============================*/
199 private:
201 friend class FieldContainer;
202 friend class ViewportBase;
203 friend class ViewportDrawTask;
205 // prohibit default functions (move to 'public' if you need one)
206 void operator =(const Viewport &source);
209 //---------------------------------------------------------------------------
210 // Exported Types
211 //---------------------------------------------------------------------------
213 typedef Viewport *ViewportP;
215 OSG_END_NAMESPACE
217 #include "OSGViewportBase.inl"
218 #include "OSGViewport.inl"
220 #endif /* _OSGVIEWPORT_H_ */