fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComplexSceneManager / Sensor / InterfaceSensors / OSGTransformationInterfaceSensorBase.h
blob10fc2b266b074b96bad4be91b256481c28cc624e
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 TransformationInterfaceSensor
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTRANSFORMATIONINTERFACESENSORBASE_H_
55 #define _OSGTRANSFORMATIONINTERFACESENSORBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
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"
74 OSG_BEGIN_NAMESPACE
77 class TransformationInterfaceSensor;
79 //! \brief TransformationInterfaceSensor Base Class.
81 class OSG_CONTRIBCSM_DLLMAPPING TransformationInterfaceSensorBase : public DeviceInterfaceSensor
83 public:
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 =================================*/
95 public:
97 enum
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 */
128 /*! \{ */
130 static FieldContainerType &getClassType (void);
131 static UInt32 getClassTypeId (void);
132 static UInt16 getClassGroupId(void);
134 /*! \} */
135 /*---------------------------------------------------------------------*/
136 /*! \name FieldContainer Get */
137 /*! \{ */
139 virtual FieldContainerType &getType (void);
140 virtual const FieldContainerType &getType (void) const;
142 virtual UInt32 getContainerSize(void) const;
144 /*! \} */
145 /*---------------------------------------------------------------------*/
146 /*! \name Field Get */
147 /*! \{ */
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;
175 /*! \} */
176 /*---------------------------------------------------------------------*/
177 /*! \name Field Set */
178 /*! \{ */
180 void setTransformation (const Matrix &value);
181 void setTranslation (const Vec3f &value);
182 void setRotation (const Quaternion &value);
183 void setRotationScale (const Real32 value);
185 /*! \} */
186 /*---------------------------------------------------------------------*/
187 /*! \name Ptr MField Set */
188 /*! \{ */
190 /*! \} */
191 /*---------------------------------------------------------------------*/
192 /*! \name Binary Access */
193 /*! \{ */
195 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
196 virtual void copyToBin (BinaryDataHandler &pMem,
197 ConstFieldMaskArg whichField);
198 virtual void copyFromBin(BinaryDataHandler &pMem,
199 ConstFieldMaskArg whichField);
202 /*! \} */
203 /*---------------------------------------------------------------------*/
204 /*! \name Construction */
205 /*! \{ */
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);
218 /*! \} */
219 /*---------------------------------------------------------------------*/
220 /*! \name Copy */
221 /*! \{ */
223 virtual FieldContainerTransitPtr shallowCopy (void) const;
224 virtual FieldContainerTransitPtr shallowCopyLocal(
225 BitVector bFlags = FCLocal::All) const;
226 virtual FieldContainerTransitPtr shallowCopyDependent(
227 BitVector bFlags) const;
229 /*! \} */
230 /*========================= PROTECTED ===============================*/
232 protected:
234 static TypeObject _type;
236 static void classDescInserter(TypeObject &oType);
237 static const Char8 *getClassname (void );
239 /*---------------------------------------------------------------------*/
240 /*! \name Fields */
241 /*! \{ */
243 SFMatrix _sfTransformation;
244 SFVec3f _sfTranslation;
245 SFQuaternion _sfRotation;
246 SFReal32 _sfRotationScale;
247 SFReal32 _sfTranslationScale;
249 /*! \} */
250 /*---------------------------------------------------------------------*/
251 /*! \name Constructors */
252 /*! \{ */
254 TransformationInterfaceSensorBase(void);
255 TransformationInterfaceSensorBase(const TransformationInterfaceSensorBase &source);
257 /*! \} */
258 /*---------------------------------------------------------------------*/
259 /*! \name Destructors */
260 /*! \{ */
262 virtual ~TransformationInterfaceSensorBase(void);
264 /*! \} */
265 /*---------------------------------------------------------------------*/
266 /*! \name onCreate */
267 /*! \{ */
270 /*! \} */
271 /*---------------------------------------------------------------------*/
272 /*! \name Generic Field Access */
273 /*! \{ */
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);
286 /*! \} */
287 /*---------------------------------------------------------------------*/
288 /*! \name Field Get */
289 /*! \{ */
292 SFReal32 *editSFTranslationScale(void);
293 const SFReal32 *getSFTranslationScale (void) const;
296 Real32 &editTranslationScale(void);
297 Real32 getTranslationScale (void) const;
299 /*! \} */
300 /*---------------------------------------------------------------------*/
301 /*! \name Field Set */
302 /*! \{ */
304 void setTranslationScale(const Real32 value);
306 /*! \} */
307 /*---------------------------------------------------------------------*/
308 /*! \name Ptr MField Set */
309 /*! \{ */
311 /*! \} */
312 /*---------------------------------------------------------------------*/
313 /*! \name Sync */
314 /*! \{ */
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);
328 #endif
330 /*! \} */
331 /*---------------------------------------------------------------------*/
332 /*! \name Edit */
333 /*! \{ */
335 /*! \} */
336 /*---------------------------------------------------------------------*/
337 /*! \name Aspect Create */
338 /*! \{ */
340 #ifdef OSG_MT_CPTR_ASPECT
341 virtual FieldContainer *createAspectCopy(
342 const FieldContainer *pRefAspect) const;
343 #endif
345 /*! \} */
346 /*---------------------------------------------------------------------*/
347 /*! \name Edit */
348 /*! \{ */
349 /*! \} */
350 /*---------------------------------------------------------------------*/
351 /*! \name Sync */
352 /*! \{ */
354 virtual void resolveLinks(void);
356 /*! \} */
357 /*========================== PRIVATE ================================*/
359 private:
360 /*---------------------------------------------------------------------*/
362 // prohibit default functions (move to 'public' if you need one)
363 void operator =(const TransformationInterfaceSensorBase &source);
366 typedef TransformationInterfaceSensorBase *TransformationInterfaceSensorBaseP;
368 OSG_END_NAMESPACE
370 #endif /* _OSGTRANSFORMATIONINTERFACESENSORBASE_H_ */