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 TransformationInterfaceSensor
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTRANSFORMATIONINTERFACESENSORBASE_H_
55 #define _OSGTRANSFORMATIONINTERFACESENSORBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGContribCSMDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGDeviceInterfaceSensor.h" // Parent
68 #include "OSGMathFields.h" // Transformation type
69 #include "OSGVecFields.h" // Translation type
70 #include "OSGSysFields.h" // RotationScale type
72 #include "OSGTransformationInterfaceSensorFields.h"
77 class TransformationInterfaceSensor
;
79 //! \brief TransformationInterfaceSensor Base Class.
81 class OSG_CONTRIBCSM_DLLMAPPING TransformationInterfaceSensorBase
: public DeviceInterfaceSensor
85 typedef DeviceInterfaceSensor Inherited
;
86 typedef DeviceInterfaceSensor ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(TransformationInterfaceSensor
);
93 /*========================== PUBLIC =================================*/
99 TransformationFieldId
= Inherited::NextFieldId
,
100 TranslationFieldId
= TransformationFieldId
+ 1,
101 RotationFieldId
= TranslationFieldId
+ 1,
102 RotationScaleFieldId
= RotationFieldId
+ 1,
103 TranslationScaleFieldId
= RotationScaleFieldId
+ 1,
104 NextFieldId
= TranslationScaleFieldId
+ 1
107 static const OSG::BitVector TransformationFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< TransformationFieldId
);
109 static const OSG::BitVector TranslationFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< TranslationFieldId
);
111 static const OSG::BitVector RotationFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< RotationFieldId
);
113 static const OSG::BitVector RotationScaleFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< RotationScaleFieldId
);
115 static const OSG::BitVector TranslationScaleFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< TranslationScaleFieldId
);
117 static const OSG::BitVector NextFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
120 typedef SFMatrix SFTransformationType
;
121 typedef SFVec3f SFTranslationType
;
122 typedef SFQuaternion SFRotationType
;
123 typedef SFReal32 SFRotationScaleType
;
124 typedef SFReal32 SFTranslationScaleType
;
126 /*---------------------------------------------------------------------*/
127 /*! \name Class Get */
130 static FieldContainerType
&getClassType (void);
131 static UInt32
getClassTypeId (void);
132 static UInt16
getClassGroupId(void);
135 /*---------------------------------------------------------------------*/
136 /*! \name FieldContainer Get */
139 virtual FieldContainerType
&getType (void);
140 virtual const FieldContainerType
&getType (void) const;
142 virtual UInt32
getContainerSize(void) const;
145 /*---------------------------------------------------------------------*/
146 /*! \name Field Get */
150 SFMatrix
*editSFTransformation (void);
151 const SFMatrix
*getSFTransformation (void) const;
153 SFVec3f
*editSFTranslation (void);
154 const SFVec3f
*getSFTranslation (void) const;
156 SFQuaternion
*editSFRotation (void);
157 const SFQuaternion
*getSFRotation (void) const;
159 SFReal32
*editSFRotationScale (void);
160 const SFReal32
*getSFRotationScale (void) const;
163 Matrix
&editTransformation (void);
164 const Matrix
&getTransformation (void) const;
166 Vec3f
&editTranslation (void);
167 const Vec3f
&getTranslation (void) const;
169 Quaternion
&editRotation (void);
170 const Quaternion
&getRotation (void) const;
172 Real32
&editRotationScale (void);
173 Real32
getRotationScale (void) const;
176 /*---------------------------------------------------------------------*/
177 /*! \name Field Set */
180 void setTransformation (const Matrix
&value
);
181 void setTranslation (const Vec3f
&value
);
182 void setRotation (const Quaternion
&value
);
183 void setRotationScale (const Real32 value
);
186 /*---------------------------------------------------------------------*/
187 /*! \name Ptr MField Set */
191 /*---------------------------------------------------------------------*/
192 /*! \name Binary Access */
195 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
196 virtual void copyToBin (BinaryDataHandler
&pMem
,
197 ConstFieldMaskArg whichField
);
198 virtual void copyFromBin(BinaryDataHandler
&pMem
,
199 ConstFieldMaskArg whichField
);
203 /*---------------------------------------------------------------------*/
204 /*! \name Construction */
207 static TransformationInterfaceSensorTransitPtr
create (void);
208 static TransformationInterfaceSensor
*createEmpty (void);
210 static TransformationInterfaceSensorTransitPtr
createLocal (
211 BitVector bFlags
= FCLocal::All
);
213 static TransformationInterfaceSensor
*createEmptyLocal(
214 BitVector bFlags
= FCLocal::All
);
216 static TransformationInterfaceSensorTransitPtr
createDependent (BitVector bFlags
);
219 /*---------------------------------------------------------------------*/
223 virtual FieldContainerTransitPtr
shallowCopy (void) const;
224 virtual FieldContainerTransitPtr
shallowCopyLocal(
225 BitVector bFlags
= FCLocal::All
) const;
226 virtual FieldContainerTransitPtr
shallowCopyDependent(
227 BitVector bFlags
) const;
230 /*========================= PROTECTED ===============================*/
234 static TypeObject _type
;
236 static void classDescInserter(TypeObject
&oType
);
237 static const Char8
*getClassname (void );
239 /*---------------------------------------------------------------------*/
243 SFMatrix _sfTransformation
;
244 SFVec3f _sfTranslation
;
245 SFQuaternion _sfRotation
;
246 SFReal32 _sfRotationScale
;
247 SFReal32 _sfTranslationScale
;
250 /*---------------------------------------------------------------------*/
251 /*! \name Constructors */
254 TransformationInterfaceSensorBase(void);
255 TransformationInterfaceSensorBase(const TransformationInterfaceSensorBase
&source
);
258 /*---------------------------------------------------------------------*/
259 /*! \name Destructors */
262 virtual ~TransformationInterfaceSensorBase(void);
265 /*---------------------------------------------------------------------*/
266 /*! \name onCreate */
271 /*---------------------------------------------------------------------*/
272 /*! \name Generic Field Access */
275 GetFieldHandlePtr
getHandleTransformation (void) const;
276 EditFieldHandlePtr
editHandleTransformation (void);
277 GetFieldHandlePtr
getHandleTranslation (void) const;
278 EditFieldHandlePtr
editHandleTranslation (void);
279 GetFieldHandlePtr
getHandleRotation (void) const;
280 EditFieldHandlePtr
editHandleRotation (void);
281 GetFieldHandlePtr
getHandleRotationScale (void) const;
282 EditFieldHandlePtr
editHandleRotationScale (void);
283 GetFieldHandlePtr
getHandleTranslationScale (void) const;
284 EditFieldHandlePtr
editHandleTranslationScale(void);
287 /*---------------------------------------------------------------------*/
288 /*! \name Field Get */
292 SFReal32
*editSFTranslationScale(void);
293 const SFReal32
*getSFTranslationScale (void) const;
296 Real32
&editTranslationScale(void);
297 Real32
getTranslationScale (void) const;
300 /*---------------------------------------------------------------------*/
301 /*! \name Field Set */
304 void setTranslationScale(const Real32 value
);
307 /*---------------------------------------------------------------------*/
308 /*! \name Ptr MField Set */
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 ( TransformationInterfaceSensorBase
*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 TransformationInterfaceSensorBase
&source
);
366 typedef TransformationInterfaceSensorBase
*TransformationInterfaceSensorBaseP
;
370 #endif /* _OSGTRANSFORMATIONINTERFACESENSORBASE_H_ */