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 ScreenTransform
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSCREENTRANSFORMBASE_H_
55 #define _OSGSCREENTRANSFORMBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGGroupDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGGroup.h" // Parent
68 #include "OSGNodeFields.h" // Beacon type
69 #include "OSGSysFields.h" // InvertWorldTransform type
70 #include "OSGMathFields.h" // View type
72 #include "OSGScreenTransformFields.h"
77 class ScreenTransform
;
79 //! \brief ScreenTransform Base Class.
81 class OSG_GROUP_DLLMAPPING ScreenTransformBase
: public Group
85 typedef Group Inherited
;
86 typedef Group ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(ScreenTransform
);
93 /*========================== PUBLIC =================================*/
99 BeaconFieldId
= Inherited::NextFieldId
,
100 InvertWorldTransformFieldId
= BeaconFieldId
+ 1,
101 InvertViewTransformFieldId
= InvertWorldTransformFieldId
+ 1,
102 ApplyBeaconRotationFieldId
= InvertViewTransformFieldId
+ 1,
103 ApplyBeaconScreenTranslationFieldId
= ApplyBeaconRotationFieldId
+ 1,
104 ViewFieldId
= ApplyBeaconScreenTranslationFieldId
+ 1,
105 NextFieldId
= ViewFieldId
+ 1
108 static const OSG::BitVector BeaconFieldMask
=
109 (TypeTraits
<BitVector
>::One
<< BeaconFieldId
);
110 static const OSG::BitVector InvertWorldTransformFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< InvertWorldTransformFieldId
);
112 static const OSG::BitVector InvertViewTransformFieldMask
=
113 (TypeTraits
<BitVector
>::One
<< InvertViewTransformFieldId
);
114 static const OSG::BitVector ApplyBeaconRotationFieldMask
=
115 (TypeTraits
<BitVector
>::One
<< ApplyBeaconRotationFieldId
);
116 static const OSG::BitVector ApplyBeaconScreenTranslationFieldMask
=
117 (TypeTraits
<BitVector
>::One
<< ApplyBeaconScreenTranslationFieldId
);
118 static const OSG::BitVector ViewFieldMask
=
119 (TypeTraits
<BitVector
>::One
<< ViewFieldId
);
120 static const OSG::BitVector NextFieldMask
=
121 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
123 typedef SFWeakNodePtr SFBeaconType
;
124 typedef SFBool SFInvertWorldTransformType
;
125 typedef SFBool SFInvertViewTransformType
;
126 typedef SFBool SFApplyBeaconRotationType
;
127 typedef SFBool SFApplyBeaconScreenTranslationType
;
128 typedef SFMatrix SFViewType
;
130 /*---------------------------------------------------------------------*/
131 /*! \name Class Get */
134 static FieldContainerType
&getClassType (void);
135 static UInt32
getClassTypeId (void);
136 static UInt16
getClassGroupId(void);
139 /*---------------------------------------------------------------------*/
140 /*! \name FieldContainer Get */
143 virtual FieldContainerType
&getType (void);
144 virtual const FieldContainerType
&getType (void) const;
146 virtual UInt32
getContainerSize(void) const;
149 /*---------------------------------------------------------------------*/
150 /*! \name Field Get */
153 const SFWeakNodePtr
*getSFBeacon (void) const;
154 SFWeakNodePtr
*editSFBeacon (void);
156 SFBool
*editSFInvertWorldTransform(void);
157 const SFBool
*getSFInvertWorldTransform (void) const;
159 SFBool
*editSFInvertViewTransform(void);
160 const SFBool
*getSFInvertViewTransform (void) const;
162 SFBool
*editSFApplyBeaconRotation(void);
163 const SFBool
*getSFApplyBeaconRotation (void) const;
165 SFBool
*editSFApplyBeaconScreenTranslation(void);
166 const SFBool
*getSFApplyBeaconScreenTranslation (void) const;
168 SFMatrix
*editSFView (void);
169 const SFMatrix
*getSFView (void) const;
172 Node
* getBeacon (void) const;
174 bool &editInvertWorldTransform(void);
175 bool getInvertWorldTransform (void) const;
177 bool &editInvertViewTransform(void);
178 bool getInvertViewTransform (void) const;
180 bool &editApplyBeaconRotation(void);
181 bool getApplyBeaconRotation (void) const;
183 bool &editApplyBeaconScreenTranslation(void);
184 bool getApplyBeaconScreenTranslation (void) const;
186 Matrix
&editView (void);
187 const Matrix
&getView (void) const;
190 /*---------------------------------------------------------------------*/
191 /*! \name Field Set */
194 void setBeacon (Node
* const value
);
195 void setInvertWorldTransform(const bool value
);
196 void setInvertViewTransform(const bool value
);
197 void setApplyBeaconRotation(const bool value
);
198 void setApplyBeaconScreenTranslation(const bool value
);
199 void setView (const Matrix
&value
);
202 /*---------------------------------------------------------------------*/
203 /*! \name Ptr Field Set */
207 /*---------------------------------------------------------------------*/
208 /*! \name Ptr MField Set */
212 /*---------------------------------------------------------------------*/
213 /*! \name Binary Access */
216 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
217 virtual void copyToBin (BinaryDataHandler
&pMem
,
218 ConstFieldMaskArg whichField
);
219 virtual void copyFromBin(BinaryDataHandler
&pMem
,
220 ConstFieldMaskArg whichField
);
224 /*---------------------------------------------------------------------*/
225 /*! \name Construction */
228 static ScreenTransformTransitPtr
create (void);
229 static ScreenTransform
*createEmpty (void);
231 static ScreenTransformTransitPtr
createLocal (
232 BitVector bFlags
= FCLocal::All
);
234 static ScreenTransform
*createEmptyLocal(
235 BitVector bFlags
= FCLocal::All
);
237 static ScreenTransformTransitPtr
createDependent (BitVector bFlags
);
240 /*---------------------------------------------------------------------*/
244 virtual FieldContainerTransitPtr
shallowCopy (void) const;
245 virtual FieldContainerTransitPtr
shallowCopyLocal(
246 BitVector bFlags
= FCLocal::All
) const;
247 virtual FieldContainerTransitPtr
shallowCopyDependent(
248 BitVector bFlags
) const;
251 /*========================= PROTECTED ===============================*/
255 static TypeObject _type
;
257 static void classDescInserter(TypeObject
&oType
);
258 static const Char8
*getClassname (void );
260 /*---------------------------------------------------------------------*/
264 SFWeakNodePtr _sfBeacon
;
265 SFBool _sfInvertWorldTransform
;
266 SFBool _sfInvertViewTransform
;
267 SFBool _sfApplyBeaconRotation
;
268 SFBool _sfApplyBeaconScreenTranslation
;
272 /*---------------------------------------------------------------------*/
273 /*! \name Constructors */
276 ScreenTransformBase(void);
277 ScreenTransformBase(const ScreenTransformBase
&source
);
280 /*---------------------------------------------------------------------*/
281 /*! \name Destructors */
284 virtual ~ScreenTransformBase(void);
287 /*---------------------------------------------------------------------*/
288 /*! \name onCreate */
291 void onCreate(const ScreenTransform
*source
= NULL
);
294 /*---------------------------------------------------------------------*/
295 /*! \name Generic Field Access */
298 GetFieldHandlePtr
getHandleBeacon (void) const;
299 EditFieldHandlePtr
editHandleBeacon (void);
300 GetFieldHandlePtr
getHandleInvertWorldTransform (void) const;
301 EditFieldHandlePtr
editHandleInvertWorldTransform(void);
302 GetFieldHandlePtr
getHandleInvertViewTransform (void) const;
303 EditFieldHandlePtr
editHandleInvertViewTransform(void);
304 GetFieldHandlePtr
getHandleApplyBeaconRotation (void) const;
305 EditFieldHandlePtr
editHandleApplyBeaconRotation(void);
306 GetFieldHandlePtr
getHandleApplyBeaconScreenTranslation (void) const;
307 EditFieldHandlePtr
editHandleApplyBeaconScreenTranslation(void);
308 GetFieldHandlePtr
getHandleView (void) const;
309 EditFieldHandlePtr
editHandleView (void);
312 /*---------------------------------------------------------------------*/
316 #ifdef OSG_MT_CPTR_ASPECT
317 virtual void execSyncV( FieldContainer
&oFrom
,
318 ConstFieldMaskArg whichField
,
319 AspectOffsetStore
&oOffsets
,
320 ConstFieldMaskArg syncMode
,
321 const UInt32 uiSyncInfo
);
323 void execSync ( ScreenTransformBase
*pFrom
,
324 ConstFieldMaskArg whichField
,
325 AspectOffsetStore
&oOffsets
,
326 ConstFieldMaskArg syncMode
,
327 const UInt32 uiSyncInfo
);
331 /*---------------------------------------------------------------------*/
336 /*---------------------------------------------------------------------*/
337 /*! \name Aspect Create */
340 #ifdef OSG_MT_CPTR_ASPECT
341 virtual FieldContainer
*createAspectCopy(
342 const FieldContainer
*pRefAspect
) const;
346 /*---------------------------------------------------------------------*/
350 /*---------------------------------------------------------------------*/
354 virtual void resolveLinks(void);
357 /*========================== PRIVATE ================================*/
360 /*---------------------------------------------------------------------*/
362 // prohibit default functions (move to 'public' if you need one)
363 void operator =(const ScreenTransformBase
&source
);
366 typedef ScreenTransformBase
*ScreenTransformBaseP
;
368 typedef CoredNodeRefPtr
<ScreenTransform
> ScreenTransformNodeRefPtr
;
369 typedef CoredNodeMTRefPtr
<ScreenTransform
> ScreenTransformNodeMTRefPtr
;
373 #endif /* _OSGSCREENTRANSFORMBASE_H_ */