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 CSMPassiveWindow!
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 "OSGCSMPassiveWinClearOp.h" // ClearOp Class
67 #include "OSGCSMPassiveWindowBase.h"
68 #include "OSGCSMPassiveWindow.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::CSMPassiveWindow
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var Vec2f CSMPassiveWindowBase::_sfViewportScale
90 /*! \var CSMPassiveWinClearOp * CSMPassiveWindowBase::_sfClearOp
95 /***************************************************************************\
96 * FieldType/FieldTrait Instantiation *
97 \***************************************************************************/
99 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
100 PointerType FieldTraits
<CSMPassiveWindow
*, nsOSG
>::_type(
101 "CSMPassiveWindowPtr",
103 CSMPassiveWindow::getClassType(),
107 OSG_FIELDTRAITS_GETTYPE_NS(CSMPassiveWindow
*, nsOSG
)
109 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
113 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
117 /***************************************************************************\
118 * Field Description *
119 \***************************************************************************/
121 void CSMPassiveWindowBase::classDescInserter(TypeObject
&oType
)
123 FieldDescriptionBase
*pDesc
= NULL
;
126 pDesc
= new SFVec2f::Description(
127 SFVec2f::getClassType(),
130 ViewportScaleFieldId
, ViewportScaleFieldMask
,
132 (Field::SFDefaultFlags
| Field::FStdAccess
),
133 static_cast<FieldEditMethodSig
>(&CSMPassiveWindow::editHandleViewportScale
),
134 static_cast<FieldGetMethodSig
>(&CSMPassiveWindow::getHandleViewportScale
));
136 oType
.addInitialDesc(pDesc
);
138 pDesc
= new SFUnrecCSMPassiveWinClearOpPtr::Description(
139 SFUnrecCSMPassiveWinClearOpPtr::getClassType(),
142 ClearOpFieldId
, ClearOpFieldMask
,
144 (Field::SFDefaultFlags
| Field::FStdAccess
),
145 static_cast<FieldEditMethodSig
>(&CSMPassiveWindow::editHandleClearOp
),
146 static_cast<FieldGetMethodSig
>(&CSMPassiveWindow::getHandleClearOp
));
148 oType
.addInitialDesc(pDesc
);
152 CSMPassiveWindowBase::TypeObject
CSMPassiveWindowBase::_type(
153 CSMPassiveWindowBase::getClassname(),
154 Inherited::getClassname(),
157 reinterpret_cast<PrototypeCreateF
>(&CSMPassiveWindowBase::createEmptyLocal
),
158 reinterpret_cast<InitContainerF
>(&CSMPassiveWindow::initMethod
),
159 reinterpret_cast<ExitContainerF
>(&CSMPassiveWindow::exitMethod
),
160 reinterpret_cast<InitalInsertDescFunc
>(
161 reinterpret_cast<void *>(&CSMPassiveWindow::classDescInserter
)),
164 "<?xml version=\"1.0\"?>\n"
167 " name=\"CSMPassiveWindow\"\n"
168 " parent=\"CSMWindow\"\n"
169 " library=\"ContribCSM\"\n"
170 " pointerfieldtypes=\"both\"\n"
171 " structure=\"concrete\"\n"
172 " systemcomponent=\"true\"\n"
173 " parentsystemcomponent=\"true\"\n"
174 " decoratable=\"false\"\n"
175 " useLocalIncludes=\"false\"\n"
176 " isNodeCore=\"false\"\n"
177 " isBundle=\"true\"\n"
180 "\t\tname=\"viewportScale\"\n"
181 "\t\ttype=\"Vec2f\"\n"
182 "\t\tcardinality=\"single\"\n"
183 "\t\tvisibility=\"external\"\n"
184 "\t\taccess=\"public\"\n"
185 " defaultValue=\"1.f, 1.f\"\n"
189 "\t\tname=\"clearOp\"\n"
190 "\t\ttype=\"CSMPassiveWinClearOp\"\n"
191 " category=\"pointer\"\n"
192 "\t\tcardinality=\"single\"\n"
193 "\t\tvisibility=\"external\"\n"
194 "\t\taccess=\"public\"\n"
195 " defaultValue=\"NULL\"\n"
198 "</FieldContainer>\n",
202 /*------------------------------ get -----------------------------------*/
204 FieldContainerType
&CSMPassiveWindowBase::getType(void)
209 const FieldContainerType
&CSMPassiveWindowBase::getType(void) const
214 UInt32
CSMPassiveWindowBase::getContainerSize(void) const
216 return sizeof(CSMPassiveWindow
);
219 /*------------------------- decorator get ------------------------------*/
222 SFVec2f
*CSMPassiveWindowBase::editSFViewportScale(void)
224 editSField(ViewportScaleFieldMask
);
226 return &_sfViewportScale
;
229 const SFVec2f
*CSMPassiveWindowBase::getSFViewportScale(void) const
231 return &_sfViewportScale
;
235 //! Get the CSMPassiveWindow::_sfClearOp field.
236 const SFUnrecCSMPassiveWinClearOpPtr
*CSMPassiveWindowBase::getSFClearOp(void) const
241 SFUnrecCSMPassiveWinClearOpPtr
*CSMPassiveWindowBase::editSFClearOp (void)
243 editSField(ClearOpFieldMask
);
248 //! Get the value of the CSMPassiveWindow::_sfClearOp field.
249 CSMPassiveWinClearOp
* CSMPassiveWindowBase::getClearOp(void) const
251 return _sfClearOp
.getValue();
254 //! Set the value of the CSMPassiveWindow::_sfClearOp field.
255 void CSMPassiveWindowBase::setClearOp(CSMPassiveWinClearOp
* const value
)
257 editSField(ClearOpFieldMask
);
259 _sfClearOp
.setValue(value
);
267 /*------------------------------ access -----------------------------------*/
269 SizeT
CSMPassiveWindowBase::getBinSize(ConstFieldMaskArg whichField
)
271 SizeT returnValue
= Inherited::getBinSize(whichField
);
273 if(FieldBits::NoField
!= (ViewportScaleFieldMask
& whichField
))
275 returnValue
+= _sfViewportScale
.getBinSize();
277 if(FieldBits::NoField
!= (ClearOpFieldMask
& whichField
))
279 returnValue
+= _sfClearOp
.getBinSize();
285 void CSMPassiveWindowBase::copyToBin(BinaryDataHandler
&pMem
,
286 ConstFieldMaskArg whichField
)
288 Inherited::copyToBin(pMem
, whichField
);
290 if(FieldBits::NoField
!= (ViewportScaleFieldMask
& whichField
))
292 _sfViewportScale
.copyToBin(pMem
);
294 if(FieldBits::NoField
!= (ClearOpFieldMask
& whichField
))
296 _sfClearOp
.copyToBin(pMem
);
300 void CSMPassiveWindowBase::copyFromBin(BinaryDataHandler
&pMem
,
301 ConstFieldMaskArg whichField
)
303 Inherited::copyFromBin(pMem
, whichField
);
305 if(FieldBits::NoField
!= (ViewportScaleFieldMask
& whichField
))
307 editSField(ViewportScaleFieldMask
);
308 _sfViewportScale
.copyFromBin(pMem
);
310 if(FieldBits::NoField
!= (ClearOpFieldMask
& whichField
))
312 editSField(ClearOpFieldMask
);
313 _sfClearOp
.copyFromBin(pMem
);
317 //! create a new instance of the class
318 CSMPassiveWindowTransitPtr
CSMPassiveWindowBase::createLocal(BitVector bFlags
)
320 CSMPassiveWindowTransitPtr fc
;
322 if(getClassType().getPrototype() != NULL
)
324 FieldContainerTransitPtr tmpPtr
=
325 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
327 fc
= dynamic_pointer_cast
<CSMPassiveWindow
>(tmpPtr
);
333 //! create a new instance of the class, copy the container flags
334 CSMPassiveWindowTransitPtr
CSMPassiveWindowBase::createDependent(BitVector bFlags
)
336 CSMPassiveWindowTransitPtr fc
;
338 if(getClassType().getPrototype() != NULL
)
340 FieldContainerTransitPtr tmpPtr
=
341 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
343 fc
= dynamic_pointer_cast
<CSMPassiveWindow
>(tmpPtr
);
349 //! create a new instance of the class
350 CSMPassiveWindowTransitPtr
CSMPassiveWindowBase::create(void)
352 return createLocal();
355 CSMPassiveWindow
*CSMPassiveWindowBase::createEmptyLocal(BitVector bFlags
)
357 CSMPassiveWindow
*returnValue
;
359 newPtr
<CSMPassiveWindow
>(returnValue
, bFlags
);
361 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
366 //! create an empty new instance of the class, do not copy the prototype
367 CSMPassiveWindow
*CSMPassiveWindowBase::createEmpty(void)
369 return createEmptyLocal();
373 FieldContainerTransitPtr
CSMPassiveWindowBase::shallowCopyLocal(
374 BitVector bFlags
) const
376 CSMPassiveWindow
*tmpPtr
;
378 newPtr(tmpPtr
, dynamic_cast<const CSMPassiveWindow
*>(this), bFlags
);
380 FieldContainerTransitPtr
returnValue(tmpPtr
);
382 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
387 FieldContainerTransitPtr
CSMPassiveWindowBase::shallowCopyDependent(
388 BitVector bFlags
) const
390 CSMPassiveWindow
*tmpPtr
;
392 newPtr(tmpPtr
, dynamic_cast<const CSMPassiveWindow
*>(this), ~bFlags
);
394 FieldContainerTransitPtr
returnValue(tmpPtr
);
396 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
401 FieldContainerTransitPtr
CSMPassiveWindowBase::shallowCopy(void) const
403 return shallowCopyLocal();
409 /*------------------------- constructors ----------------------------------*/
411 CSMPassiveWindowBase::CSMPassiveWindowBase(void) :
413 _sfViewportScale (Vec2f(1.f
, 1.f
)),
418 CSMPassiveWindowBase::CSMPassiveWindowBase(const CSMPassiveWindowBase
&source
) :
420 _sfViewportScale (source
._sfViewportScale
),
426 /*-------------------------- destructors ----------------------------------*/
428 CSMPassiveWindowBase::~CSMPassiveWindowBase(void)
432 void CSMPassiveWindowBase::onCreate(const CSMPassiveWindow
*source
)
434 Inherited::onCreate(source
);
438 CSMPassiveWindow
*pThis
= static_cast<CSMPassiveWindow
*>(this);
440 pThis
->setClearOp(source
->getClearOp());
444 GetFieldHandlePtr
CSMPassiveWindowBase::getHandleViewportScale (void) const
446 SFVec2f::GetHandlePtr
returnValue(
447 new SFVec2f::GetHandle(
449 this->getType().getFieldDesc(ViewportScaleFieldId
),
450 const_cast<CSMPassiveWindowBase
*>(this)));
455 EditFieldHandlePtr
CSMPassiveWindowBase::editHandleViewportScale (void)
457 SFVec2f::EditHandlePtr
returnValue(
458 new SFVec2f::EditHandle(
460 this->getType().getFieldDesc(ViewportScaleFieldId
),
464 editSField(ViewportScaleFieldMask
);
469 GetFieldHandlePtr
CSMPassiveWindowBase::getHandleClearOp (void) const
471 SFUnrecCSMPassiveWinClearOpPtr::GetHandlePtr
returnValue(
472 new SFUnrecCSMPassiveWinClearOpPtr::GetHandle(
474 this->getType().getFieldDesc(ClearOpFieldId
),
475 const_cast<CSMPassiveWindowBase
*>(this)));
480 EditFieldHandlePtr
CSMPassiveWindowBase::editHandleClearOp (void)
482 SFUnrecCSMPassiveWinClearOpPtr::EditHandlePtr
returnValue(
483 new SFUnrecCSMPassiveWinClearOpPtr::EditHandle(
485 this->getType().getFieldDesc(ClearOpFieldId
),
488 returnValue
->setSetMethod(
489 boost::bind(&CSMPassiveWindow::setClearOp
,
490 static_cast<CSMPassiveWindow
*>(this), _1
));
492 editSField(ClearOpFieldMask
);
498 #ifdef OSG_MT_CPTR_ASPECT
499 void CSMPassiveWindowBase::execSyncV( FieldContainer
&oFrom
,
500 ConstFieldMaskArg whichField
,
501 AspectOffsetStore
&oOffsets
,
502 ConstFieldMaskArg syncMode
,
503 const UInt32 uiSyncInfo
)
505 CSMPassiveWindow
*pThis
= static_cast<CSMPassiveWindow
*>(this);
507 pThis
->execSync(static_cast<CSMPassiveWindow
*>(&oFrom
),
516 #ifdef OSG_MT_CPTR_ASPECT
517 FieldContainer
*CSMPassiveWindowBase::createAspectCopy(
518 const FieldContainer
*pRefAspect
) const
520 CSMPassiveWindow
*returnValue
;
522 newAspectCopy(returnValue
,
523 dynamic_cast<const CSMPassiveWindow
*>(pRefAspect
),
524 dynamic_cast<const CSMPassiveWindow
*>(this));
530 void CSMPassiveWindowBase::resolveLinks(void)
532 Inherited::resolveLinks();
534 static_cast<CSMPassiveWindow
*>(this)->setClearOp(NULL
);