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 CPUSkinningDataAttachment
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGCPUSKINNINGDATAATTACHMENTBASE_H_
55 #define _OSGCPUSKINNINGDATAATTACHMENTBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGDynamicsDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachment.h" // Parent
68 #include "OSGGeoVectorPropertyFields.h" // Properties type
69 #include "OSGMathFields.h" // JointMatrices type
70 #include "OSGSysFields.h" // DataValid type
72 #include "OSGCPUSkinningDataAttachmentFields.h"
77 class CPUSkinningDataAttachment
;
79 //! \brief CPUSkinningDataAttachment Base Class.
81 class OSG_DYNAMICS_DLLMAPPING CPUSkinningDataAttachmentBase
: public Attachment
85 typedef Attachment Inherited
;
86 typedef Attachment ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(CPUSkinningDataAttachment
);
93 /*========================== PUBLIC =================================*/
99 PropertiesFieldId
= Inherited::NextFieldId
,
100 JointMatricesFieldId
= PropertiesFieldId
+ 1,
101 JointNormalMatricesFieldId
= JointMatricesFieldId
+ 1,
102 DataValidFieldId
= JointNormalMatricesFieldId
+ 1,
103 NextFieldId
= DataValidFieldId
+ 1
106 static const OSG::BitVector PropertiesFieldMask
=
107 (TypeTraits
<BitVector
>::One
<< PropertiesFieldId
);
108 static const OSG::BitVector JointMatricesFieldMask
=
109 (TypeTraits
<BitVector
>::One
<< JointMatricesFieldId
);
110 static const OSG::BitVector JointNormalMatricesFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< JointNormalMatricesFieldId
);
112 static const OSG::BitVector DataValidFieldMask
=
113 (TypeTraits
<BitVector
>::One
<< DataValidFieldId
);
114 static const OSG::BitVector NextFieldMask
=
115 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
117 typedef MFUnrecChildGeoVectorPropertyPtr MFPropertiesType
;
118 typedef MFMatrix MFJointMatricesType
;
119 typedef MFMatrix MFJointNormalMatricesType
;
120 typedef SFBool SFDataValidType
;
122 /*---------------------------------------------------------------------*/
123 /*! \name Class Get */
126 static FieldContainerType
&getClassType (void);
127 static UInt32
getClassTypeId (void);
128 static UInt16
getClassGroupId(void);
131 /*---------------------------------------------------------------------*/
132 /*! \name FieldContainer Get */
135 virtual FieldContainerType
&getType (void);
136 virtual const FieldContainerType
&getType (void) const;
138 virtual UInt32
getContainerSize(void) const;
141 /*---------------------------------------------------------------------*/
142 /*! \name Field Get */
145 const MFUnrecChildGeoVectorPropertyPtr
*getMFProperties (void) const;
146 MFUnrecChildGeoVectorPropertyPtr
*editMFProperties (void);
148 MFMatrix
*editMFJointMatrices (void);
149 const MFMatrix
*getMFJointMatrices (void) const;
151 MFMatrix
*editMFJointNormalMatrices(void);
152 const MFMatrix
*getMFJointNormalMatrices (void) const;
154 SFBool
*editSFDataValid (void);
155 const SFBool
*getSFDataValid (void) const;
158 GeoVectorProperty
* getProperties (const UInt32 index
) const;
160 MFMatrix ::reference
editJointMatrices (const UInt32 index
);
161 const Matrix
&getJointMatrices (const UInt32 index
) const;
163 MFMatrix ::reference
editJointNormalMatrices(const UInt32 index
);
164 const Matrix
&getJointNormalMatrices (const UInt32 index
) const;
166 bool &editDataValid (void);
167 bool getDataValid (void) const;
170 /*---------------------------------------------------------------------*/
171 /*! \name Field Set */
174 void setDataValid (const bool value
);
177 /*---------------------------------------------------------------------*/
178 /*! \name Ptr Field Set */
182 /*---------------------------------------------------------------------*/
183 /*! \name Ptr MField Set */
186 void pushToProperties (GeoVectorProperty
* const value
);
187 void assignProperties (const MFUnrecChildGeoVectorPropertyPtr
&value
);
188 void removeFromProperties (UInt32 uiIndex
);
189 void removeObjFromProperties(GeoVectorProperty
* const value
);
190 void clearProperties (void );
193 /*---------------------------------------------------------------------*/
194 /*! \name Binary Access */
197 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
198 virtual void copyToBin (BinaryDataHandler
&pMem
,
199 ConstFieldMaskArg whichField
);
200 virtual void copyFromBin(BinaryDataHandler
&pMem
,
201 ConstFieldMaskArg whichField
);
205 /*---------------------------------------------------------------------*/
206 /*! \name Construction */
209 static CPUSkinningDataAttachmentTransitPtr
create (void);
210 static CPUSkinningDataAttachment
*createEmpty (void);
212 static CPUSkinningDataAttachmentTransitPtr
createLocal (
213 BitVector bFlags
= FCLocal::All
);
215 static CPUSkinningDataAttachment
*createEmptyLocal(
216 BitVector bFlags
= FCLocal::All
);
218 static CPUSkinningDataAttachmentTransitPtr
createDependent (BitVector bFlags
);
221 /*---------------------------------------------------------------------*/
225 virtual FieldContainerTransitPtr
shallowCopy (void) const;
226 virtual FieldContainerTransitPtr
shallowCopyLocal(
227 BitVector bFlags
= FCLocal::All
) const;
228 virtual FieldContainerTransitPtr
shallowCopyDependent(
229 BitVector bFlags
) const;
232 /*========================= PROTECTED ===============================*/
236 static TypeObject _type
;
238 static void classDescInserter(TypeObject
&oType
);
239 static const Char8
*getClassname (void );
241 /*---------------------------------------------------------------------*/
245 MFUnrecChildGeoVectorPropertyPtr _mfProperties
;
246 MFMatrix _mfJointMatrices
;
247 MFMatrix _mfJointNormalMatrices
;
251 /*---------------------------------------------------------------------*/
252 /*! \name Constructors */
255 CPUSkinningDataAttachmentBase(void);
256 CPUSkinningDataAttachmentBase(const CPUSkinningDataAttachmentBase
&source
);
259 /*---------------------------------------------------------------------*/
260 /*! \name Destructors */
263 virtual ~CPUSkinningDataAttachmentBase(void);
266 /*---------------------------------------------------------------------*/
267 /*! \name onCreate */
270 void onCreate(const CPUSkinningDataAttachment
*source
= NULL
);
273 /*---------------------------------------------------------------------*/
274 /*! \name Child linking */
277 virtual bool unlinkChild(FieldContainer
* const pChild
,
278 UInt16
const childFieldId
);
281 /*---------------------------------------------------------------------*/
282 /*! \name Generic Field Access */
285 GetFieldHandlePtr
getHandleProperties (void) const;
286 EditFieldHandlePtr
editHandleProperties (void);
287 GetFieldHandlePtr
getHandleJointMatrices (void) const;
288 EditFieldHandlePtr
editHandleJointMatrices (void);
289 GetFieldHandlePtr
getHandleJointNormalMatrices (void) const;
290 EditFieldHandlePtr
editHandleJointNormalMatrices(void);
291 GetFieldHandlePtr
getHandleDataValid (void) const;
292 EditFieldHandlePtr
editHandleDataValid (void);
295 /*---------------------------------------------------------------------*/
299 #ifdef OSG_MT_CPTR_ASPECT
300 virtual void execSyncV( FieldContainer
&oFrom
,
301 ConstFieldMaskArg whichField
,
302 AspectOffsetStore
&oOffsets
,
303 ConstFieldMaskArg syncMode
,
304 const UInt32 uiSyncInfo
);
306 void execSync ( CPUSkinningDataAttachmentBase
*pFrom
,
307 ConstFieldMaskArg whichField
,
308 AspectOffsetStore
&oOffsets
,
309 ConstFieldMaskArg syncMode
,
310 const UInt32 uiSyncInfo
);
314 /*---------------------------------------------------------------------*/
319 /*---------------------------------------------------------------------*/
320 /*! \name Aspect Create */
323 #ifdef OSG_MT_CPTR_ASPECT
324 virtual FieldContainer
*createAspectCopy(
325 const FieldContainer
*pRefAspect
) const;
329 /*---------------------------------------------------------------------*/
333 /*---------------------------------------------------------------------*/
337 virtual void resolveLinks(void);
340 /*========================== PRIVATE ================================*/
343 /*---------------------------------------------------------------------*/
345 // prohibit default functions (move to 'public' if you need one)
346 void operator =(const CPUSkinningDataAttachmentBase
&source
);
349 typedef CPUSkinningDataAttachmentBase
*CPUSkinningDataAttachmentBaseP
;
353 #endif /* _OSGCPUSKINNINGDATAATTACHMENTBASE_H_ */