changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Passive / OSGCSMPassiveWindowBase.cpp
blob7898950690797efb7b70e1abe61801770ece54f8
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class CSMPassiveWindow!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
65 #include "OSGCSMPassiveWinClearOp.h" // ClearOp Class
67 #include "OSGCSMPassiveWindowBase.h"
68 #include "OSGCSMPassiveWindow.h"
70 #include <boost/bind.hpp>
72 OSG_BEGIN_NAMESPACE
74 /***************************************************************************\
75 * Description *
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",
102 "CSMWindowPtr",
103 CSMPassiveWindow::getClassType(),
104 nsOSG);
105 #endif
107 OSG_FIELDTRAITS_GETTYPE_NS(CSMPassiveWindow *, nsOSG)
109 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
110 CSMPassiveWindow *,
111 nsOSG)
113 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
114 CSMPassiveWindow *,
115 nsOSG)
117 /***************************************************************************\
118 * Field Description *
119 \***************************************************************************/
121 void CSMPassiveWindowBase::classDescInserter(TypeObject &oType)
123 FieldDescriptionBase *pDesc = NULL;
126 pDesc = new SFVec2f::Description(
127 SFVec2f::getClassType(),
128 "viewportScale",
130 ViewportScaleFieldId, ViewportScaleFieldMask,
131 false,
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(),
140 "clearOp",
142 ClearOpFieldId, ClearOpFieldMask,
143 false,
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(),
155 "NULL",
156 nsOSG, //Namespace
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)),
162 false,
164 "<?xml version=\"1.0\"?>\n"
165 "\n"
166 "<FieldContainer\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"
178 ">\n"
179 "\t<Field\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"
186 "\t>\n"
187 "\t</Field>\n"
188 "\t<Field\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"
196 "\t>\n"
197 "\t</Field>\n"
198 "</FieldContainer>\n",
202 /*------------------------------ get -----------------------------------*/
204 FieldContainerType &CSMPassiveWindowBase::getType(void)
206 return _type;
209 const FieldContainerType &CSMPassiveWindowBase::getType(void) const
211 return _type;
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
238 return &_sfClearOp;
241 SFUnrecCSMPassiveWinClearOpPtr *CSMPassiveWindowBase::editSFClearOp (void)
243 editSField(ClearOpFieldMask);
245 return &_sfClearOp;
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();
282 return returnValue;
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);
330 return fc;
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);
346 return fc;
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;
363 return returnValue;
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;
384 return returnValue;
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;
398 return returnValue;
401 FieldContainerTransitPtr CSMPassiveWindowBase::shallowCopy(void) const
403 return shallowCopyLocal();
409 /*------------------------- constructors ----------------------------------*/
411 CSMPassiveWindowBase::CSMPassiveWindowBase(void) :
412 Inherited(),
413 _sfViewportScale (Vec2f(1.f, 1.f)),
414 _sfClearOp (NULL)
418 CSMPassiveWindowBase::CSMPassiveWindowBase(const CSMPassiveWindowBase &source) :
419 Inherited(source),
420 _sfViewportScale (source._sfViewportScale ),
421 _sfClearOp (NULL)
426 /*-------------------------- destructors ----------------------------------*/
428 CSMPassiveWindowBase::~CSMPassiveWindowBase(void)
432 void CSMPassiveWindowBase::onCreate(const CSMPassiveWindow *source)
434 Inherited::onCreate(source);
436 if(source != NULL)
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(
448 &_sfViewportScale,
449 this->getType().getFieldDesc(ViewportScaleFieldId),
450 const_cast<CSMPassiveWindowBase *>(this)));
452 return returnValue;
455 EditFieldHandlePtr CSMPassiveWindowBase::editHandleViewportScale (void)
457 SFVec2f::EditHandlePtr returnValue(
458 new SFVec2f::EditHandle(
459 &_sfViewportScale,
460 this->getType().getFieldDesc(ViewportScaleFieldId),
461 this));
464 editSField(ViewportScaleFieldMask);
466 return returnValue;
469 GetFieldHandlePtr CSMPassiveWindowBase::getHandleClearOp (void) const
471 SFUnrecCSMPassiveWinClearOpPtr::GetHandlePtr returnValue(
472 new SFUnrecCSMPassiveWinClearOpPtr::GetHandle(
473 &_sfClearOp,
474 this->getType().getFieldDesc(ClearOpFieldId),
475 const_cast<CSMPassiveWindowBase *>(this)));
477 return returnValue;
480 EditFieldHandlePtr CSMPassiveWindowBase::editHandleClearOp (void)
482 SFUnrecCSMPassiveWinClearOpPtr::EditHandlePtr returnValue(
483 new SFUnrecCSMPassiveWinClearOpPtr::EditHandle(
484 &_sfClearOp,
485 this->getType().getFieldDesc(ClearOpFieldId),
486 this));
488 returnValue->setSetMethod(
489 boost::bind(&CSMPassiveWindow::setClearOp,
490 static_cast<CSMPassiveWindow *>(this), _1));
492 editSField(ClearOpFieldMask);
494 return returnValue;
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),
508 whichField,
509 oOffsets,
510 syncMode,
511 uiSyncInfo);
513 #endif
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));
526 return returnValue;
528 #endif
530 void CSMPassiveWindowBase::resolveLinks(void)
532 Inherited::resolveLinks();
534 static_cast<CSMPassiveWindow *>(this)->setClearOp(NULL);
540 OSG_END_NAMESPACE