fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComplexSceneManager / OSGCSMWindow.h
blobc69d9c614dacd8c79b76735a20ace8d2a4b46124
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 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 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCSMWINDOW_H_
40 #define _OSGCSMWINDOW_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGCSMWindowBase.h"
46 #include "OSGWindow.h"
48 OSG_BEGIN_NAMESPACE
50 class StatisticsForeground;
52 /*! \brief CSMWindow class. See \ref
53 PageContribCSMCSMWindow for a description.
56 class RenderAction;
57 class CSMDrawer;
59 class OSG_CONTRIBCSM_DLLMAPPING CSMWindow : public CSMWindowBase
61 protected:
63 /*========================== PUBLIC =================================*/
65 public:
67 typedef CSMWindowBase Inherited;
68 typedef CSMWindow Self;
70 /*---------------------------------------------------------------------*/
71 /*! \name Sync */
72 /*! \{ */
74 virtual void changed(ConstFieldMaskArg whichField,
75 UInt32 origin,
76 BitVector details );
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Output */
81 /*! \{ */
83 virtual bool init(void);
85 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name Output */
88 /*! \{ */
90 Real32 getXPos (void) const;
91 Real32 getYPos (void) const;
93 Real32 getXSize (void) const;
94 Real32 getYSize (void) const;
96 CSMDrawer *getParent(void) const;
98 Window *getWindow(void) const;
100 /*! \} */
101 /*---------------------------------------------------------------------*/
102 /*! \name Output */
103 /*! \{ */
105 /*! \} */
106 /*---------------------------------------------------------------------*/
107 /*! \name Output */
108 /*! \{ */
110 virtual Vec2f translateScreenCoordinatesRel (Real32 rX,
111 Real32 rY);
113 virtual Vec2i translateGlobalCoordinatesRel (Real32 rX,
114 Real32 rY);
116 virtual Vec2i translateGlobalCoordinatesAbs (Int32 iX,
117 Int32 iY);
119 virtual Vec2f translateToScreenCoordinatesAbs(Real32 rX,
120 Real32 rY);
122 /*! \} */
123 /*---------------------------------------------------------------------*/
124 /*! \name Output */
125 /*! \{ */
127 CSMViewport *findViewport(Real32 x, Real32 y) const;
129 /*! \} */
130 /*---------------------------------------------------------------------*/
131 /*! \name Output */
132 /*! \{ */
134 void queueTask(DrawTask *pTask);
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name Output */
139 /*! \{ */
141 virtual void dump( UInt32 uiIndent = 0,
142 const BitVector bvFlags = 0) const;
144 /*! \} */
145 /*========================= PROTECTED ===============================*/
147 protected:
149 static UInt32 _extMultiSample;
150 static UInt32 _extNVMultiSampleHint;
151 static UInt32 FuncIdSampleCoverage;
153 // Variables should all be in CSMWindowBase.
155 WindowRecPtr _pWindow;
156 StatisticsForeground *_pStatFG;
157 bool _bFirstFrame;
159 MTouchData::MTouchBlob _oTouchBlob;
160 UInt32 _uiTouchMode;
161 bool _bMouseActive;
163 /*---------------------------------------------------------------------*/
164 /*! \name Constructors */
165 /*! \{ */
167 CSMWindow(void);
168 CSMWindow(const CSMWindow &source);
170 /*! \} */
171 /*---------------------------------------------------------------------*/
172 /*! \name Destructors */
173 /*! \{ */
175 virtual ~CSMWindow(void);
177 /*! \} */
178 /*---------------------------------------------------------------------*/
179 /*! \name Init */
180 /*! \{ */
182 virtual void resolveLinks(void);
184 /*! \} */
185 /*---------------------------------------------------------------------*/
186 /*! \name Init */
187 /*! \{ */
189 void reshape (Int32 w,
190 Int32 h );
192 void mouse (Int32 iButton,
193 Int32 iState,
194 Int32 iModifier,
195 Int32 x,
196 Int32 y );
198 void motion (Int32 x,
199 Int32 y,
200 Int32 iModifier );
202 void addMTouchCursor (Int32 iCursorId,
203 Int32 x,
204 Int32 y,
205 UInt32 uiCoordSys);
207 void updateMTouchCursor (Int32 iCursorId,
208 Int32 x,
209 Int32 y,
210 UInt32 uiCoordSys);
212 void removeMTouchCursor (Int32 iCursorId );
213 void commitMTouchCursors(void );
215 /*! \} */
216 /*---------------------------------------------------------------------*/
217 /*! \name Output */
218 /*! \{ */
220 virtual void render (RenderAction *pAction);
222 virtual void frameRenderNoFinish(RenderAction *pAction);
223 virtual void frameFinish (void );
224 virtual void frameExit (void );
226 void postSync (void );
228 void shutdown (void );
230 /*! \} */
231 /*---------------------------------------------------------------------*/
232 /*! \name Init */
233 /*! \{ */
235 virtual void terminateGLContext(void) = 0;
237 /*! \} */
238 /*---------------------------------------------------------------------*/
239 /*! \name Init */
240 /*! \{ */
242 bool requestStereoVisual(void);
244 /*! \} */
245 /*---------------------------------------------------------------------*/
246 /*! \name Init */
247 /*! \{ */
249 static void initMethod(InitPhase ePhase);
251 /*! \} */
252 /*========================== PRIVATE ================================*/
254 private:
256 friend class FieldContainer;
257 friend class CSMWindowBase;
258 friend class CSMDrawer;
259 friend class CSMViewport;
261 // prohibit default functions (move to 'public' if you need one)
262 void operator =(const CSMWindow &source);
265 typedef CSMWindow *CSMWindowP;
267 OSG_END_NAMESPACE
269 #include "OSGCSMWindowBase.inl"
270 #include "OSGCSMWindow.inl"
272 #endif /* _OSGCSMWINDOW_H_ */