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 **
48 ** class CSMPerspectiveCamera
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGCSMPERSPECTIVECAMERABASE_H_
55 #define _OSGCSMPERSPECTIVECAMERABASE_H_
61 #include "OSGConfig.h"
62 #include "OSGContribCSMDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGPerspectiveCamera.h" // Parent
68 #include "OSGSysFields.h" // EyeSeparation type
69 #include "OSGNodeFields.h" // HeadBeacon type
71 #include "OSGCSMPerspectiveCameraFields.h"
76 class CSMPerspectiveCamera
;
78 //! \brief CSMPerspectiveCamera Base Class.
80 class OSG_CONTRIBCSM_DLLMAPPING CSMPerspectiveCameraBase
: public PerspectiveCamera
84 typedef PerspectiveCamera Inherited
;
85 typedef PerspectiveCamera ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(CSMPerspectiveCamera
);
92 /*========================== PUBLIC =================================*/
98 EyeSeparationFieldId
= Inherited::NextFieldId
,
99 ZeroParallaxFieldId
= EyeSeparationFieldId
+ 1,
100 HeadBeaconFieldId
= ZeroParallaxFieldId
+ 1,
101 NextFieldId
= HeadBeaconFieldId
+ 1
104 static const OSG::BitVector EyeSeparationFieldMask
=
105 (TypeTraits
<BitVector
>::One
<< EyeSeparationFieldId
);
106 static const OSG::BitVector ZeroParallaxFieldMask
=
107 (TypeTraits
<BitVector
>::One
<< ZeroParallaxFieldId
);
108 static const OSG::BitVector HeadBeaconFieldMask
=
109 (TypeTraits
<BitVector
>::One
<< HeadBeaconFieldId
);
110 static const OSG::BitVector NextFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
113 typedef SFReal32 SFEyeSeparationType
;
114 typedef SFReal32 SFZeroParallaxType
;
115 typedef SFWeakNodePtr SFHeadBeaconType
;
117 /*---------------------------------------------------------------------*/
118 /*! \name Class Get */
121 static FieldContainerType
&getClassType (void);
122 static UInt32
getClassTypeId (void);
123 static UInt16
getClassGroupId(void);
126 /*---------------------------------------------------------------------*/
127 /*! \name FieldContainer Get */
130 virtual FieldContainerType
&getType (void);
131 virtual const FieldContainerType
&getType (void) const;
133 virtual UInt32
getContainerSize(void) const;
136 /*---------------------------------------------------------------------*/
137 /*! \name Field Get */
141 SFReal32
*editSFEyeSeparation (void);
142 const SFReal32
*getSFEyeSeparation (void) const;
144 SFReal32
*editSFZeroParallax (void);
145 const SFReal32
*getSFZeroParallax (void) const;
146 const SFWeakNodePtr
*getSFHeadBeacon (void) const;
147 SFWeakNodePtr
*editSFHeadBeacon (void);
150 Real32
&editEyeSeparation (void);
151 Real32
getEyeSeparation (void) const;
153 Real32
&editZeroParallax (void);
154 Real32
getZeroParallax (void) const;
156 Node
* getHeadBeacon (void) const;
159 /*---------------------------------------------------------------------*/
160 /*! \name Field Set */
163 void setEyeSeparation (const Real32 value
);
164 void setZeroParallax (const Real32 value
);
165 void setHeadBeacon (Node
* const value
);
168 /*---------------------------------------------------------------------*/
169 /*! \name Ptr Field Set */
173 /*---------------------------------------------------------------------*/
174 /*! \name Ptr MField Set */
178 /*---------------------------------------------------------------------*/
179 /*! \name Binary Access */
182 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
183 virtual void copyToBin (BinaryDataHandler
&pMem
,
184 ConstFieldMaskArg whichField
);
185 virtual void copyFromBin(BinaryDataHandler
&pMem
,
186 ConstFieldMaskArg whichField
);
190 /*---------------------------------------------------------------------*/
191 /*! \name Construction */
194 static CSMPerspectiveCameraTransitPtr
create (void);
195 static CSMPerspectiveCamera
*createEmpty (void);
197 static CSMPerspectiveCameraTransitPtr
createLocal (
198 BitVector bFlags
= FCLocal::All
);
200 static CSMPerspectiveCamera
*createEmptyLocal(
201 BitVector bFlags
= FCLocal::All
);
203 static CSMPerspectiveCameraTransitPtr
createDependent (BitVector bFlags
);
206 /*---------------------------------------------------------------------*/
210 virtual FieldContainerTransitPtr
shallowCopy (void) const;
211 virtual FieldContainerTransitPtr
shallowCopyLocal(
212 BitVector bFlags
= FCLocal::All
) const;
213 virtual FieldContainerTransitPtr
shallowCopyDependent(
214 BitVector bFlags
) const;
217 /*========================= PROTECTED ===============================*/
221 static TypeObject _type
;
223 static void classDescInserter(TypeObject
&oType
);
224 static const Char8
*getClassname (void );
226 /*---------------------------------------------------------------------*/
230 SFReal32 _sfEyeSeparation
;
231 SFReal32 _sfZeroParallax
;
232 SFWeakNodePtr _sfHeadBeacon
;
235 /*---------------------------------------------------------------------*/
236 /*! \name Constructors */
239 CSMPerspectiveCameraBase(void);
240 CSMPerspectiveCameraBase(const CSMPerspectiveCameraBase
&source
);
243 /*---------------------------------------------------------------------*/
244 /*! \name Destructors */
247 virtual ~CSMPerspectiveCameraBase(void);
250 /*---------------------------------------------------------------------*/
251 /*! \name onCreate */
254 void onCreate(const CSMPerspectiveCamera
*source
= NULL
);
257 /*---------------------------------------------------------------------*/
258 /*! \name Generic Field Access */
261 GetFieldHandlePtr
getHandleEyeSeparation (void) const;
262 EditFieldHandlePtr
editHandleEyeSeparation (void);
263 GetFieldHandlePtr
getHandleZeroParallax (void) const;
264 EditFieldHandlePtr
editHandleZeroParallax (void);
265 GetFieldHandlePtr
getHandleHeadBeacon (void) const;
266 EditFieldHandlePtr
editHandleHeadBeacon (void);
269 /*---------------------------------------------------------------------*/
273 #ifdef OSG_MT_CPTR_ASPECT
274 virtual void execSyncV( FieldContainer
&oFrom
,
275 ConstFieldMaskArg whichField
,
276 AspectOffsetStore
&oOffsets
,
277 ConstFieldMaskArg syncMode
,
278 const UInt32 uiSyncInfo
);
280 void execSync ( CSMPerspectiveCameraBase
*pFrom
,
281 ConstFieldMaskArg whichField
,
282 AspectOffsetStore
&oOffsets
,
283 ConstFieldMaskArg syncMode
,
284 const UInt32 uiSyncInfo
);
288 /*---------------------------------------------------------------------*/
293 /*---------------------------------------------------------------------*/
294 /*! \name Aspect Create */
297 #ifdef OSG_MT_CPTR_ASPECT
298 virtual FieldContainer
*createAspectCopy(
299 const FieldContainer
*pRefAspect
) const;
303 /*---------------------------------------------------------------------*/
307 /*---------------------------------------------------------------------*/
311 virtual void resolveLinks(void);
314 /*========================== PRIVATE ================================*/
317 /*---------------------------------------------------------------------*/
319 // prohibit default functions (move to 'public' if you need one)
320 void operator =(const CSMPerspectiveCameraBase
&source
);
323 typedef CSMPerspectiveCameraBase
*CSMPerspectiveCameraBaseP
;
327 #endif /* _OSGCSMPERSPECTIVECAMERABASE_H_ */