fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComplexSceneManagerQt / OSGCSMQT4WindowBase.cpp
blob176238760d37e86b89d58dde9a41189a50a09c0c
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 CSMQT4Window!
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"
66 #include "OSGCSMQT4WindowBase.h"
67 #include "OSGCSMQT4Window.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(
100 "CSMQT4WindowPtr",
101 "CSMWindowPtr",
102 CSMQT4Window::getClassType(),
103 nsOSG);
104 #endif
106 OSG_FIELDTRAITS_GETTYPE_NS(CSMQT4Window *, nsOSG)
108 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
109 CSMQT4Window *,
110 nsOSG)
112 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
113 CSMQT4Window *,
114 nsOSG)
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,
130 true,
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(),
139 "privateContext",
141 PrivateContextFieldId, PrivateContextFieldMask,
142 true,
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(),
154 "NULL",
155 nsOSG, //Namespace
156 reinterpret_cast<PrototypeCreateF>(&CSMQT4WindowBase::createEmptyLocal),
157 reinterpret_cast<InitContainerF>(&CSMQT4Window::initMethod),
158 reinterpret_cast<ExitContainerF>(&CSMQT4Window::exitMethod),
159 reinterpret_cast<InitalInsertDescFunc>(&CSMQT4Window::classDescInserter),
160 false,
162 "<?xml version=\"1.0\"?>\n"
163 "\n"
164 "<FieldContainer\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"
176 " >\n"
177 " <Field\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"
183 "\t >\n"
184 " </Field>\n"
185 " <Field\n"
186 "\t name=\"privateContext\"\n"
187 "\t type=\"bool\"\n"
188 "\t cardinality=\"single\"\n"
189 "\t visibility=\"internal\"\n"
190 "\t access=\"public\"\n"
191 " defaultValue=\"false\"\n"
192 "\t >\n"
193 " </Field>\n"
194 "</FieldContainer>\n",
198 /*------------------------------ get -----------------------------------*/
200 FieldContainerType &CSMQT4WindowBase::getType(void)
202 return _type;
205 const FieldContainerType &CSMQT4WindowBase::getType(void) const
207 return _type;
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();
263 return returnValue;
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);
311 return fc;
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);
327 return fc;
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;
344 return returnValue;
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;
365 return returnValue;
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;
379 return returnValue;
382 FieldContainerTransitPtr CSMQT4WindowBase::shallowCopy(void) const
384 return shallowCopyLocal();
390 /*------------------------- constructors ----------------------------------*/
392 CSMQT4WindowBase::CSMQT4WindowBase(void) :
393 Inherited(),
394 _sfPrimaryDisplayString (),
395 _sfPrivateContext (bool(false))
399 CSMQT4WindowBase::CSMQT4WindowBase(const CSMQT4WindowBase &source) :
400 Inherited(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)));
422 return returnValue;
425 EditFieldHandlePtr CSMQT4WindowBase::editHandlePrimaryDisplayString(void)
427 SFString::EditHandlePtr returnValue(
428 new SFString::EditHandle(
429 &_sfPrimaryDisplayString,
430 this->getType().getFieldDesc(PrimaryDisplayStringFieldId),
431 this));
434 editSField(PrimaryDisplayStringFieldMask);
436 return returnValue;
439 GetFieldHandlePtr CSMQT4WindowBase::getHandlePrivateContext (void) const
441 SFBool::GetHandlePtr returnValue(
442 new SFBool::GetHandle(
443 &_sfPrivateContext,
444 this->getType().getFieldDesc(PrivateContextFieldId),
445 const_cast<CSMQT4WindowBase *>(this)));
447 return returnValue;
450 EditFieldHandlePtr CSMQT4WindowBase::editHandlePrivateContext (void)
452 SFBool::EditHandlePtr returnValue(
453 new SFBool::EditHandle(
454 &_sfPrivateContext,
455 this->getType().getFieldDesc(PrivateContextFieldId),
456 this));
459 editSField(PrivateContextFieldMask);
461 return returnValue;
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),
475 whichField,
476 oOffsets,
477 syncMode,
478 uiSyncInfo);
480 #endif
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));
493 return returnValue;
495 #endif
497 void CSMQT4WindowBase::resolveLinks(void)
499 Inherited::resolveLinks();
505 OSG_END_NAMESPACE