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 CSMClusterWinOptions!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
65 #include "OSGCSMClusterWindow.h" // Parent Class
67 #include "OSGCSMClusterWinOptionsBase.h"
68 #include "OSGCSMClusterWinOptions.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::CSMClusterWinOptions
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var CSMClusterWindow * CSMClusterWinOptionsBase::_sfParent
91 /***************************************************************************\
92 * FieldType/FieldTrait Instantiation *
93 \***************************************************************************/
95 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
96 PointerType FieldTraits
<CSMClusterWinOptions
*, nsOSG
>::_type(
97 "CSMClusterWinOptionsPtr",
99 CSMClusterWinOptions::getClassType(),
103 OSG_FIELDTRAITS_GETTYPE_NS(CSMClusterWinOptions
*, nsOSG
)
105 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
106 CSMClusterWinOptions
*,
110 DataType
&FieldTraits
< CSMClusterWinOptions
*, nsOSG
+ 1 >::getType(void)
112 return FieldTraits
<CSMClusterWinOptions
*, nsOSG
>::getType();
116 OSG_EXPORT_PTR_SFIELD(ChildPointerSField
,
117 CSMClusterWinOptions
*,
118 UnrecordedRefCountPolicy
,
122 /***************************************************************************\
123 * Field Description *
124 \***************************************************************************/
126 void CSMClusterWinOptionsBase::classDescInserter(TypeObject
&oType
)
128 FieldDescriptionBase
*pDesc
= NULL
;
131 pDesc
= new SFParentCSMClusterWindowPtr::Description(
132 SFParentCSMClusterWindowPtr::getClassType(),
135 ParentFieldId
, ParentFieldMask
,
137 (Field::SFDefaultFlags
| Field::FStdAccess
),
138 static_cast <FieldEditMethodSig
>(&CSMClusterWinOptions::invalidEditField
),
139 static_cast <FieldGetMethodSig
>(&CSMClusterWinOptions::invalidGetField
));
141 oType
.addInitialDesc(pDesc
);
145 CSMClusterWinOptionsBase::TypeObject
CSMClusterWinOptionsBase::_type(
146 CSMClusterWinOptionsBase::getClassname(),
147 Inherited::getClassname(),
150 reinterpret_cast<PrototypeCreateF
>(&CSMClusterWinOptionsBase::createEmptyLocal
),
151 reinterpret_cast<InitContainerF
>(&CSMClusterWinOptions::initMethod
),
152 reinterpret_cast<ExitContainerF
>(&CSMClusterWinOptions::exitMethod
),
153 reinterpret_cast<InitalInsertDescFunc
>(
154 reinterpret_cast<void *>(&CSMClusterWinOptions::classDescInserter
)),
157 "<?xml version=\"1.0\"?>\n"
160 " name=\"CSMClusterWinOptions\"\n"
161 " parent=\"FieldContainer\"\n"
162 " library=\"ContribCSM\"\n"
163 " pointerfieldtypes=\"single\"\n"
164 " structure=\"concrete\"\n"
165 " systemcomponent=\"true\"\n"
166 " parentsystemcomponent=\"true\"\n"
167 " decoratable=\"false\"\n"
168 " useLocalIncludes=\"false\"\n"
169 " isNodeCore=\"false\"\n"
170 " isBundle=\"true\"\n"
171 " parentFields=\"none\"\n"
172 " childFields=\"single\"\n"
175 "\t\tname=\"parent\"\n"
176 "\t\ttype=\"CSMClusterWindow\"\n"
177 "\t\tcardinality=\"single\"\n"
178 "\t\tvisibility=\"internal\"\n"
179 "\t\taccess=\"none\"\n"
180 " category=\"parentpointer\"\n"
183 "</FieldContainer>\n",
187 /*------------------------------ get -----------------------------------*/
189 FieldContainerType
&CSMClusterWinOptionsBase::getType(void)
194 const FieldContainerType
&CSMClusterWinOptionsBase::getType(void) const
199 UInt32
CSMClusterWinOptionsBase::getContainerSize(void) const
201 return sizeof(CSMClusterWinOptions
);
204 /*------------------------- decorator get ------------------------------*/
212 /*------------------------------ access -----------------------------------*/
214 SizeT
CSMClusterWinOptionsBase::getBinSize(ConstFieldMaskArg whichField
)
216 SizeT returnValue
= Inherited::getBinSize(whichField
);
218 if(FieldBits::NoField
!= (ParentFieldMask
& whichField
))
220 returnValue
+= _sfParent
.getBinSize();
226 void CSMClusterWinOptionsBase::copyToBin(BinaryDataHandler
&pMem
,
227 ConstFieldMaskArg whichField
)
229 Inherited::copyToBin(pMem
, whichField
);
231 if(FieldBits::NoField
!= (ParentFieldMask
& whichField
))
233 _sfParent
.copyToBin(pMem
);
237 void CSMClusterWinOptionsBase::copyFromBin(BinaryDataHandler
&pMem
,
238 ConstFieldMaskArg whichField
)
240 Inherited::copyFromBin(pMem
, whichField
);
242 if(FieldBits::NoField
!= (ParentFieldMask
& whichField
))
244 editSField(ParentFieldMask
);
245 _sfParent
.copyFromBin(pMem
);
249 //! create a new instance of the class
250 CSMClusterWinOptionsTransitPtr
CSMClusterWinOptionsBase::createLocal(BitVector bFlags
)
252 CSMClusterWinOptionsTransitPtr fc
;
254 if(getClassType().getPrototype() != NULL
)
256 FieldContainerTransitPtr tmpPtr
=
257 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
259 fc
= dynamic_pointer_cast
<CSMClusterWinOptions
>(tmpPtr
);
265 //! create a new instance of the class, copy the container flags
266 CSMClusterWinOptionsTransitPtr
CSMClusterWinOptionsBase::createDependent(BitVector bFlags
)
268 CSMClusterWinOptionsTransitPtr fc
;
270 if(getClassType().getPrototype() != NULL
)
272 FieldContainerTransitPtr tmpPtr
=
273 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
275 fc
= dynamic_pointer_cast
<CSMClusterWinOptions
>(tmpPtr
);
281 //! create a new instance of the class
282 CSMClusterWinOptionsTransitPtr
CSMClusterWinOptionsBase::create(void)
284 return createLocal();
287 CSMClusterWinOptions
*CSMClusterWinOptionsBase::createEmptyLocal(BitVector bFlags
)
289 CSMClusterWinOptions
*returnValue
;
291 newPtr
<CSMClusterWinOptions
>(returnValue
, bFlags
);
293 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
298 //! create an empty new instance of the class, do not copy the prototype
299 CSMClusterWinOptions
*CSMClusterWinOptionsBase::createEmpty(void)
301 return createEmptyLocal();
305 FieldContainerTransitPtr
CSMClusterWinOptionsBase::shallowCopyLocal(
306 BitVector bFlags
) const
308 CSMClusterWinOptions
*tmpPtr
;
310 newPtr(tmpPtr
, dynamic_cast<const CSMClusterWinOptions
*>(this), bFlags
);
312 FieldContainerTransitPtr
returnValue(tmpPtr
);
314 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
319 FieldContainerTransitPtr
CSMClusterWinOptionsBase::shallowCopyDependent(
320 BitVector bFlags
) const
322 CSMClusterWinOptions
*tmpPtr
;
324 newPtr(tmpPtr
, dynamic_cast<const CSMClusterWinOptions
*>(this), ~bFlags
);
326 FieldContainerTransitPtr
returnValue(tmpPtr
);
328 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
333 FieldContainerTransitPtr
CSMClusterWinOptionsBase::shallowCopy(void) const
335 return shallowCopyLocal();
341 /*------------------------- constructors ----------------------------------*/
343 CSMClusterWinOptionsBase::CSMClusterWinOptionsBase(void) :
349 CSMClusterWinOptionsBase::CSMClusterWinOptionsBase(const CSMClusterWinOptionsBase
&source
) :
356 /*-------------------------- destructors ----------------------------------*/
358 CSMClusterWinOptionsBase::~CSMClusterWinOptionsBase(void)
361 /*-------------------------------------------------------------------------*/
364 bool CSMClusterWinOptionsBase::linkParent(
365 FieldContainer
* const pParent
,
366 UInt16
const childFieldId
,
367 UInt16
const parentFieldId
)
369 if(parentFieldId
== ParentFieldId
)
371 CSMClusterWindow
* pTypedParent
=
372 dynamic_cast< CSMClusterWindow
* >(pParent
);
374 if(pTypedParent
!= NULL
)
376 FieldContainer
*pOldParent
=
377 _sfParent
.getValue ();
379 UInt16 oldChildFieldId
=
380 _sfParent
.getParentFieldPos();
382 if(pOldParent
!= NULL
)
384 pOldParent
->unlinkChild(this, oldChildFieldId
);
387 editSField(ParentFieldMask
);
389 _sfParent
.setValue(static_cast<CSMClusterWindow
*>(pParent
), childFieldId
);
397 return Inherited::linkParent(pParent
, childFieldId
, parentFieldId
);
400 bool CSMClusterWinOptionsBase::unlinkParent(
401 FieldContainer
* const pParent
,
402 UInt16
const parentFieldId
)
404 if(parentFieldId
== ParentFieldId
)
406 CSMClusterWindow
* pTypedParent
=
407 dynamic_cast< CSMClusterWindow
* >(pParent
);
409 if(pTypedParent
!= NULL
)
411 if(_sfParent
.getValue() == pTypedParent
)
413 editSField(ParentFieldMask
);
415 _sfParent
.setValue(NULL
, 0xFFFF);
420 SWARNING
<< "Child ([" << this
421 << "] id [" << this->getId()
422 << "] type [" << this->getType().getCName()
423 << "] parentFieldId [" << parentFieldId
424 << "]) - Parent ([" << pParent
425 << "] id [" << pParent
->getId()
426 << "] type [" << pParent
->getType().getCName()
427 << "]): link inconsistent!"
436 return Inherited::unlinkParent(pParent
, parentFieldId
);
441 GetFieldHandlePtr
CSMClusterWinOptionsBase::getHandleParent (void) const
443 SFParentCSMClusterWindowPtr::GetHandlePtr returnValue
;
448 EditFieldHandlePtr
CSMClusterWinOptionsBase::editHandleParent (void)
450 EditFieldHandlePtr returnValue
;
456 #ifdef OSG_MT_CPTR_ASPECT
457 void CSMClusterWinOptionsBase::execSyncV( FieldContainer
&oFrom
,
458 ConstFieldMaskArg whichField
,
459 AspectOffsetStore
&oOffsets
,
460 ConstFieldMaskArg syncMode
,
461 const UInt32 uiSyncInfo
)
463 CSMClusterWinOptions
*pThis
= static_cast<CSMClusterWinOptions
*>(this);
465 pThis
->execSync(static_cast<CSMClusterWinOptions
*>(&oFrom
),
474 #ifdef OSG_MT_CPTR_ASPECT
475 FieldContainer
*CSMClusterWinOptionsBase::createAspectCopy(
476 const FieldContainer
*pRefAspect
) const
478 CSMClusterWinOptions
*returnValue
;
480 newAspectCopy(returnValue
,
481 dynamic_cast<const CSMClusterWinOptions
*>(pRefAspect
),
482 dynamic_cast<const CSMClusterWinOptions
*>(this));
488 void CSMClusterWinOptionsBase::resolveLinks(void)
490 Inherited::resolveLinks();