1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGWINDOWBASE_H_
55 #define _OSGWINDOWBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGHardwareContext.h" // Parent
68 #include "OSGSysFields.h" // Width type
69 #include "OSGViewportFields.h" // Port type
70 #include "OSGRenderOptionsFields.h" // RenderOptions type
71 #include "OSGBaseFields.h" // RendererInfo type
72 #include "OSGDrawTask.h" // DrawTasks type
74 #include "OSGWindowFields.h"
81 //! \brief Window Base Class.
83 class OSG_SYSTEM_DLLMAPPING WindowBase
: public HardwareContext
87 typedef HardwareContext Inherited
;
88 typedef HardwareContext ParentContainer
;
90 typedef Inherited::TypeObject TypeObject
;
91 typedef TypeObject::InitPhase InitPhase
;
93 OSG_GEN_INTERNALPTR(Window
);
95 /*========================== PUBLIC =================================*/
101 WidthFieldId
= Inherited::NextFieldId
,
102 HeightFieldId
= WidthFieldId
+ 1,
103 PortFieldId
= HeightFieldId
+ 1,
104 GlObjectEventCounterFieldId
= PortFieldId
+ 1,
105 GlObjectLastRefreshFieldId
= GlObjectEventCounterFieldId
+ 1,
106 GlObjectLastReinitializeFieldId
= GlObjectLastRefreshFieldId
+ 1,
107 DrawerIdFieldId
= GlObjectLastReinitializeFieldId
+ 1,
108 RequestMajorFieldId
= DrawerIdFieldId
+ 1,
109 RequestMinorFieldId
= RequestMajorFieldId
+ 1,
110 ContextFlagsFieldId
= RequestMinorFieldId
+ 1,
111 RenderOptionsFieldId
= ContextFlagsFieldId
+ 1,
112 IgnoreAllExtensionsFieldId
= RenderOptionsFieldId
+ 1,
113 DrawModeFieldId
= IgnoreAllExtensionsFieldId
+ 1,
114 RendererInfoFieldId
= DrawModeFieldId
+ 1,
115 DrawTasksFieldId
= RendererInfoFieldId
+ 1,
116 NextFieldId
= DrawTasksFieldId
+ 1
119 static const OSG::BitVector WidthFieldMask
=
120 (TypeTraits
<BitVector
>::One
<< WidthFieldId
);
121 static const OSG::BitVector HeightFieldMask
=
122 (TypeTraits
<BitVector
>::One
<< HeightFieldId
);
123 static const OSG::BitVector PortFieldMask
=
124 (TypeTraits
<BitVector
>::One
<< PortFieldId
);
125 static const OSG::BitVector GlObjectEventCounterFieldMask
=
126 (TypeTraits
<BitVector
>::One
<< GlObjectEventCounterFieldId
);
127 static const OSG::BitVector GlObjectLastRefreshFieldMask
=
128 (TypeTraits
<BitVector
>::One
<< GlObjectLastRefreshFieldId
);
129 static const OSG::BitVector GlObjectLastReinitializeFieldMask
=
130 (TypeTraits
<BitVector
>::One
<< GlObjectLastReinitializeFieldId
);
131 static const OSG::BitVector DrawerIdFieldMask
=
132 (TypeTraits
<BitVector
>::One
<< DrawerIdFieldId
);
133 static const OSG::BitVector RequestMajorFieldMask
=
134 (TypeTraits
<BitVector
>::One
<< RequestMajorFieldId
);
135 static const OSG::BitVector RequestMinorFieldMask
=
136 (TypeTraits
<BitVector
>::One
<< RequestMinorFieldId
);
137 static const OSG::BitVector ContextFlagsFieldMask
=
138 (TypeTraits
<BitVector
>::One
<< ContextFlagsFieldId
);
139 static const OSG::BitVector RenderOptionsFieldMask
=
140 (TypeTraits
<BitVector
>::One
<< RenderOptionsFieldId
);
141 static const OSG::BitVector IgnoreAllExtensionsFieldMask
=
142 (TypeTraits
<BitVector
>::One
<< IgnoreAllExtensionsFieldId
);
143 static const OSG::BitVector DrawModeFieldMask
=
144 (TypeTraits
<BitVector
>::One
<< DrawModeFieldId
);
145 static const OSG::BitVector RendererInfoFieldMask
=
146 (TypeTraits
<BitVector
>::One
<< RendererInfoFieldId
);
147 static const OSG::BitVector DrawTasksFieldMask
=
148 (TypeTraits
<BitVector
>::One
<< DrawTasksFieldId
);
149 static const OSG::BitVector NextFieldMask
=
150 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
152 typedef SFUInt16 SFWidthType
;
153 typedef SFUInt16 SFHeightType
;
154 typedef MFUnrecChildViewportPtr MFPortType
;
155 typedef SFUInt32 SFGlObjectEventCounterType
;
156 typedef MFUInt32 MFGlObjectLastRefreshType
;
157 typedef MFUInt32 MFGlObjectLastReinitializeType
;
158 typedef SFInt32 SFDrawerIdType
;
159 typedef SFInt32 SFRequestMajorType
;
160 typedef SFInt32 SFRequestMinorType
;
161 typedef SFInt32 SFContextFlagsType
;
162 typedef SFUnrecRenderOptionsPtr SFRenderOptionsType
;
163 typedef SFBool SFIgnoreAllExtensionsType
;
164 typedef SFUInt32 SFDrawModeType
;
165 typedef SFString SFRendererInfoType
;
166 typedef MFDrawTask MFDrawTasksType
;
168 /*---------------------------------------------------------------------*/
169 /*! \name Class Get */
172 static FieldContainerType
&getClassType (void);
173 static UInt32
getClassTypeId (void);
174 static UInt16
getClassGroupId(void);
177 /*---------------------------------------------------------------------*/
178 /*! \name FieldContainer Get */
181 virtual FieldContainerType
&getType (void);
182 virtual const FieldContainerType
&getType (void) const;
184 virtual UInt32
getContainerSize(void) const;
187 /*---------------------------------------------------------------------*/
188 /*! \name Field Get */
192 SFUInt16
*editSFWidth (void);
193 const SFUInt16
*getSFWidth (void) const;
195 SFUInt16
*editSFHeight (void);
196 const SFUInt16
*getSFHeight (void) const;
197 const MFUnrecChildViewportPtr
*getMFPort (void) const;
199 SFInt32
*editSFDrawerId (void);
200 const SFInt32
*getSFDrawerId (void) const;
202 SFInt32
*editSFRequestMajor (void);
203 const SFInt32
*getSFRequestMajor (void) const;
205 SFInt32
*editSFRequestMinor (void);
206 const SFInt32
*getSFRequestMinor (void) const;
208 SFInt32
*editSFContextFlags (void);
209 const SFInt32
*getSFContextFlags (void) const;
210 const SFUnrecRenderOptionsPtr
*getSFRenderOptions (void) const;
211 SFUnrecRenderOptionsPtr
*editSFRenderOptions (void);
213 SFBool
*editSFIgnoreAllExtensions(void);
214 const SFBool
*getSFIgnoreAllExtensions (void) const;
216 SFUInt32
*editSFDrawMode (void);
217 const SFUInt32
*getSFDrawMode (void) const;
219 SFString
*editSFRendererInfo (void);
220 const SFString
*getSFRendererInfo (void) const;
223 UInt16
&editWidth (void);
224 UInt16
getWidth (void) const;
226 UInt16
&editHeight (void);
227 UInt16
getHeight (void) const;
229 Viewport
* getPort (const UInt32 index
) const;
231 Int32
&editDrawerId (void);
232 Int32
getDrawerId (void) const;
234 Int32
&editRequestMajor (void);
235 Int32
getRequestMajor (void) const;
237 Int32
&editRequestMinor (void);
238 Int32
getRequestMinor (void) const;
240 Int32
&editContextFlags (void);
241 Int32
getContextFlags (void) const;
243 RenderOptions
* getRenderOptions (void) const;
245 bool &editIgnoreAllExtensions(void);
246 bool getIgnoreAllExtensions (void) const;
248 UInt32
&editDrawMode (void);
249 UInt32
getDrawMode (void) const;
251 std::string
&editRendererInfo (void);
252 const std::string
&getRendererInfo (void) const;
255 /*---------------------------------------------------------------------*/
256 /*! \name Field Set */
259 void setWidth (const UInt16 value
);
260 void setHeight (const UInt16 value
);
261 void setDrawerId (const Int32 value
);
262 void setRequestMajor (const Int32 value
);
263 void setRequestMinor (const Int32 value
);
264 void setContextFlags (const Int32 value
);
265 void setRenderOptions (RenderOptions
* const value
);
266 void setIgnoreAllExtensions(const bool value
);
267 void setDrawMode (const UInt32 value
);
268 void setRendererInfo (const std::string
&value
);
271 /*---------------------------------------------------------------------*/
272 /*! \name Ptr Field Set */
276 /*---------------------------------------------------------------------*/
277 /*! \name Ptr MField Set */
280 void addPort (Viewport
* const value
);
281 void assignPort (const MFUnrecChildViewportPtr
&value
);
282 void clearPorts (void );
283 void insertPort (UInt32 uiIndex
,
284 Viewport
* const value
);
285 void replacePort ( UInt32 uiIndex
,
286 Viewport
* const value
);
287 void replacePortByObj (Viewport
* const pOldElem
,
288 Viewport
* const pNewElem
);
289 void subPort (UInt32 uiIndex
);
290 void subPortByObj (Viewport
* const value
);
293 /*---------------------------------------------------------------------*/
294 /*! \name Binary Access */
297 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
298 virtual void copyToBin (BinaryDataHandler
&pMem
,
299 ConstFieldMaskArg whichField
);
300 virtual void copyFromBin(BinaryDataHandler
&pMem
,
301 ConstFieldMaskArg whichField
);
305 /*========================= PROTECTED ===============================*/
309 static TypeObject _type
;
311 static void classDescInserter(TypeObject
&oType
);
312 static const Char8
*getClassname (void );
314 /*---------------------------------------------------------------------*/
320 MFUnrecChildViewportPtr _mfPort
;
321 SFUInt32 _sfGlObjectEventCounter
;
322 MFUInt32 _mfGlObjectLastRefresh
;
323 MFUInt32 _mfGlObjectLastReinitialize
;
325 SFInt32 _sfRequestMajor
;
326 SFInt32 _sfRequestMinor
;
327 SFInt32 _sfContextFlags
;
328 SFUnrecRenderOptionsPtr _sfRenderOptions
;
329 SFBool _sfIgnoreAllExtensions
;
330 SFUInt32 _sfDrawMode
;
331 SFString _sfRendererInfo
;
332 MFDrawTask _mfDrawTasks
;
335 /*---------------------------------------------------------------------*/
336 /*! \name Constructors */
340 WindowBase(const WindowBase
&source
);
343 /*---------------------------------------------------------------------*/
344 /*! \name Destructors */
347 virtual ~WindowBase(void);
350 /*---------------------------------------------------------------------*/
351 /*! \name onCreate */
354 void onCreate(const Window
*source
= NULL
);
357 /*---------------------------------------------------------------------*/
358 /*! \name Child linking */
361 virtual bool unlinkChild(FieldContainer
* const pChild
,
362 UInt16
const childFieldId
);
365 /*---------------------------------------------------------------------*/
366 /*! \name Generic Field Access */
369 GetFieldHandlePtr
getHandleWidth (void) const;
370 EditFieldHandlePtr
editHandleWidth (void);
371 GetFieldHandlePtr
getHandleHeight (void) const;
372 EditFieldHandlePtr
editHandleHeight (void);
373 GetFieldHandlePtr
getHandlePort (void) const;
374 EditFieldHandlePtr
editHandlePort (void);
375 GetFieldHandlePtr
getHandleGlObjectEventCounter (void) const;
376 EditFieldHandlePtr
editHandleGlObjectEventCounter(void);
377 GetFieldHandlePtr
getHandleGlObjectLastRefresh (void) const;
378 EditFieldHandlePtr
editHandleGlObjectLastRefresh(void);
379 GetFieldHandlePtr
getHandleGlObjectLastReinitialize (void) const;
380 EditFieldHandlePtr
editHandleGlObjectLastReinitialize(void);
381 GetFieldHandlePtr
getHandleDrawerId (void) const;
382 EditFieldHandlePtr
editHandleDrawerId (void);
383 GetFieldHandlePtr
getHandleRequestMajor (void) const;
384 EditFieldHandlePtr
editHandleRequestMajor (void);
385 GetFieldHandlePtr
getHandleRequestMinor (void) const;
386 EditFieldHandlePtr
editHandleRequestMinor (void);
387 GetFieldHandlePtr
getHandleContextFlags (void) const;
388 EditFieldHandlePtr
editHandleContextFlags (void);
389 GetFieldHandlePtr
getHandleRenderOptions (void) const;
390 EditFieldHandlePtr
editHandleRenderOptions (void);
391 GetFieldHandlePtr
getHandleIgnoreAllExtensions (void) const;
392 EditFieldHandlePtr
editHandleIgnoreAllExtensions(void);
393 GetFieldHandlePtr
getHandleDrawMode (void) const;
394 EditFieldHandlePtr
editHandleDrawMode (void);
395 GetFieldHandlePtr
getHandleRendererInfo (void) const;
396 EditFieldHandlePtr
editHandleRendererInfo (void);
397 GetFieldHandlePtr
getHandleDrawTasks (void) const;
398 EditFieldHandlePtr
editHandleDrawTasks (void);
401 /*---------------------------------------------------------------------*/
402 /*! \name Field Get */
406 SFUInt32
*editSFGlObjectEventCounter(void);
407 const SFUInt32
*getSFGlObjectEventCounter (void) const;
409 MFUInt32
*editMFGlObjectLastRefresh(void);
410 const MFUInt32
*getMFGlObjectLastRefresh (void) const;
412 MFUInt32
*editMFGlObjectLastReinitialize(void);
413 const MFUInt32
*getMFGlObjectLastReinitialize (void) const;
414 const MFDrawTask
*getMFDrawTasks (void) const;
417 UInt32
&editGlObjectEventCounter(void);
418 UInt32
getGlObjectEventCounter (void) const;
420 MFUInt32 ::reference
editGlObjectLastRefresh(const UInt32 index
);
421 UInt32
getGlObjectLastRefresh (const UInt32 index
) const;
423 MFUInt32 ::reference
editGlObjectLastReinitialize(const UInt32 index
);
424 UInt32
getGlObjectLastReinitialize (const UInt32 index
) const;
426 DrawTask
* getDrawTasks (const UInt32 index
) const;
429 /*---------------------------------------------------------------------*/
430 /*! \name Field Set */
433 void setGlObjectEventCounter(const UInt32 value
);
436 /*---------------------------------------------------------------------*/
437 /*! \name Ptr MField Set */
441 /*---------------------------------------------------------------------*/
445 #ifdef OSG_MT_CPTR_ASPECT
446 virtual void execSyncV( FieldContainer
&oFrom
,
447 ConstFieldMaskArg whichField
,
448 AspectOffsetStore
&oOffsets
,
449 ConstFieldMaskArg syncMode
,
450 const UInt32 uiSyncInfo
);
452 void execSync ( WindowBase
*pFrom
,
453 ConstFieldMaskArg whichField
,
454 AspectOffsetStore
&oOffsets
,
455 ConstFieldMaskArg syncMode
,
456 const UInt32 uiSyncInfo
);
460 /*---------------------------------------------------------------------*/
465 /*---------------------------------------------------------------------*/
466 /*! \name Aspect Create */
470 /*---------------------------------------------------------------------*/
474 /*---------------------------------------------------------------------*/
478 virtual void resolveLinks(void);
481 /*========================== PRIVATE ================================*/
484 /*---------------------------------------------------------------------*/
486 // prohibit default functions (move to 'public' if you need one)
487 void operator =(const WindowBase
&source
);
490 typedef WindowBase
*WindowBaseP
;
494 #endif /* _OSGWINDOWBASE_H_ */