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 HeadTrackedStereoCameraDecorator!
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 "OSGNode.h" // User Class
67 #include "OSGHeadTrackedStereoCameraDecoratorBase.h"
68 #include "OSGHeadTrackedStereoCameraDecorator.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::HeadTrackedStereoCameraDecorator
79 The decorator for tracked stereo projections (e.g. HMD's), see \ref
80 PageSystemWindowCameraDecoratorsStereoProjection for a description.
82 The parameters are defined by the _sfUser field.
85 /***************************************************************************\
86 * Field Documentation *
87 \***************************************************************************/
89 /*! \var Node * HeadTrackedStereoCameraDecoratorBase::_sfUser
90 The coordinate system relative to the camera.
94 /***************************************************************************\
95 * FieldType/FieldTrait Instantiation *
96 \***************************************************************************/
98 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
99 PointerType FieldTraits
<HeadTrackedStereoCameraDecorator
*, nsOSG
>::_type(
100 "HeadTrackedStereoCameraDecoratorPtr",
101 "StereoCameraDecoratorPtr",
102 HeadTrackedStereoCameraDecorator::getClassType(),
106 OSG_FIELDTRAITS_GETTYPE_NS(HeadTrackedStereoCameraDecorator
*, nsOSG
)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
109 HeadTrackedStereoCameraDecorator
*,
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
113 HeadTrackedStereoCameraDecorator
*,
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void HeadTrackedStereoCameraDecoratorBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFUnrecNodePtr::Description(
126 SFUnrecNodePtr::getClassType(),
128 "The coordinate system relative to the camera.\n",
129 UserFieldId
, UserFieldMask
,
131 (Field::SFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&HeadTrackedStereoCameraDecorator::editHandleUser
),
133 static_cast<FieldGetMethodSig
>(&HeadTrackedStereoCameraDecorator::getHandleUser
));
135 oType
.addInitialDesc(pDesc
);
139 HeadTrackedStereoCameraDecoratorBase::TypeObject
HeadTrackedStereoCameraDecoratorBase::_type(
140 HeadTrackedStereoCameraDecoratorBase::getClassname(),
141 Inherited::getClassname(),
144 reinterpret_cast<PrototypeCreateF
>(&HeadTrackedStereoCameraDecoratorBase::createEmptyLocal
),
145 reinterpret_cast<InitContainerF
>(&HeadTrackedStereoCameraDecorator::initMethod
),
146 reinterpret_cast<ExitContainerF
>(&HeadTrackedStereoCameraDecorator::exitMethod
),
147 reinterpret_cast<InitalInsertDescFunc
>(
148 reinterpret_cast<void *>(&HeadTrackedStereoCameraDecorator::classDescInserter
)),
151 "<?xml version=\"1.0\"?>\n"
154 " name=\"HeadTrackedStereoCameraDecorator\"\n"
155 " parent=\"StereoCameraDecorator\"\n"
156 " library=\"Window\"\n"
157 " pointerfieldtypes=\"both\"\n"
158 " structure=\"concrete\"\n"
159 " systemcomponent=\"true\"\n"
160 " parentsystemcomponent=\"true\"\n"
161 " decoratable=\"false\"\n"
162 " docGroupBase=\"GrpWindowCamera\"\n"
164 " The decorator for tracked stereo projections (e.g. HMD's), see \\ref\n"
165 " PageSystemWindowCameraDecoratorsStereoProjection for a description.\n"
167 " The parameters are defined by the _sfUser field.\n"
171 "\t type=\"NodePtr\"\n"
172 "\t cardinality=\"single\"\n"
173 "\t visibility=\"external\"\n"
174 "\t access=\"public\"\n"
176 "\tThe coordinate system relative to the camera.\n"
178 "</FieldContainer>\n",
179 "The decorator for tracked stereo projections (e.g. HMD's), see \\ref\n"
180 "PageSystemWindowCameraDecoratorsStereoProjection for a description.\n"
182 "The parameters are defined by the _sfUser field.\n"
185 /*------------------------------ get -----------------------------------*/
187 FieldContainerType
&HeadTrackedStereoCameraDecoratorBase::getType(void)
192 const FieldContainerType
&HeadTrackedStereoCameraDecoratorBase::getType(void) const
197 UInt32
HeadTrackedStereoCameraDecoratorBase::getContainerSize(void) const
199 return sizeof(HeadTrackedStereoCameraDecorator
);
202 /*------------------------- decorator get ------------------------------*/
205 //! Get the HeadTrackedStereoCameraDecorator::_sfUser field.
206 const SFUnrecNodePtr
*HeadTrackedStereoCameraDecoratorBase::getSFUser(void) const
211 SFUnrecNodePtr
*HeadTrackedStereoCameraDecoratorBase::editSFUser (void)
213 editSField(UserFieldMask
);
218 //! Get the value of the HeadTrackedStereoCameraDecorator::_sfUser field.
219 Node
* HeadTrackedStereoCameraDecoratorBase::getUser(void) const
221 return _sfUser
.getValue();
224 //! Set the value of the HeadTrackedStereoCameraDecorator::_sfUser field.
225 void HeadTrackedStereoCameraDecoratorBase::setUser(Node
* const value
)
227 editSField(UserFieldMask
);
229 _sfUser
.setValue(value
);
237 /*------------------------------ access -----------------------------------*/
239 SizeT
HeadTrackedStereoCameraDecoratorBase::getBinSize(ConstFieldMaskArg whichField
)
241 SizeT returnValue
= Inherited::getBinSize(whichField
);
243 if(FieldBits::NoField
!= (UserFieldMask
& whichField
))
245 returnValue
+= _sfUser
.getBinSize();
251 void HeadTrackedStereoCameraDecoratorBase::copyToBin(BinaryDataHandler
&pMem
,
252 ConstFieldMaskArg whichField
)
254 Inherited::copyToBin(pMem
, whichField
);
256 if(FieldBits::NoField
!= (UserFieldMask
& whichField
))
258 _sfUser
.copyToBin(pMem
);
262 void HeadTrackedStereoCameraDecoratorBase::copyFromBin(BinaryDataHandler
&pMem
,
263 ConstFieldMaskArg whichField
)
265 Inherited::copyFromBin(pMem
, whichField
);
267 if(FieldBits::NoField
!= (UserFieldMask
& whichField
))
269 editSField(UserFieldMask
);
270 _sfUser
.copyFromBin(pMem
);
274 //! create a new instance of the class
275 HeadTrackedStereoCameraDecoratorTransitPtr
HeadTrackedStereoCameraDecoratorBase::createLocal(BitVector bFlags
)
277 HeadTrackedStereoCameraDecoratorTransitPtr fc
;
279 if(getClassType().getPrototype() != NULL
)
281 FieldContainerTransitPtr tmpPtr
=
282 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
284 fc
= dynamic_pointer_cast
<HeadTrackedStereoCameraDecorator
>(tmpPtr
);
290 //! create a new instance of the class, copy the container flags
291 HeadTrackedStereoCameraDecoratorTransitPtr
HeadTrackedStereoCameraDecoratorBase::createDependent(BitVector bFlags
)
293 HeadTrackedStereoCameraDecoratorTransitPtr fc
;
295 if(getClassType().getPrototype() != NULL
)
297 FieldContainerTransitPtr tmpPtr
=
298 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
300 fc
= dynamic_pointer_cast
<HeadTrackedStereoCameraDecorator
>(tmpPtr
);
306 //! create a new instance of the class
307 HeadTrackedStereoCameraDecoratorTransitPtr
HeadTrackedStereoCameraDecoratorBase::create(void)
309 HeadTrackedStereoCameraDecoratorTransitPtr fc
;
311 if(getClassType().getPrototype() != NULL
)
313 FieldContainerTransitPtr tmpPtr
=
314 getClassType().getPrototype()-> shallowCopy();
316 fc
= dynamic_pointer_cast
<HeadTrackedStereoCameraDecorator
>(tmpPtr
);
322 HeadTrackedStereoCameraDecorator
*HeadTrackedStereoCameraDecoratorBase::createEmptyLocal(BitVector bFlags
)
324 HeadTrackedStereoCameraDecorator
*returnValue
;
326 newPtr
<HeadTrackedStereoCameraDecorator
>(returnValue
, bFlags
);
328 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
333 //! create an empty new instance of the class, do not copy the prototype
334 HeadTrackedStereoCameraDecorator
*HeadTrackedStereoCameraDecoratorBase::createEmpty(void)
336 HeadTrackedStereoCameraDecorator
*returnValue
;
338 newPtr
<HeadTrackedStereoCameraDecorator
>(returnValue
, Thread::getCurrentLocalFlags());
340 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
341 ~Thread::getCurrentLocalFlags();
347 FieldContainerTransitPtr
HeadTrackedStereoCameraDecoratorBase::shallowCopyLocal(
348 BitVector bFlags
) const
350 HeadTrackedStereoCameraDecorator
*tmpPtr
;
352 newPtr(tmpPtr
, dynamic_cast<const HeadTrackedStereoCameraDecorator
*>(this), bFlags
);
354 FieldContainerTransitPtr
returnValue(tmpPtr
);
356 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
361 FieldContainerTransitPtr
HeadTrackedStereoCameraDecoratorBase::shallowCopyDependent(
362 BitVector bFlags
) const
364 HeadTrackedStereoCameraDecorator
*tmpPtr
;
366 newPtr(tmpPtr
, dynamic_cast<const HeadTrackedStereoCameraDecorator
*>(this), ~bFlags
);
368 FieldContainerTransitPtr
returnValue(tmpPtr
);
370 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
375 FieldContainerTransitPtr
HeadTrackedStereoCameraDecoratorBase::shallowCopy(void) const
377 HeadTrackedStereoCameraDecorator
*tmpPtr
;
380 dynamic_cast<const HeadTrackedStereoCameraDecorator
*>(this),
381 Thread::getCurrentLocalFlags());
383 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
385 FieldContainerTransitPtr
returnValue(tmpPtr
);
393 /*------------------------- constructors ----------------------------------*/
395 HeadTrackedStereoCameraDecoratorBase::HeadTrackedStereoCameraDecoratorBase(void) :
401 HeadTrackedStereoCameraDecoratorBase::HeadTrackedStereoCameraDecoratorBase(const HeadTrackedStereoCameraDecoratorBase
&source
) :
408 /*-------------------------- destructors ----------------------------------*/
410 HeadTrackedStereoCameraDecoratorBase::~HeadTrackedStereoCameraDecoratorBase(void)
414 void HeadTrackedStereoCameraDecoratorBase::onCreate(const HeadTrackedStereoCameraDecorator
*source
)
416 Inherited::onCreate(source
);
420 HeadTrackedStereoCameraDecorator
*pThis
= static_cast<HeadTrackedStereoCameraDecorator
*>(this);
422 pThis
->setUser(source
->getUser());
426 GetFieldHandlePtr
HeadTrackedStereoCameraDecoratorBase::getHandleUser (void) const
428 SFUnrecNodePtr::GetHandlePtr
returnValue(
429 new SFUnrecNodePtr::GetHandle(
431 this->getType().getFieldDesc(UserFieldId
),
432 const_cast<HeadTrackedStereoCameraDecoratorBase
*>(this)));
437 EditFieldHandlePtr
HeadTrackedStereoCameraDecoratorBase::editHandleUser (void)
439 SFUnrecNodePtr::EditHandlePtr
returnValue(
440 new SFUnrecNodePtr::EditHandle(
442 this->getType().getFieldDesc(UserFieldId
),
445 returnValue
->setSetMethod(
446 boost::bind(&HeadTrackedStereoCameraDecorator::setUser
,
447 static_cast<HeadTrackedStereoCameraDecorator
*>(this), _1
));
449 editSField(UserFieldMask
);
455 #ifdef OSG_MT_CPTR_ASPECT
456 void HeadTrackedStereoCameraDecoratorBase::execSyncV( FieldContainer
&oFrom
,
457 ConstFieldMaskArg whichField
,
458 AspectOffsetStore
&oOffsets
,
459 ConstFieldMaskArg syncMode
,
460 const UInt32 uiSyncInfo
)
462 HeadTrackedStereoCameraDecorator
*pThis
= static_cast<HeadTrackedStereoCameraDecorator
*>(this);
464 pThis
->execSync(static_cast<HeadTrackedStereoCameraDecorator
*>(&oFrom
),
473 #ifdef OSG_MT_CPTR_ASPECT
474 FieldContainer
*HeadTrackedStereoCameraDecoratorBase::createAspectCopy(
475 const FieldContainer
*pRefAspect
) const
477 HeadTrackedStereoCameraDecorator
*returnValue
;
479 newAspectCopy(returnValue
,
480 dynamic_cast<const HeadTrackedStereoCameraDecorator
*>(pRefAspect
),
481 dynamic_cast<const HeadTrackedStereoCameraDecorator
*>(this));
487 void HeadTrackedStereoCameraDecoratorBase::resolveLinks(void)
489 Inherited::resolveLinks();
491 static_cast<HeadTrackedStereoCameraDecorator
*>(this)->setUser(NULL
);