changed: gcc8 base update
[opensg.git] / Source / System / Dynamics / Skeleton / OSGSkeletonBase.h
blob4d02cdb753f1af9722cdce84ece31f1d0ab97cc0
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 Skeleton
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSKELETONBASE_H_
55 #define _OSGSKELETONBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGDynamicsDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachmentContainer.h" // Parent
68 #include "OSGNodeFields.h" // Roots type
69 #include "OSGBaseSkeletonJointFields.h" // Joints type
70 #include "OSGMathFields.h" // JointMatrices type
71 #include "OSGSysFields.h" // UseInvBindMatrix type
72 #include "OSGOSGAnyFields.h" // JointsChanged type
74 #include "OSGSkeletonFields.h"
76 #include "OSGSkeletonParent.h"
78 OSG_BEGIN_NAMESPACE
81 class Skeleton;
83 //! \brief Skeleton Base Class.
85 class OSG_DYNAMICS_DLLMAPPING SkeletonBase : public SkeletonParent
87 public:
89 typedef SkeletonParent Inherited;
90 typedef AttachmentContainer ParentContainer;
92 typedef Inherited::TypeObject TypeObject;
93 typedef TypeObject::InitPhase InitPhase;
95 OSG_GEN_INTERNALPTR(Skeleton);
97 /*========================== PUBLIC =================================*/
99 public:
101 enum
103 RootsFieldId = Inherited::NextFieldId,
104 JointsFieldId = RootsFieldId + 1,
105 ParentJointsFieldId = JointsFieldId + 1,
106 JointMatricesFieldId = ParentJointsFieldId + 1,
107 JointNormalMatricesFieldId = JointMatricesFieldId + 1,
108 UseInvBindMatrixFieldId = JointNormalMatricesFieldId + 1,
109 CalcNormalMatricesFieldId = UseInvBindMatrixFieldId + 1,
110 JointsChangedFieldId = CalcNormalMatricesFieldId + 1,
111 NextFieldId = JointsChangedFieldId + 1
114 static const OSG::BitVector RootsFieldMask =
115 (TypeTraits<BitVector>::One << RootsFieldId);
116 static const OSG::BitVector JointsFieldMask =
117 (TypeTraits<BitVector>::One << JointsFieldId);
118 static const OSG::BitVector ParentJointsFieldMask =
119 (TypeTraits<BitVector>::One << ParentJointsFieldId);
120 static const OSG::BitVector JointMatricesFieldMask =
121 (TypeTraits<BitVector>::One << JointMatricesFieldId);
122 static const OSG::BitVector JointNormalMatricesFieldMask =
123 (TypeTraits<BitVector>::One << JointNormalMatricesFieldId);
124 static const OSG::BitVector UseInvBindMatrixFieldMask =
125 (TypeTraits<BitVector>::One << UseInvBindMatrixFieldId);
126 static const OSG::BitVector CalcNormalMatricesFieldMask =
127 (TypeTraits<BitVector>::One << CalcNormalMatricesFieldId);
128 static const OSG::BitVector JointsChangedFieldMask =
129 (TypeTraits<BitVector>::One << JointsChangedFieldId);
130 static const OSG::BitVector NextFieldMask =
131 (TypeTraits<BitVector>::One << NextFieldId);
133 typedef MFUnrecNodePtr MFRootsType;
134 typedef MFUnrecChildBaseSkeletonJointPtr MFJointsType;
135 typedef MFUnrecBaseSkeletonJointPtr MFParentJointsType;
136 typedef MFMatrix MFJointMatricesType;
137 typedef MFMatrix MFJointNormalMatricesType;
138 typedef SFBool SFUseInvBindMatrixType;
139 typedef SFBool SFCalcNormalMatricesType;
140 typedef SFOSGAny SFJointsChangedType;
142 /*---------------------------------------------------------------------*/
143 /*! \name Class Get */
144 /*! \{ */
146 static FieldContainerType &getClassType (void);
147 static UInt32 getClassTypeId (void);
148 static UInt16 getClassGroupId(void);
150 /*! \} */
151 /*---------------------------------------------------------------------*/
152 /*! \name FieldContainer Get */
153 /*! \{ */
155 virtual FieldContainerType &getType (void);
156 virtual const FieldContainerType &getType (void) const;
158 virtual UInt32 getContainerSize(void) const;
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Field Get */
163 /*! \{ */
165 const MFUnrecNodePtr *getMFRoots (void) const;
166 MFUnrecNodePtr *editMFRoots (void);
167 const MFUnrecChildBaseSkeletonJointPtr *getMFJoints (void) const;
168 MFUnrecChildBaseSkeletonJointPtr *editMFJoints (void);
169 const MFUnrecBaseSkeletonJointPtr *getMFParentJoints (void) const;
170 MFUnrecBaseSkeletonJointPtr *editMFParentJoints (void);
172 MFMatrix *editMFJointMatrices (void);
173 const MFMatrix *getMFJointMatrices (void) const;
175 MFMatrix *editMFJointNormalMatrices(void);
176 const MFMatrix *getMFJointNormalMatrices (void) const;
178 SFBool *editSFUseInvBindMatrix(void);
179 const SFBool *getSFUseInvBindMatrix (void) const;
181 SFBool *editSFCalcNormalMatrices(void);
182 const SFBool *getSFCalcNormalMatrices (void) const;
184 SFOSGAny *editSFJointsChanged (void);
185 const SFOSGAny *getSFJointsChanged (void) const;
188 Node * getRoots (const UInt32 index) const;
190 BaseSkeletonJoint * getJoints (const UInt32 index) const;
192 BaseSkeletonJoint * getParentJoints (const UInt32 index) const;
194 MFMatrix ::reference editJointMatrices (const UInt32 index);
195 const Matrix &getJointMatrices (const UInt32 index) const;
197 MFMatrix ::reference editJointNormalMatrices(const UInt32 index);
198 const Matrix &getJointNormalMatrices (const UInt32 index) const;
200 bool &editUseInvBindMatrix(void);
201 bool getUseInvBindMatrix (void) const;
203 bool &editCalcNormalMatrices(void);
204 bool getCalcNormalMatrices (void) const;
206 OSGAny &editJointsChanged (void);
207 const OSGAny &getJointsChanged (void) const;
209 /*! \} */
210 /*---------------------------------------------------------------------*/
211 /*! \name Field Set */
212 /*! \{ */
214 void setUseInvBindMatrix(const bool value);
215 void setCalcNormalMatrices(const bool value);
216 void setJointsChanged (const OSGAny &value);
218 /*! \} */
219 /*---------------------------------------------------------------------*/
220 /*! \name Ptr Field Set */
221 /*! \{ */
223 /*! \} */
224 /*---------------------------------------------------------------------*/
225 /*! \name Ptr MField Set */
226 /*! \{ */
228 void pushToRoots (Node * const value );
229 void assignRoots (const MFUnrecNodePtr &value);
230 void removeFromRoots (UInt32 uiIndex );
231 void removeObjFromRoots(Node * const value );
232 void clearRoots (void );
234 void pushToJoints (BaseSkeletonJoint * const value );
235 void assignJoints (const MFUnrecChildBaseSkeletonJointPtr &value);
236 void removeFromJoints (UInt32 uiIndex );
237 void removeObjFromJoints(BaseSkeletonJoint * const value );
238 void clearJoints (void );
240 void pushToParentJoints (BaseSkeletonJoint * const value );
241 void assignParentJoints (const MFUnrecBaseSkeletonJointPtr &value);
242 void removeFromParentJoints (UInt32 uiIndex );
243 void removeObjFromParentJoints(BaseSkeletonJoint * const value );
244 void clearParentJoints (void );
246 /*! \} */
247 /*---------------------------------------------------------------------*/
248 /*! \name Binary Access */
249 /*! \{ */
251 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
252 virtual void copyToBin (BinaryDataHandler &pMem,
253 ConstFieldMaskArg whichField);
254 virtual void copyFromBin(BinaryDataHandler &pMem,
255 ConstFieldMaskArg whichField);
258 /*! \} */
259 /*---------------------------------------------------------------------*/
260 /*! \name Construction */
261 /*! \{ */
263 static SkeletonTransitPtr create (void);
264 static Skeleton *createEmpty (void);
266 static SkeletonTransitPtr createLocal (
267 BitVector bFlags = FCLocal::All);
269 static Skeleton *createEmptyLocal(
270 BitVector bFlags = FCLocal::All);
272 static SkeletonTransitPtr createDependent (BitVector bFlags);
274 /*! \} */
275 /*---------------------------------------------------------------------*/
276 /*! \name Copy */
277 /*! \{ */
279 virtual FieldContainerTransitPtr shallowCopy (void) const;
280 virtual FieldContainerTransitPtr shallowCopyLocal(
281 BitVector bFlags = FCLocal::All) const;
282 virtual FieldContainerTransitPtr shallowCopyDependent(
283 BitVector bFlags) const;
285 /*! \} */
286 /*========================= PROTECTED ===============================*/
288 protected:
290 static TypeObject _type;
292 static void classDescInserter(TypeObject &oType);
293 static const Char8 *getClassname (void );
295 /*---------------------------------------------------------------------*/
296 /*! \name Fields */
297 /*! \{ */
299 MFUnrecNodePtr _mfRoots;
300 MFUnrecChildBaseSkeletonJointPtr _mfJoints;
301 MFUnrecBaseSkeletonJointPtr _mfParentJoints;
302 MFMatrix _mfJointMatrices;
303 MFMatrix _mfJointNormalMatrices;
304 SFBool _sfUseInvBindMatrix;
305 SFBool _sfCalcNormalMatrices;
306 SFOSGAny _sfJointsChanged;
308 /*! \} */
309 /*---------------------------------------------------------------------*/
310 /*! \name Constructors */
311 /*! \{ */
313 SkeletonBase(void);
314 SkeletonBase(const SkeletonBase &source);
316 /*! \} */
317 /*---------------------------------------------------------------------*/
318 /*! \name Destructors */
319 /*! \{ */
321 virtual ~SkeletonBase(void);
323 /*! \} */
324 /*---------------------------------------------------------------------*/
325 /*! \name onCreate */
326 /*! \{ */
328 void onCreate(const Skeleton *source = NULL);
330 /*! \} */
331 /*---------------------------------------------------------------------*/
332 /*! \name Child linking */
333 /*! \{ */
335 virtual bool unlinkChild(FieldContainer * const pChild,
336 UInt16 const childFieldId);
338 /*! \} */
339 /*---------------------------------------------------------------------*/
340 /*! \name Generic Field Access */
341 /*! \{ */
343 GetFieldHandlePtr getHandleRoots (void) const;
344 EditFieldHandlePtr editHandleRoots (void);
345 GetFieldHandlePtr getHandleJoints (void) const;
346 EditFieldHandlePtr editHandleJoints (void);
347 GetFieldHandlePtr getHandleParentJoints (void) const;
348 EditFieldHandlePtr editHandleParentJoints (void);
349 GetFieldHandlePtr getHandleJointMatrices (void) const;
350 EditFieldHandlePtr editHandleJointMatrices (void);
351 GetFieldHandlePtr getHandleJointNormalMatrices (void) const;
352 EditFieldHandlePtr editHandleJointNormalMatrices(void);
353 GetFieldHandlePtr getHandleUseInvBindMatrix (void) const;
354 EditFieldHandlePtr editHandleUseInvBindMatrix(void);
355 GetFieldHandlePtr getHandleCalcNormalMatrices (void) const;
356 EditFieldHandlePtr editHandleCalcNormalMatrices(void);
357 GetFieldHandlePtr getHandleJointsChanged (void) const;
358 EditFieldHandlePtr editHandleJointsChanged (void);
360 /*! \} */
361 /*---------------------------------------------------------------------*/
362 /*! \name Sync */
363 /*! \{ */
365 #ifdef OSG_MT_CPTR_ASPECT
366 virtual void execSyncV( FieldContainer &oFrom,
367 ConstFieldMaskArg whichField,
368 AspectOffsetStore &oOffsets,
369 ConstFieldMaskArg syncMode ,
370 const UInt32 uiSyncInfo);
372 void execSync ( SkeletonBase *pFrom,
373 ConstFieldMaskArg whichField,
374 AspectOffsetStore &oOffsets,
375 ConstFieldMaskArg syncMode ,
376 const UInt32 uiSyncInfo);
377 #endif
379 /*! \} */
380 /*---------------------------------------------------------------------*/
381 /*! \name Edit */
382 /*! \{ */
384 /*! \} */
385 /*---------------------------------------------------------------------*/
386 /*! \name Aspect Create */
387 /*! \{ */
389 #ifdef OSG_MT_CPTR_ASPECT
390 virtual FieldContainer *createAspectCopy(
391 const FieldContainer *pRefAspect) const;
392 #endif
394 /*! \} */
395 /*---------------------------------------------------------------------*/
396 /*! \name Edit */
397 /*! \{ */
398 /*! \} */
399 /*---------------------------------------------------------------------*/
400 /*! \name Sync */
401 /*! \{ */
403 virtual void resolveLinks(void);
405 /*! \} */
406 /*========================== PRIVATE ================================*/
408 private:
409 /*---------------------------------------------------------------------*/
411 // prohibit default functions (move to 'public' if you need one)
412 void operator =(const SkeletonBase &source);
415 typedef SkeletonBase *SkeletonBaseP;
417 OSG_END_NAMESPACE
419 #endif /* _OSGSKELETONBASE_H_ */