fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Dynamics / Skeleton / OSGCPUSkinningAlgorithmBase.cpp
blobef70fcd325d3b32509fa5fa3defc3e7366ae3071
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 CPUSkinningAlgorithm!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
66 #include "OSGCPUSkinningAlgorithmBase.h"
67 #include "OSGCPUSkinningAlgorithm.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::CPUSkinningAlgorithm
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits<CPUSkinningAlgorithm *, nsOSG>::_type(
92 "CPUSkinningAlgorithmPtr",
93 "SkinningAlgorithmPtr",
94 CPUSkinningAlgorithm::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(CPUSkinningAlgorithm *, nsOSG)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
101 CPUSkinningAlgorithm *,
102 nsOSG)
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
105 CPUSkinningAlgorithm *,
106 nsOSG)
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void CPUSkinningAlgorithmBase::classDescInserter(TypeObject &oType)
117 CPUSkinningAlgorithmBase::TypeObject CPUSkinningAlgorithmBase::_type(
118 CPUSkinningAlgorithmBase::getClassname(),
119 Inherited::getClassname(),
120 "NULL",
121 nsOSG, //Namespace
122 reinterpret_cast<PrototypeCreateF>(&CPUSkinningAlgorithmBase::createEmptyLocal),
123 reinterpret_cast<InitContainerF>(&CPUSkinningAlgorithm::initMethod),
124 reinterpret_cast<ExitContainerF>(&CPUSkinningAlgorithm::exitMethod),
125 reinterpret_cast<InitalInsertDescFunc>(
126 reinterpret_cast<void *>(&CPUSkinningAlgorithm::classDescInserter)),
127 false,
129 "<?xml version=\"1.0\"?>\n"
130 "\n"
131 "<FieldContainer\n"
132 " name=\"CPUSkinningAlgorithm\"\n"
133 " parent=\"SkinningAlgorithm\"\n"
134 " library=\"Dynamics\"\n"
135 " pointerfieldtypes=\"both\"\n"
136 " structure=\"concrete\"\n"
137 " systemcomponent=\"true\"\n"
138 " parentsystemcomponent=\"true\"\n"
139 " decoratable=\"false\"\n"
140 " childFields=\"none\"\n"
141 " parentFields=\"none\"\n"
142 " >\n"
143 "</FieldContainer>\n",
147 /*------------------------------ get -----------------------------------*/
149 FieldContainerType &CPUSkinningAlgorithmBase::getType(void)
151 return _type;
154 const FieldContainerType &CPUSkinningAlgorithmBase::getType(void) const
156 return _type;
159 UInt32 CPUSkinningAlgorithmBase::getContainerSize(void) const
161 return sizeof(CPUSkinningAlgorithm);
164 /*------------------------- decorator get ------------------------------*/
171 /*------------------------------ access -----------------------------------*/
173 SizeT CPUSkinningAlgorithmBase::getBinSize(ConstFieldMaskArg whichField)
175 SizeT returnValue = Inherited::getBinSize(whichField);
178 return returnValue;
181 void CPUSkinningAlgorithmBase::copyToBin(BinaryDataHandler &pMem,
182 ConstFieldMaskArg whichField)
184 Inherited::copyToBin(pMem, whichField);
188 void CPUSkinningAlgorithmBase::copyFromBin(BinaryDataHandler &pMem,
189 ConstFieldMaskArg whichField)
191 Inherited::copyFromBin(pMem, whichField);
195 //! create a new instance of the class
196 CPUSkinningAlgorithmTransitPtr CPUSkinningAlgorithmBase::createLocal(BitVector bFlags)
198 CPUSkinningAlgorithmTransitPtr fc;
200 if(getClassType().getPrototype() != NULL)
202 FieldContainerTransitPtr tmpPtr =
203 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
205 fc = dynamic_pointer_cast<CPUSkinningAlgorithm>(tmpPtr);
208 return fc;
211 //! create a new instance of the class, copy the container flags
212 CPUSkinningAlgorithmTransitPtr CPUSkinningAlgorithmBase::createDependent(BitVector bFlags)
214 CPUSkinningAlgorithmTransitPtr fc;
216 if(getClassType().getPrototype() != NULL)
218 FieldContainerTransitPtr tmpPtr =
219 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
221 fc = dynamic_pointer_cast<CPUSkinningAlgorithm>(tmpPtr);
224 return fc;
227 //! create a new instance of the class
228 CPUSkinningAlgorithmTransitPtr CPUSkinningAlgorithmBase::create(void)
230 CPUSkinningAlgorithmTransitPtr fc;
232 if(getClassType().getPrototype() != NULL)
234 FieldContainerTransitPtr tmpPtr =
235 getClassType().getPrototype()-> shallowCopy();
237 fc = dynamic_pointer_cast<CPUSkinningAlgorithm>(tmpPtr);
240 return fc;
243 CPUSkinningAlgorithm *CPUSkinningAlgorithmBase::createEmptyLocal(BitVector bFlags)
245 CPUSkinningAlgorithm *returnValue;
247 newPtr<CPUSkinningAlgorithm>(returnValue, bFlags);
249 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
251 return returnValue;
254 //! create an empty new instance of the class, do not copy the prototype
255 CPUSkinningAlgorithm *CPUSkinningAlgorithmBase::createEmpty(void)
257 CPUSkinningAlgorithm *returnValue;
259 newPtr<CPUSkinningAlgorithm>(returnValue, Thread::getCurrentLocalFlags());
261 returnValue->_pFieldFlags->_bNamespaceMask &=
262 ~Thread::getCurrentLocalFlags();
264 return returnValue;
268 FieldContainerTransitPtr CPUSkinningAlgorithmBase::shallowCopyLocal(
269 BitVector bFlags) const
271 CPUSkinningAlgorithm *tmpPtr;
273 newPtr(tmpPtr, dynamic_cast<const CPUSkinningAlgorithm *>(this), bFlags);
275 FieldContainerTransitPtr returnValue(tmpPtr);
277 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
279 return returnValue;
282 FieldContainerTransitPtr CPUSkinningAlgorithmBase::shallowCopyDependent(
283 BitVector bFlags) const
285 CPUSkinningAlgorithm *tmpPtr;
287 newPtr(tmpPtr, dynamic_cast<const CPUSkinningAlgorithm *>(this), ~bFlags);
289 FieldContainerTransitPtr returnValue(tmpPtr);
291 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
293 return returnValue;
296 FieldContainerTransitPtr CPUSkinningAlgorithmBase::shallowCopy(void) const
298 CPUSkinningAlgorithm *tmpPtr;
300 newPtr(tmpPtr,
301 dynamic_cast<const CPUSkinningAlgorithm *>(this),
302 Thread::getCurrentLocalFlags());
304 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
306 FieldContainerTransitPtr returnValue(tmpPtr);
308 return returnValue;
314 /*------------------------- constructors ----------------------------------*/
316 CPUSkinningAlgorithmBase::CPUSkinningAlgorithmBase(void) :
317 Inherited()
321 CPUSkinningAlgorithmBase::CPUSkinningAlgorithmBase(const CPUSkinningAlgorithmBase &source) :
322 Inherited(source)
327 /*-------------------------- destructors ----------------------------------*/
329 CPUSkinningAlgorithmBase::~CPUSkinningAlgorithmBase(void)
335 #ifdef OSG_MT_CPTR_ASPECT
336 void CPUSkinningAlgorithmBase::execSyncV( FieldContainer &oFrom,
337 ConstFieldMaskArg whichField,
338 AspectOffsetStore &oOffsets,
339 ConstFieldMaskArg syncMode,
340 const UInt32 uiSyncInfo)
342 CPUSkinningAlgorithm *pThis = static_cast<CPUSkinningAlgorithm *>(this);
344 pThis->execSync(static_cast<CPUSkinningAlgorithm *>(&oFrom),
345 whichField,
346 oOffsets,
347 syncMode,
348 uiSyncInfo);
350 #endif
353 #ifdef OSG_MT_CPTR_ASPECT
354 FieldContainer *CPUSkinningAlgorithmBase::createAspectCopy(
355 const FieldContainer *pRefAspect) const
357 CPUSkinningAlgorithm *returnValue;
359 newAspectCopy(returnValue,
360 dynamic_cast<const CPUSkinningAlgorithm *>(pRefAspect),
361 dynamic_cast<const CPUSkinningAlgorithm *>(this));
363 return returnValue;
365 #endif
367 void CPUSkinningAlgorithmBase::resolveLinks(void)
369 Inherited::resolveLinks();
375 OSG_END_NAMESPACE