changed: fixed python bindings
[opensg.git] / Source / System / NodeCores / Groups / Base / OSGGroupBase.cpp
blobce9940dd4b9cd4cd8793b1c12f70875a83eb19dd
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 Group!
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 "OSGGroupBase.h"
67 #include "OSGGroup.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::Group
78 Group is the simplest form of a NodeCore. A group
79 carries no predefined data and most actions will only traverse the
80 children list. So usually the group does nothing.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
88 /***************************************************************************\
89 * FieldType/FieldTrait Instantiation *
90 \***************************************************************************/
92 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
93 PointerType FieldTraits<Group *, nsOSG>::_type(
94 "GroupPtr",
95 "NodeCorePtr",
96 Group::getClassType(),
97 nsOSG);
98 #endif
100 OSG_FIELDTRAITS_GETTYPE_NS(Group *, nsOSG)
102 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
103 Group *,
104 nsOSG)
106 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
107 Group *,
108 nsOSG)
110 /***************************************************************************\
111 * Field Description *
112 \***************************************************************************/
114 void GroupBase::classDescInserter(TypeObject &oType)
119 GroupBase::TypeObject GroupBase::_type(
120 GroupBase::getClassname(),
121 Inherited::getClassname(),
122 "NULL",
123 nsOSG, //Namespace
124 reinterpret_cast<PrototypeCreateF>(&GroupBase::createEmptyLocal),
125 reinterpret_cast<InitContainerF>(&Group::initMethod),
126 reinterpret_cast<ExitContainerF>(&Group::exitMethod),
127 reinterpret_cast<InitalInsertDescFunc>(&Group::classDescInserter),
128 false,
130 "<?xml version=\"1.0\" ?>\n"
131 "\n"
132 "<FieldContainer\n"
133 " name=\"Group\"\n"
134 " parent=\"NodeCore\"\n"
135 " library=\"System\"\n"
136 " structure=\"concrete\"\n"
137 " pointerfieldtypes=\"both\"\n"
138 " systemcomponent=\"true\"\n"
139 " parentsystemcomponent=\"true\"\n"
140 " isNodeCore=\"true\"\n"
141 " docGroupBase=\"GrpSystemNodeCoreGroups\"\n"
142 " >\n"
143 "\n"
144 " Group is the simplest form of a NodeCore. A group\n"
145 " carries no predefined data and most actions will only traverse the\n"
146 " children list. So usually the group does nothing.\n"
147 "</FieldContainer>\n",
148 "Group is the simplest form of a NodeCore. A group\n"
149 "carries no predefined data and most actions will only traverse the\n"
150 "children list. So usually the group does nothing.\n"
153 /*------------------------------ get -----------------------------------*/
155 FieldContainerType &GroupBase::getType(void)
157 return _type;
160 const FieldContainerType &GroupBase::getType(void) const
162 return _type;
165 UInt32 GroupBase::getContainerSize(void) const
167 return sizeof(Group);
170 /*------------------------- decorator get ------------------------------*/
177 /*------------------------------ access -----------------------------------*/
179 SizeT GroupBase::getBinSize(ConstFieldMaskArg whichField)
181 SizeT returnValue = Inherited::getBinSize(whichField);
184 return returnValue;
187 void GroupBase::copyToBin(BinaryDataHandler &pMem,
188 ConstFieldMaskArg whichField)
190 Inherited::copyToBin(pMem, whichField);
194 void GroupBase::copyFromBin(BinaryDataHandler &pMem,
195 ConstFieldMaskArg whichField)
197 Inherited::copyFromBin(pMem, whichField);
201 //! create a new instance of the class
202 GroupTransitPtr GroupBase::createLocal(BitVector bFlags)
204 GroupTransitPtr fc;
206 if(getClassType().getPrototype() != NULL)
208 FieldContainerTransitPtr tmpPtr =
209 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
211 fc = dynamic_pointer_cast<Group>(tmpPtr);
214 return fc;
217 //! create a new instance of the class, copy the container flags
218 GroupTransitPtr GroupBase::createDependent(BitVector bFlags)
220 GroupTransitPtr fc;
222 if(getClassType().getPrototype() != NULL)
224 FieldContainerTransitPtr tmpPtr =
225 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
227 fc = dynamic_pointer_cast<Group>(tmpPtr);
230 return fc;
233 //! create a new instance of the class
234 GroupTransitPtr GroupBase::create(void)
236 GroupTransitPtr fc;
238 if(getClassType().getPrototype() != NULL)
240 FieldContainerTransitPtr tmpPtr =
241 getClassType().getPrototype()-> shallowCopy();
243 fc = dynamic_pointer_cast<Group>(tmpPtr);
246 return fc;
249 Group *GroupBase::createEmptyLocal(BitVector bFlags)
251 Group *returnValue;
253 newPtr<Group>(returnValue, bFlags);
255 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
257 return returnValue;
260 //! create an empty new instance of the class, do not copy the prototype
261 Group *GroupBase::createEmpty(void)
263 Group *returnValue;
265 newPtr<Group>(returnValue, Thread::getCurrentLocalFlags());
267 returnValue->_pFieldFlags->_bNamespaceMask &=
268 ~Thread::getCurrentLocalFlags();
270 return returnValue;
274 FieldContainerTransitPtr GroupBase::shallowCopyLocal(
275 BitVector bFlags) const
277 Group *tmpPtr;
279 newPtr(tmpPtr, dynamic_cast<const Group *>(this), bFlags);
281 FieldContainerTransitPtr returnValue(tmpPtr);
283 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
285 return returnValue;
288 FieldContainerTransitPtr GroupBase::shallowCopyDependent(
289 BitVector bFlags) const
291 Group *tmpPtr;
293 newPtr(tmpPtr, dynamic_cast<const Group *>(this), ~bFlags);
295 FieldContainerTransitPtr returnValue(tmpPtr);
297 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
299 return returnValue;
302 FieldContainerTransitPtr GroupBase::shallowCopy(void) const
304 Group *tmpPtr;
306 newPtr(tmpPtr,
307 dynamic_cast<const Group *>(this),
308 Thread::getCurrentLocalFlags());
310 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
312 FieldContainerTransitPtr returnValue(tmpPtr);
314 return returnValue;
320 /*------------------------- constructors ----------------------------------*/
322 GroupBase::GroupBase(void) :
323 Inherited()
327 GroupBase::GroupBase(const GroupBase &source) :
328 Inherited(source)
333 /*-------------------------- destructors ----------------------------------*/
335 GroupBase::~GroupBase(void)
341 #ifdef OSG_MT_CPTR_ASPECT
342 void GroupBase::execSyncV( FieldContainer &oFrom,
343 ConstFieldMaskArg whichField,
344 AspectOffsetStore &oOffsets,
345 ConstFieldMaskArg syncMode,
346 const UInt32 uiSyncInfo)
348 Group *pThis = static_cast<Group *>(this);
350 pThis->execSync(static_cast<Group *>(&oFrom),
351 whichField,
352 oOffsets,
353 syncMode,
354 uiSyncInfo);
356 #endif
359 #ifdef OSG_MT_CPTR_ASPECT
360 FieldContainer *GroupBase::createAspectCopy(
361 const FieldContainer *pRefAspect) const
363 Group *returnValue;
365 newAspectCopy(returnValue,
366 dynamic_cast<const Group *>(pRefAspect),
367 dynamic_cast<const Group *>(this));
369 return returnValue;
371 #endif
373 void GroupBase::resolveLinks(void)
375 Inherited::resolveLinks();
381 OSG_END_NAMESPACE