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 CSMQT4Window!
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"
66 #include "OSGCSMQT4WindowBase.h"
67 #include "OSGCSMQT4Window.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CSMQT4Window
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string CSMQT4WindowBase::_sfPrimaryDisplayString
89 /*! \var bool CSMQT4WindowBase::_sfPrivateContext
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<CSMQT4Window
*, nsOSG
>::_type(
102 CSMQT4Window::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(CSMQT4Window
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void CSMQT4WindowBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFString::Description(
126 SFString::getClassType(),
127 "primaryDisplayString",
129 PrimaryDisplayStringFieldId
, PrimaryDisplayStringFieldMask
,
131 (Field::SFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&CSMQT4Window::editHandlePrimaryDisplayString
),
133 static_cast<FieldGetMethodSig
>(&CSMQT4Window::getHandlePrimaryDisplayString
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new SFBool::Description(
138 SFBool::getClassType(),
141 PrivateContextFieldId
, PrivateContextFieldMask
,
143 (Field::SFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&CSMQT4Window::editHandlePrivateContext
),
145 static_cast<FieldGetMethodSig
>(&CSMQT4Window::getHandlePrivateContext
));
147 oType
.addInitialDesc(pDesc
);
151 CSMQT4WindowBase::TypeObject
CSMQT4WindowBase::_type(
152 CSMQT4WindowBase::getClassname(),
153 Inherited::getClassname(),
156 reinterpret_cast<PrototypeCreateF
>(&CSMQT4WindowBase::createEmptyLocal
),
157 reinterpret_cast<InitContainerF
>(&CSMQT4Window::initMethod
),
158 reinterpret_cast<ExitContainerF
>(&CSMQT4Window::exitMethod
),
159 reinterpret_cast<InitalInsertDescFunc
>(&CSMQT4Window::classDescInserter
),
162 "<?xml version=\"1.0\"?>\n"
165 " name=\"CSMQT4Window\"\n"
166 " parent=\"CSMWindow\"\n"
167 " library=\"ContribCSMQt\"\n"
168 " pointerfieldtypes=\"both\"\n"
169 " structure=\"concrete\"\n"
170 " systemcomponent=\"true\"\n"
171 " parentsystemcomponent=\"true\"\n"
172 " decoratable=\"false\"\n"
173 " useLocalIncludes=\"false\"\n"
174 " isNodeCore=\"false\"\n"
175 " isBundle=\"true\"\n"
178 "\t name=\"primaryDisplayString\"\n"
179 "\t type=\"std::string\"\n"
180 "\t cardinality=\"single\"\n"
181 "\t visibility=\"internal\"\n"
182 "\t access=\"public\"\n"
186 "\t name=\"privateContext\"\n"
188 "\t cardinality=\"single\"\n"
189 "\t visibility=\"internal\"\n"
190 "\t access=\"public\"\n"
191 " defaultValue=\"false\"\n"
194 "</FieldContainer>\n",
198 /*------------------------------ get -----------------------------------*/
200 FieldContainerType
&CSMQT4WindowBase::getType(void)
205 const FieldContainerType
&CSMQT4WindowBase::getType(void) const
210 UInt32
CSMQT4WindowBase::getContainerSize(void) const
212 return sizeof(CSMQT4Window
);
215 /*------------------------- decorator get ------------------------------*/
218 SFString
*CSMQT4WindowBase::editSFPrimaryDisplayString(void)
220 editSField(PrimaryDisplayStringFieldMask
);
222 return &_sfPrimaryDisplayString
;
225 const SFString
*CSMQT4WindowBase::getSFPrimaryDisplayString(void) const
227 return &_sfPrimaryDisplayString
;
231 SFBool
*CSMQT4WindowBase::editSFPrivateContext(void)
233 editSField(PrivateContextFieldMask
);
235 return &_sfPrivateContext
;
238 const SFBool
*CSMQT4WindowBase::getSFPrivateContext(void) const
240 return &_sfPrivateContext
;
248 /*------------------------------ access -----------------------------------*/
250 SizeT
CSMQT4WindowBase::getBinSize(ConstFieldMaskArg whichField
)
252 SizeT returnValue
= Inherited::getBinSize(whichField
);
254 if(FieldBits::NoField
!= (PrimaryDisplayStringFieldMask
& whichField
))
256 returnValue
+= _sfPrimaryDisplayString
.getBinSize();
258 if(FieldBits::NoField
!= (PrivateContextFieldMask
& whichField
))
260 returnValue
+= _sfPrivateContext
.getBinSize();
266 void CSMQT4WindowBase::copyToBin(BinaryDataHandler
&pMem
,
267 ConstFieldMaskArg whichField
)
269 Inherited::copyToBin(pMem
, whichField
);
271 if(FieldBits::NoField
!= (PrimaryDisplayStringFieldMask
& whichField
))
273 _sfPrimaryDisplayString
.copyToBin(pMem
);
275 if(FieldBits::NoField
!= (PrivateContextFieldMask
& whichField
))
277 _sfPrivateContext
.copyToBin(pMem
);
281 void CSMQT4WindowBase::copyFromBin(BinaryDataHandler
&pMem
,
282 ConstFieldMaskArg whichField
)
284 Inherited::copyFromBin(pMem
, whichField
);
286 if(FieldBits::NoField
!= (PrimaryDisplayStringFieldMask
& whichField
))
288 editSField(PrimaryDisplayStringFieldMask
);
289 _sfPrimaryDisplayString
.copyFromBin(pMem
);
291 if(FieldBits::NoField
!= (PrivateContextFieldMask
& whichField
))
293 editSField(PrivateContextFieldMask
);
294 _sfPrivateContext
.copyFromBin(pMem
);
298 //! create a new instance of the class
299 CSMQT4WindowTransitPtr
CSMQT4WindowBase::createLocal(BitVector bFlags
)
301 CSMQT4WindowTransitPtr fc
;
303 if(getClassType().getPrototype() != NULL
)
305 FieldContainerTransitPtr tmpPtr
=
306 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
308 fc
= dynamic_pointer_cast
<CSMQT4Window
>(tmpPtr
);
314 //! create a new instance of the class, copy the container flags
315 CSMQT4WindowTransitPtr
CSMQT4WindowBase::createDependent(BitVector bFlags
)
317 CSMQT4WindowTransitPtr fc
;
319 if(getClassType().getPrototype() != NULL
)
321 FieldContainerTransitPtr tmpPtr
=
322 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
324 fc
= dynamic_pointer_cast
<CSMQT4Window
>(tmpPtr
);
330 //! create a new instance of the class
331 CSMQT4WindowTransitPtr
CSMQT4WindowBase::create(void)
333 return createLocal();
336 CSMQT4Window
*CSMQT4WindowBase::createEmptyLocal(BitVector bFlags
)
338 CSMQT4Window
*returnValue
;
340 newPtr
<CSMQT4Window
>(returnValue
, bFlags
);
342 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
347 //! create an empty new instance of the class, do not copy the prototype
348 CSMQT4Window
*CSMQT4WindowBase::createEmpty(void)
350 return createEmptyLocal();
354 FieldContainerTransitPtr
CSMQT4WindowBase::shallowCopyLocal(
355 BitVector bFlags
) const
357 CSMQT4Window
*tmpPtr
;
359 newPtr(tmpPtr
, dynamic_cast<const CSMQT4Window
*>(this), bFlags
);
361 FieldContainerTransitPtr
returnValue(tmpPtr
);
363 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
368 FieldContainerTransitPtr
CSMQT4WindowBase::shallowCopyDependent(
369 BitVector bFlags
) const
371 CSMQT4Window
*tmpPtr
;
373 newPtr(tmpPtr
, dynamic_cast<const CSMQT4Window
*>(this), ~bFlags
);
375 FieldContainerTransitPtr
returnValue(tmpPtr
);
377 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
382 FieldContainerTransitPtr
CSMQT4WindowBase::shallowCopy(void) const
384 return shallowCopyLocal();
390 /*------------------------- constructors ----------------------------------*/
392 CSMQT4WindowBase::CSMQT4WindowBase(void) :
394 _sfPrimaryDisplayString (),
395 _sfPrivateContext (bool(false))
399 CSMQT4WindowBase::CSMQT4WindowBase(const CSMQT4WindowBase
&source
) :
401 _sfPrimaryDisplayString (source
._sfPrimaryDisplayString
),
402 _sfPrivateContext (source
._sfPrivateContext
)
407 /*-------------------------- destructors ----------------------------------*/
409 CSMQT4WindowBase::~CSMQT4WindowBase(void)
414 GetFieldHandlePtr
CSMQT4WindowBase::getHandlePrimaryDisplayString (void) const
416 SFString::GetHandlePtr
returnValue(
417 new SFString::GetHandle(
418 &_sfPrimaryDisplayString
,
419 this->getType().getFieldDesc(PrimaryDisplayStringFieldId
),
420 const_cast<CSMQT4WindowBase
*>(this)));
425 EditFieldHandlePtr
CSMQT4WindowBase::editHandlePrimaryDisplayString(void)
427 SFString::EditHandlePtr
returnValue(
428 new SFString::EditHandle(
429 &_sfPrimaryDisplayString
,
430 this->getType().getFieldDesc(PrimaryDisplayStringFieldId
),
434 editSField(PrimaryDisplayStringFieldMask
);
439 GetFieldHandlePtr
CSMQT4WindowBase::getHandlePrivateContext (void) const
441 SFBool::GetHandlePtr
returnValue(
442 new SFBool::GetHandle(
444 this->getType().getFieldDesc(PrivateContextFieldId
),
445 const_cast<CSMQT4WindowBase
*>(this)));
450 EditFieldHandlePtr
CSMQT4WindowBase::editHandlePrivateContext (void)
452 SFBool::EditHandlePtr
returnValue(
453 new SFBool::EditHandle(
455 this->getType().getFieldDesc(PrivateContextFieldId
),
459 editSField(PrivateContextFieldMask
);
465 #ifdef OSG_MT_CPTR_ASPECT
466 void CSMQT4WindowBase::execSyncV( FieldContainer
&oFrom
,
467 ConstFieldMaskArg whichField
,
468 AspectOffsetStore
&oOffsets
,
469 ConstFieldMaskArg syncMode
,
470 const UInt32 uiSyncInfo
)
472 CSMQT4Window
*pThis
= static_cast<CSMQT4Window
*>(this);
474 pThis
->execSync(static_cast<CSMQT4Window
*>(&oFrom
),
483 #ifdef OSG_MT_CPTR_ASPECT
484 FieldContainer
*CSMQT4WindowBase::createAspectCopy(
485 const FieldContainer
*pRefAspect
) const
487 CSMQT4Window
*returnValue
;
489 newAspectCopy(returnValue
,
490 dynamic_cast<const CSMQT4Window
*>(pRefAspect
),
491 dynamic_cast<const CSMQT4Window
*>(this));
497 void CSMQT4WindowBase::resolveLinks(void)
499 Inherited::resolveLinks();