fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComplexSceneManager / GLUT / OSGCSMGLUTWindowBase.cpp
blob912a09953e0b5fcea91c8289fe7335238def4b85
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 CSMGLUTWindow!
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 "OSGCSMGLUTWindowBase.h"
67 #include "OSGCSMGLUTWindow.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::CSMGLUTWindow
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
86 /***************************************************************************\
87 * FieldType/FieldTrait Instantiation *
88 \***************************************************************************/
90 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
91 PointerType FieldTraits<CSMGLUTWindow *, nsOSG>::_type(
92 "CSMGLUTWindowPtr",
93 "CSMWindowPtr",
94 CSMGLUTWindow::getClassType(),
95 nsOSG);
96 #endif
98 OSG_FIELDTRAITS_GETTYPE_NS(CSMGLUTWindow *, nsOSG)
100 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
101 CSMGLUTWindow *,
102 nsOSG)
104 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
105 CSMGLUTWindow *,
106 nsOSG)
108 /***************************************************************************\
109 * Field Description *
110 \***************************************************************************/
112 void CSMGLUTWindowBase::classDescInserter(TypeObject &oType)
117 CSMGLUTWindowBase::TypeObject CSMGLUTWindowBase::_type(
118 CSMGLUTWindowBase::getClassname(),
119 Inherited::getClassname(),
120 "NULL",
121 nsOSG, //Namespace
122 reinterpret_cast<PrototypeCreateF>(&CSMGLUTWindowBase::createEmptyLocal),
123 reinterpret_cast<InitContainerF>(&CSMGLUTWindow::initMethod),
124 reinterpret_cast<ExitContainerF>(&CSMGLUTWindow::exitMethod),
125 reinterpret_cast<InitalInsertDescFunc>(
126 reinterpret_cast<void *>(&CSMGLUTWindow::classDescInserter)),
127 false,
129 "<?xml version=\"1.0\"?>\n"
130 "\n"
131 "<FieldContainer\n"
132 " name=\"CSMGLUTWindow\"\n"
133 " parent=\"CSMWindow\"\n"
134 " library=\"ContribCSM\"\n"
135 " pointerfieldtypes=\"both\"\n"
136 " structure=\"concrete\"\n"
137 " systemcomponent=\"true\"\n"
138 " parentsystemcomponent=\"true\"\n"
139 " decoratable=\"false\"\n"
140 " useLocalIncludes=\"false\"\n"
141 " isNodeCore=\"false\"\n"
142 " isBundle=\"true\"\n"
143 ">\n"
144 "</FieldContainer>\n",
148 /*------------------------------ get -----------------------------------*/
150 FieldContainerType &CSMGLUTWindowBase::getType(void)
152 return _type;
155 const FieldContainerType &CSMGLUTWindowBase::getType(void) const
157 return _type;
160 UInt32 CSMGLUTWindowBase::getContainerSize(void) const
162 return sizeof(CSMGLUTWindow);
165 /*------------------------- decorator get ------------------------------*/
172 /*------------------------------ access -----------------------------------*/
174 SizeT CSMGLUTWindowBase::getBinSize(ConstFieldMaskArg whichField)
176 SizeT returnValue = Inherited::getBinSize(whichField);
179 return returnValue;
182 void CSMGLUTWindowBase::copyToBin(BinaryDataHandler &pMem,
183 ConstFieldMaskArg whichField)
185 Inherited::copyToBin(pMem, whichField);
189 void CSMGLUTWindowBase::copyFromBin(BinaryDataHandler &pMem,
190 ConstFieldMaskArg whichField)
192 Inherited::copyFromBin(pMem, whichField);
196 //! create a new instance of the class
197 CSMGLUTWindowTransitPtr CSMGLUTWindowBase::createLocal(BitVector bFlags)
199 CSMGLUTWindowTransitPtr fc;
201 if(getClassType().getPrototype() != NULL)
203 FieldContainerTransitPtr tmpPtr =
204 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
206 fc = dynamic_pointer_cast<CSMGLUTWindow>(tmpPtr);
209 return fc;
212 //! create a new instance of the class, copy the container flags
213 CSMGLUTWindowTransitPtr CSMGLUTWindowBase::createDependent(BitVector bFlags)
215 CSMGLUTWindowTransitPtr fc;
217 if(getClassType().getPrototype() != NULL)
219 FieldContainerTransitPtr tmpPtr =
220 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
222 fc = dynamic_pointer_cast<CSMGLUTWindow>(tmpPtr);
225 return fc;
228 //! create a new instance of the class
229 CSMGLUTWindowTransitPtr CSMGLUTWindowBase::create(void)
231 return createLocal();
234 CSMGLUTWindow *CSMGLUTWindowBase::createEmptyLocal(BitVector bFlags)
236 CSMGLUTWindow *returnValue;
238 newPtr<CSMGLUTWindow>(returnValue, bFlags);
240 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
242 return returnValue;
245 //! create an empty new instance of the class, do not copy the prototype
246 CSMGLUTWindow *CSMGLUTWindowBase::createEmpty(void)
248 return createEmptyLocal();
252 FieldContainerTransitPtr CSMGLUTWindowBase::shallowCopyLocal(
253 BitVector bFlags) const
255 CSMGLUTWindow *tmpPtr;
257 newPtr(tmpPtr, dynamic_cast<const CSMGLUTWindow *>(this), bFlags);
259 FieldContainerTransitPtr returnValue(tmpPtr);
261 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
263 return returnValue;
266 FieldContainerTransitPtr CSMGLUTWindowBase::shallowCopyDependent(
267 BitVector bFlags) const
269 CSMGLUTWindow *tmpPtr;
271 newPtr(tmpPtr, dynamic_cast<const CSMGLUTWindow *>(this), ~bFlags);
273 FieldContainerTransitPtr returnValue(tmpPtr);
275 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
277 return returnValue;
280 FieldContainerTransitPtr CSMGLUTWindowBase::shallowCopy(void) const
282 return shallowCopyLocal();
288 /*------------------------- constructors ----------------------------------*/
290 CSMGLUTWindowBase::CSMGLUTWindowBase(void) :
291 Inherited()
295 CSMGLUTWindowBase::CSMGLUTWindowBase(const CSMGLUTWindowBase &source) :
296 Inherited(source)
301 /*-------------------------- destructors ----------------------------------*/
303 CSMGLUTWindowBase::~CSMGLUTWindowBase(void)
309 #ifdef OSG_MT_CPTR_ASPECT
310 void CSMGLUTWindowBase::execSyncV( FieldContainer &oFrom,
311 ConstFieldMaskArg whichField,
312 AspectOffsetStore &oOffsets,
313 ConstFieldMaskArg syncMode,
314 const UInt32 uiSyncInfo)
316 CSMGLUTWindow *pThis = static_cast<CSMGLUTWindow *>(this);
318 pThis->execSync(static_cast<CSMGLUTWindow *>(&oFrom),
319 whichField,
320 oOffsets,
321 syncMode,
322 uiSyncInfo);
324 #endif
327 #ifdef OSG_MT_CPTR_ASPECT
328 FieldContainer *CSMGLUTWindowBase::createAspectCopy(
329 const FieldContainer *pRefAspect) const
331 CSMGLUTWindow *returnValue;
333 newAspectCopy(returnValue,
334 dynamic_cast<const CSMGLUTWindow *>(pRefAspect),
335 dynamic_cast<const CSMGLUTWindow *>(this));
337 return returnValue;
339 #endif
341 void CSMGLUTWindowBase::resolveLinks(void)
343 Inherited::resolveLinks();
349 OSG_END_NAMESPACE