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 MouseDataInterfaceSensor!
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 "OSGMouseDataInterfaceSensorBase.h"
67 #include "OSGMouseDataInterfaceSensor.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::MouseDataInterfaceSensor
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var MouseData MouseDataInterfaceSensorBase::_sfMouseData
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<MouseDataInterfaceSensor
*, nsOSG
>::_type(
96 "MouseDataInterfaceSensorPtr",
97 "DeviceInterfaceSensorPtr",
98 MouseDataInterfaceSensor::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(MouseDataInterfaceSensor
*, nsOSG
)
104 /***************************************************************************\
105 * Field Description *
106 \***************************************************************************/
108 void MouseDataInterfaceSensorBase::classDescInserter(TypeObject
&oType
)
110 FieldDescriptionBase
*pDesc
= NULL
;
113 pDesc
= new SFMouseData::Description(
114 SFMouseData::getClassType(),
117 MouseDataFieldId
, MouseDataFieldMask
,
119 (Field::SFDefaultFlags
| Field::FStdAccess
),
120 static_cast<FieldEditMethodSig
>(&MouseDataInterfaceSensor::editHandleMouseData
),
121 static_cast<FieldGetMethodSig
>(&MouseDataInterfaceSensor::getHandleMouseData
));
123 oType
.addInitialDesc(pDesc
);
127 MouseDataInterfaceSensorBase::TypeObject
MouseDataInterfaceSensorBase::_type(
128 MouseDataInterfaceSensorBase::getClassname(),
129 Inherited::getClassname(),
132 reinterpret_cast<PrototypeCreateF
>(&MouseDataInterfaceSensorBase::createEmptyLocal
),
133 reinterpret_cast<InitContainerF
>(&MouseDataInterfaceSensor::initMethod
),
134 reinterpret_cast<ExitContainerF
>(&MouseDataInterfaceSensor::exitMethod
),
135 reinterpret_cast<InitalInsertDescFunc
>(
136 reinterpret_cast<void *>(&MouseDataInterfaceSensor::classDescInserter
)),
139 "<?xml version=\"1.0\"?>\n"
142 " name=\"MouseDataInterfaceSensor\"\n"
143 " parent=\"DeviceInterfaceSensor\"\n"
144 " library=\"ContribCSM\"\n"
145 " pointerfieldtypes=\"none\"\n"
146 " structure=\"concrete\"\n"
147 " systemcomponent=\"true\"\n"
148 " parentsystemcomponent=\"true\"\n"
149 " decoratable=\"false\"\n"
150 " useLocalIncludes=\"false\"\n"
151 " isNodeCore=\"false\"\n"
152 " isBundle=\"false\"\n"
153 " parentFields=\"none\"\n"
156 "\t\tname=\"mouseData\"\n"
157 "\t\ttype=\"MouseData\"\n"
158 "\t\tcardinality=\"single\"\n"
159 "\t\tvisibility=\"internal\"\n"
160 "\t\taccess=\"public\"\n"
163 "</FieldContainer>\n",
167 /*------------------------------ get -----------------------------------*/
169 FieldContainerType
&MouseDataInterfaceSensorBase::getType(void)
174 const FieldContainerType
&MouseDataInterfaceSensorBase::getType(void) const
179 UInt32
MouseDataInterfaceSensorBase::getContainerSize(void) const
181 return sizeof(MouseDataInterfaceSensor
);
184 /*------------------------- decorator get ------------------------------*/
187 SFMouseData
*MouseDataInterfaceSensorBase::editSFMouseData(void)
189 editSField(MouseDataFieldMask
);
191 return &_sfMouseData
;
194 const SFMouseData
*MouseDataInterfaceSensorBase::getSFMouseData(void) const
196 return &_sfMouseData
;
204 /*------------------------------ access -----------------------------------*/
206 SizeT
MouseDataInterfaceSensorBase::getBinSize(ConstFieldMaskArg whichField
)
208 SizeT returnValue
= Inherited::getBinSize(whichField
);
210 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
212 returnValue
+= _sfMouseData
.getBinSize();
218 void MouseDataInterfaceSensorBase::copyToBin(BinaryDataHandler
&pMem
,
219 ConstFieldMaskArg whichField
)
221 Inherited::copyToBin(pMem
, whichField
);
223 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
225 _sfMouseData
.copyToBin(pMem
);
229 void MouseDataInterfaceSensorBase::copyFromBin(BinaryDataHandler
&pMem
,
230 ConstFieldMaskArg whichField
)
232 Inherited::copyFromBin(pMem
, whichField
);
234 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
236 editSField(MouseDataFieldMask
);
237 _sfMouseData
.copyFromBin(pMem
);
241 //! create a new instance of the class
242 MouseDataInterfaceSensorTransitPtr
MouseDataInterfaceSensorBase::createLocal(BitVector bFlags
)
244 MouseDataInterfaceSensorTransitPtr fc
;
246 if(getClassType().getPrototype() != NULL
)
248 FieldContainerTransitPtr tmpPtr
=
249 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
251 fc
= dynamic_pointer_cast
<MouseDataInterfaceSensor
>(tmpPtr
);
257 //! create a new instance of the class, copy the container flags
258 MouseDataInterfaceSensorTransitPtr
MouseDataInterfaceSensorBase::createDependent(BitVector bFlags
)
260 MouseDataInterfaceSensorTransitPtr fc
;
262 if(getClassType().getPrototype() != NULL
)
264 FieldContainerTransitPtr tmpPtr
=
265 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
267 fc
= dynamic_pointer_cast
<MouseDataInterfaceSensor
>(tmpPtr
);
273 //! create a new instance of the class
274 MouseDataInterfaceSensorTransitPtr
MouseDataInterfaceSensorBase::create(void)
276 MouseDataInterfaceSensorTransitPtr fc
;
278 if(getClassType().getPrototype() != NULL
)
280 FieldContainerTransitPtr tmpPtr
=
281 getClassType().getPrototype()-> shallowCopy();
283 fc
= dynamic_pointer_cast
<MouseDataInterfaceSensor
>(tmpPtr
);
289 MouseDataInterfaceSensor
*MouseDataInterfaceSensorBase::createEmptyLocal(BitVector bFlags
)
291 MouseDataInterfaceSensor
*returnValue
;
293 newPtr
<MouseDataInterfaceSensor
>(returnValue
, bFlags
);
295 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
300 //! create an empty new instance of the class, do not copy the prototype
301 MouseDataInterfaceSensor
*MouseDataInterfaceSensorBase::createEmpty(void)
303 MouseDataInterfaceSensor
*returnValue
;
305 newPtr
<MouseDataInterfaceSensor
>(returnValue
, Thread::getCurrentLocalFlags());
307 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
308 ~Thread::getCurrentLocalFlags();
314 FieldContainerTransitPtr
MouseDataInterfaceSensorBase::shallowCopyLocal(
315 BitVector bFlags
) const
317 MouseDataInterfaceSensor
*tmpPtr
;
319 newPtr(tmpPtr
, dynamic_cast<const MouseDataInterfaceSensor
*>(this), bFlags
);
321 FieldContainerTransitPtr
returnValue(tmpPtr
);
323 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
328 FieldContainerTransitPtr
MouseDataInterfaceSensorBase::shallowCopyDependent(
329 BitVector bFlags
) const
331 MouseDataInterfaceSensor
*tmpPtr
;
333 newPtr(tmpPtr
, dynamic_cast<const MouseDataInterfaceSensor
*>(this), ~bFlags
);
335 FieldContainerTransitPtr
returnValue(tmpPtr
);
337 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
342 FieldContainerTransitPtr
MouseDataInterfaceSensorBase::shallowCopy(void) const
344 MouseDataInterfaceSensor
*tmpPtr
;
347 dynamic_cast<const MouseDataInterfaceSensor
*>(this),
348 Thread::getCurrentLocalFlags());
350 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
352 FieldContainerTransitPtr
returnValue(tmpPtr
);
360 /*------------------------- constructors ----------------------------------*/
362 MouseDataInterfaceSensorBase::MouseDataInterfaceSensorBase(void) :
368 MouseDataInterfaceSensorBase::MouseDataInterfaceSensorBase(const MouseDataInterfaceSensorBase
&source
) :
370 _sfMouseData (source
._sfMouseData
)
375 /*-------------------------- destructors ----------------------------------*/
377 MouseDataInterfaceSensorBase::~MouseDataInterfaceSensorBase(void)
382 GetFieldHandlePtr
MouseDataInterfaceSensorBase::getHandleMouseData (void) const
384 SFMouseData::GetHandlePtr
returnValue(
385 new SFMouseData::GetHandle(
387 this->getType().getFieldDesc(MouseDataFieldId
),
388 const_cast<MouseDataInterfaceSensorBase
*>(this)));
393 EditFieldHandlePtr
MouseDataInterfaceSensorBase::editHandleMouseData (void)
395 SFMouseData::EditHandlePtr
returnValue(
396 new SFMouseData::EditHandle(
398 this->getType().getFieldDesc(MouseDataFieldId
),
402 editSField(MouseDataFieldMask
);
408 #ifdef OSG_MT_CPTR_ASPECT
409 void MouseDataInterfaceSensorBase::execSyncV( FieldContainer
&oFrom
,
410 ConstFieldMaskArg whichField
,
411 AspectOffsetStore
&oOffsets
,
412 ConstFieldMaskArg syncMode
,
413 const UInt32 uiSyncInfo
)
415 MouseDataInterfaceSensor
*pThis
= static_cast<MouseDataInterfaceSensor
*>(this);
417 pThis
->execSync(static_cast<MouseDataInterfaceSensor
*>(&oFrom
),
426 #ifdef OSG_MT_CPTR_ASPECT
427 FieldContainer
*MouseDataInterfaceSensorBase::createAspectCopy(
428 const FieldContainer
*pRefAspect
) const
430 MouseDataInterfaceSensor
*returnValue
;
432 newAspectCopy(returnValue
,
433 dynamic_cast<const MouseDataInterfaceSensor
*>(pRefAspect
),
434 dynamic_cast<const MouseDataInterfaceSensor
*>(this));
440 void MouseDataInterfaceSensorBase::resolveLinks(void)
442 Inherited::resolveLinks();