changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / OSGCSMViewportBase.h
blob42b5eb89e84bbeac0886f4afe38f261f0090d0cd
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class CSMViewport
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGCSMVIEWPORTBASE_H_
55 #define _OSGCSMVIEWPORTBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGContribCSMDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachmentContainer.h" // Parent
68 #include "OSGNodeFields.h" // Root type
69 #include "OSGCameraFields.h" // Camera type
70 #include "OSGBackgroundFields.h" // Background type
71 #include "OSGForegroundFields.h" // Foregrounds type
72 #include "OSGVecFields.h" // LeftBottom type
73 #include "OSGSysFields.h" // TravMask type
74 #include "OSGRenderOptionsFields.h" // RenderOptions type
75 #include "OSGBaseFields.h" // StereoMode type
76 #include "OSGMouseDataFields.h" // MouseDataVC type
77 #include "OSGMTouchDataFields.h" // MTouchDataVC type
79 #include "OSGCSMViewportFields.h"
81 OSG_BEGIN_NAMESPACE
84 class CSMViewport;
86 //! \brief CSMViewport Base Class.
88 class OSG_CONTRIBCSM_DLLMAPPING CSMViewportBase : public AttachmentContainer
90 public:
92 typedef AttachmentContainer Inherited;
93 typedef AttachmentContainer ParentContainer;
95 typedef Inherited::TypeObject TypeObject;
96 typedef TypeObject::InitPhase InitPhase;
98 OSG_GEN_INTERNALPTR(CSMViewport);
100 /*========================== PUBLIC =================================*/
102 public:
104 enum
106 RootFieldId = Inherited::NextFieldId,
107 CameraFieldId = RootFieldId + 1,
108 BackgroundFieldId = CameraFieldId + 1,
109 ForegroundsFieldId = BackgroundFieldId + 1,
110 LeftBottomFieldId = ForegroundsFieldId + 1,
111 RightTopFieldId = LeftBottomFieldId + 1,
112 TravMaskFieldId = RightTopFieldId + 1,
113 RenderOptionsFieldId = TravMaskFieldId + 1,
114 StereoModeFieldId = RenderOptionsFieldId + 1,
115 PassiveFieldId = StereoModeFieldId + 1,
116 ServerIdFieldId = PassiveFieldId + 1,
117 MouseDataVCFieldId = ServerIdFieldId + 1,
118 MTouchDataVCFieldId = MouseDataVCFieldId + 1,
119 NextFieldId = MTouchDataVCFieldId + 1
122 static const OSG::BitVector RootFieldMask =
123 (TypeTraits<BitVector>::One << RootFieldId);
124 static const OSG::BitVector CameraFieldMask =
125 (TypeTraits<BitVector>::One << CameraFieldId);
126 static const OSG::BitVector BackgroundFieldMask =
127 (TypeTraits<BitVector>::One << BackgroundFieldId);
128 static const OSG::BitVector ForegroundsFieldMask =
129 (TypeTraits<BitVector>::One << ForegroundsFieldId);
130 static const OSG::BitVector LeftBottomFieldMask =
131 (TypeTraits<BitVector>::One << LeftBottomFieldId);
132 static const OSG::BitVector RightTopFieldMask =
133 (TypeTraits<BitVector>::One << RightTopFieldId);
134 static const OSG::BitVector TravMaskFieldMask =
135 (TypeTraits<BitVector>::One << TravMaskFieldId);
136 static const OSG::BitVector RenderOptionsFieldMask =
137 (TypeTraits<BitVector>::One << RenderOptionsFieldId);
138 static const OSG::BitVector StereoModeFieldMask =
139 (TypeTraits<BitVector>::One << StereoModeFieldId);
140 static const OSG::BitVector PassiveFieldMask =
141 (TypeTraits<BitVector>::One << PassiveFieldId);
142 static const OSG::BitVector ServerIdFieldMask =
143 (TypeTraits<BitVector>::One << ServerIdFieldId);
144 static const OSG::BitVector MouseDataVCFieldMask =
145 (TypeTraits<BitVector>::One << MouseDataVCFieldId);
146 static const OSG::BitVector MTouchDataVCFieldMask =
147 (TypeTraits<BitVector>::One << MTouchDataVCFieldId);
148 static const OSG::BitVector NextFieldMask =
149 (TypeTraits<BitVector>::One << NextFieldId);
151 typedef SFUnrecNodePtr SFRootType;
152 typedef SFUnrecCameraPtr SFCameraType;
153 typedef SFUnrecBackgroundPtr SFBackgroundType;
154 typedef MFUnrecForegroundPtr MFForegroundsType;
155 typedef SFVec2f SFLeftBottomType;
156 typedef SFVec2f SFRightTopType;
157 typedef SFUInt32 SFTravMaskType;
158 typedef SFUnrecRenderOptionsPtr SFRenderOptionsType;
159 typedef SFString SFStereoModeType;
160 typedef SFBool SFPassiveType;
161 typedef SFInt32 SFServerIdType;
162 typedef SFMouseData SFMouseDataVCType;
163 typedef SFMTouchData SFMTouchDataVCType;
165 /*---------------------------------------------------------------------*/
166 /*! \name Class Get */
167 /*! \{ */
169 static FieldContainerType &getClassType (void);
170 static UInt32 getClassTypeId (void);
171 static UInt16 getClassGroupId(void);
173 /*! \} */
174 /*---------------------------------------------------------------------*/
175 /*! \name FieldContainer Get */
176 /*! \{ */
178 virtual FieldContainerType &getType (void);
179 virtual const FieldContainerType &getType (void) const;
181 virtual UInt32 getContainerSize(void) const;
183 /*! \} */
184 /*---------------------------------------------------------------------*/
185 /*! \name Field Get */
186 /*! \{ */
188 const SFUnrecNodePtr *getSFRoot (void) const;
189 SFUnrecNodePtr *editSFRoot (void);
190 const SFUnrecCameraPtr *getSFCamera (void) const;
191 SFUnrecCameraPtr *editSFCamera (void);
192 const SFUnrecBackgroundPtr *getSFBackground (void) const;
193 SFUnrecBackgroundPtr *editSFBackground (void);
194 const MFUnrecForegroundPtr *getMFForegrounds (void) const;
195 MFUnrecForegroundPtr *editMFForegrounds (void);
197 SFVec2f *editSFLeftBottom (void);
198 const SFVec2f *getSFLeftBottom (void) const;
200 SFVec2f *editSFRightTop (void);
201 const SFVec2f *getSFRightTop (void) const;
203 SFUInt32 *editSFTravMask (void);
204 const SFUInt32 *getSFTravMask (void) const;
205 const SFUnrecRenderOptionsPtr *getSFRenderOptions (void) const;
206 SFUnrecRenderOptionsPtr *editSFRenderOptions (void);
208 SFString *editSFStereoMode (void);
209 const SFString *getSFStereoMode (void) const;
211 SFBool *editSFPassive (void);
212 const SFBool *getSFPassive (void) const;
214 SFInt32 *editSFServerId (void);
215 const SFInt32 *getSFServerId (void) const;
217 SFMouseData *editSFMouseDataVC (void);
218 const SFMouseData *getSFMouseDataVC (void) const;
220 SFMTouchData *editSFMTouchDataVC (void);
221 const SFMTouchData *getSFMTouchDataVC (void) const;
224 Node * getRoot (void) const;
226 Camera * getCamera (void) const;
228 Background * getBackground (void) const;
230 Foreground * getForegrounds (const UInt32 index) const;
232 Vec2f &editLeftBottom (void);
233 const Vec2f &getLeftBottom (void) const;
235 Vec2f &editRightTop (void);
236 const Vec2f &getRightTop (void) const;
238 UInt32 &editTravMask (void);
239 UInt32 getTravMask (void) const;
241 RenderOptions * getRenderOptions (void) const;
243 std::string &editStereoMode (void);
244 const std::string &getStereoMode (void) const;
246 bool &editPassive (void);
247 bool getPassive (void) const;
249 Int32 &editServerId (void);
250 Int32 getServerId (void) const;
252 MouseData &editMouseDataVC (void);
253 const MouseData &getMouseDataVC (void) const;
255 MTouchData &editMTouchDataVC (void);
256 const MTouchData &getMTouchDataVC (void) const;
258 /*! \} */
259 /*---------------------------------------------------------------------*/
260 /*! \name Field Set */
261 /*! \{ */
263 void setRoot (Node * const value);
264 void setCamera (Camera * const value);
265 void setBackground (Background * const value);
266 void setLeftBottom (const Vec2f &value);
267 void setRightTop (const Vec2f &value);
268 void setTravMask (const UInt32 value);
269 void setRenderOptions (RenderOptions * const value);
270 void setStereoMode (const std::string &value);
271 void setPassive (const bool value);
272 void setServerId (const Int32 value);
273 void setMouseDataVC (const MouseData &value);
274 void setMTouchDataVC (const MTouchData &value);
276 /*! \} */
277 /*---------------------------------------------------------------------*/
278 /*! \name Ptr Field Set */
279 /*! \{ */
281 /*! \} */
282 /*---------------------------------------------------------------------*/
283 /*! \name Ptr MField Set */
284 /*! \{ */
286 void pushToForegrounds (Foreground * const value );
287 void assignForegrounds (const MFUnrecForegroundPtr &value);
288 void removeFromForegrounds (UInt32 uiIndex );
289 void removeObjFromForegrounds(Foreground * const value );
290 void clearForegrounds (void );
292 /*! \} */
293 /*---------------------------------------------------------------------*/
294 /*! \name Binary Access */
295 /*! \{ */
297 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
298 virtual void copyToBin (BinaryDataHandler &pMem,
299 ConstFieldMaskArg whichField);
300 virtual void copyFromBin(BinaryDataHandler &pMem,
301 ConstFieldMaskArg whichField);
304 /*! \} */
305 /*---------------------------------------------------------------------*/
306 /*! \name Construction */
307 /*! \{ */
309 static CSMViewportTransitPtr create (void);
310 static CSMViewport *createEmpty (void);
312 static CSMViewportTransitPtr createLocal (
313 BitVector bFlags = FCLocal::All);
315 static CSMViewport *createEmptyLocal(
316 BitVector bFlags = FCLocal::All);
318 static CSMViewportTransitPtr createDependent (BitVector bFlags);
320 /*! \} */
321 /*---------------------------------------------------------------------*/
322 /*! \name Copy */
323 /*! \{ */
325 virtual FieldContainerTransitPtr shallowCopy (void) const;
326 virtual FieldContainerTransitPtr shallowCopyLocal(
327 BitVector bFlags = FCLocal::All) const;
328 virtual FieldContainerTransitPtr shallowCopyDependent(
329 BitVector bFlags) const;
331 /*! \} */
332 /*========================= PROTECTED ===============================*/
334 protected:
336 static TypeObject _type;
338 static void classDescInserter(TypeObject &oType);
339 static const Char8 *getClassname (void );
341 /*---------------------------------------------------------------------*/
342 /*! \name Fields */
343 /*! \{ */
345 SFUnrecNodePtr _sfRoot;
346 SFUnrecCameraPtr _sfCamera;
347 SFUnrecBackgroundPtr _sfBackground;
348 MFUnrecForegroundPtr _mfForegrounds;
349 SFVec2f _sfLeftBottom;
350 SFVec2f _sfRightTop;
351 SFUInt32 _sfTravMask;
352 SFUnrecRenderOptionsPtr _sfRenderOptions;
353 SFString _sfStereoMode;
354 SFBool _sfPassive;
355 SFInt32 _sfServerId;
356 SFMouseData _sfMouseDataVC;
357 SFMTouchData _sfMTouchDataVC;
359 /*! \} */
360 /*---------------------------------------------------------------------*/
361 /*! \name Constructors */
362 /*! \{ */
364 CSMViewportBase(void);
365 CSMViewportBase(const CSMViewportBase &source);
367 /*! \} */
368 /*---------------------------------------------------------------------*/
369 /*! \name Destructors */
370 /*! \{ */
372 virtual ~CSMViewportBase(void);
374 /*! \} */
375 /*---------------------------------------------------------------------*/
376 /*! \name onCreate */
377 /*! \{ */
379 void onCreate(const CSMViewport *source = NULL);
381 /*! \} */
382 /*---------------------------------------------------------------------*/
383 /*! \name Generic Field Access */
384 /*! \{ */
386 GetFieldHandlePtr getHandleRoot (void) const;
387 EditFieldHandlePtr editHandleRoot (void);
388 GetFieldHandlePtr getHandleCamera (void) const;
389 EditFieldHandlePtr editHandleCamera (void);
390 GetFieldHandlePtr getHandleBackground (void) const;
391 EditFieldHandlePtr editHandleBackground (void);
392 GetFieldHandlePtr getHandleForegrounds (void) const;
393 EditFieldHandlePtr editHandleForegrounds (void);
394 GetFieldHandlePtr getHandleLeftBottom (void) const;
395 EditFieldHandlePtr editHandleLeftBottom (void);
396 GetFieldHandlePtr getHandleRightTop (void) const;
397 EditFieldHandlePtr editHandleRightTop (void);
398 GetFieldHandlePtr getHandleTravMask (void) const;
399 EditFieldHandlePtr editHandleTravMask (void);
400 GetFieldHandlePtr getHandleRenderOptions (void) const;
401 EditFieldHandlePtr editHandleRenderOptions (void);
402 GetFieldHandlePtr getHandleStereoMode (void) const;
403 EditFieldHandlePtr editHandleStereoMode (void);
404 GetFieldHandlePtr getHandlePassive (void) const;
405 EditFieldHandlePtr editHandlePassive (void);
406 GetFieldHandlePtr getHandleServerId (void) const;
407 EditFieldHandlePtr editHandleServerId (void);
408 GetFieldHandlePtr getHandleMouseDataVC (void) const;
409 EditFieldHandlePtr editHandleMouseDataVC (void);
410 GetFieldHandlePtr getHandleMTouchDataVC (void) const;
411 EditFieldHandlePtr editHandleMTouchDataVC (void);
413 /*! \} */
414 /*---------------------------------------------------------------------*/
415 /*! \name Sync */
416 /*! \{ */
418 #ifdef OSG_MT_CPTR_ASPECT
419 virtual void execSyncV( FieldContainer &oFrom,
420 ConstFieldMaskArg whichField,
421 AspectOffsetStore &oOffsets,
422 ConstFieldMaskArg syncMode ,
423 const UInt32 uiSyncInfo);
425 void execSync ( CSMViewportBase *pFrom,
426 ConstFieldMaskArg whichField,
427 AspectOffsetStore &oOffsets,
428 ConstFieldMaskArg syncMode ,
429 const UInt32 uiSyncInfo);
430 #endif
432 /*! \} */
433 /*---------------------------------------------------------------------*/
434 /*! \name Edit */
435 /*! \{ */
437 /*! \} */
438 /*---------------------------------------------------------------------*/
439 /*! \name Aspect Create */
440 /*! \{ */
442 #ifdef OSG_MT_CPTR_ASPECT
443 virtual FieldContainer *createAspectCopy(
444 const FieldContainer *pRefAspect) const;
445 #endif
447 /*! \} */
448 /*---------------------------------------------------------------------*/
449 /*! \name Edit */
450 /*! \{ */
451 /*! \} */
452 /*---------------------------------------------------------------------*/
453 /*! \name Sync */
454 /*! \{ */
456 virtual void resolveLinks(void);
458 /*! \} */
459 /*========================== PRIVATE ================================*/
461 private:
462 /*---------------------------------------------------------------------*/
464 // prohibit default functions (move to 'public' if you need one)
465 void operator =(const CSMViewportBase &source);
468 typedef CSMViewportBase *CSMViewportBaseP;
470 OSG_END_NAMESPACE
472 #endif /* _OSGCSMVIEWPORTBASE_H_ */