changed: gcc8 base update
[opensg.git] / Source / System / Window / Passive / OSGPassiveViewportBase.cpp
blobe3e0d4ba78a0e854937f295a7e62a659a182b1d6
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 PassiveViewport!
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 "OSGPassiveViewportBase.h"
67 #include "OSGPassiveViewport.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::PassiveViewport
78 The PassiveViewport does nothing itself, but expects OpenGL to be properly
79 configured when draw() or render() are called.
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
87 /***************************************************************************\
88 * FieldType/FieldTrait Instantiation *
89 \***************************************************************************/
91 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
92 PointerType FieldTraits<PassiveViewport *, nsOSG>::_type(
93 "PassiveViewportPtr",
94 "ViewportPtr",
95 PassiveViewport::getClassType(),
96 nsOSG);
97 #endif
99 OSG_FIELDTRAITS_GETTYPE_NS(PassiveViewport *, nsOSG)
101 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
102 PassiveViewport *,
103 nsOSG)
105 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
106 PassiveViewport *,
107 nsOSG)
109 /***************************************************************************\
110 * Field Description *
111 \***************************************************************************/
113 void PassiveViewportBase::classDescInserter(TypeObject &oType)
118 PassiveViewportBase::TypeObject PassiveViewportBase::_type(
119 PassiveViewportBase::getClassname(),
120 Inherited::getClassname(),
121 "NULL",
122 nsOSG, //Namespace
123 reinterpret_cast<PrototypeCreateF>(&PassiveViewportBase::createEmptyLocal),
124 reinterpret_cast<InitContainerF>(&PassiveViewport::initMethod),
125 reinterpret_cast<ExitContainerF>(&PassiveViewport::exitMethod),
126 reinterpret_cast<InitalInsertDescFunc>(
127 reinterpret_cast<void *>(&PassiveViewport::classDescInserter)),
128 false,
130 "<?xml version=\"1.0\"?>\n"
131 "\n"
132 "<FieldContainer\n"
133 " name=\"PassiveViewport\"\n"
134 " parent=\"Viewport\"\n"
135 " library=\"Window\"\n"
136 " pointerfieldtypes=\"both\"\n"
137 " structure=\"concrete\"\n"
138 " systemcomponent=\"true\"\n"
139 " parentsystemcomponent=\"true\"\n"
140 " decoratable=\"false\"\n"
141 " docGroupBase=\"GrpWindowPassive\"\n"
142 " >\n"
143 " The PassiveViewport does nothing itself, but expects OpenGL to be properly\n"
144 " configured when draw() or render() are called. \n"
145 "</FieldContainer>\n",
146 "The PassiveViewport does nothing itself, but expects OpenGL to be properly\n"
147 "configured when draw() or render() are called. \n"
150 /*------------------------------ get -----------------------------------*/
152 FieldContainerType &PassiveViewportBase::getType(void)
154 return _type;
157 const FieldContainerType &PassiveViewportBase::getType(void) const
159 return _type;
162 UInt32 PassiveViewportBase::getContainerSize(void) const
164 return sizeof(PassiveViewport);
167 /*------------------------- decorator get ------------------------------*/
174 /*------------------------------ access -----------------------------------*/
176 SizeT PassiveViewportBase::getBinSize(ConstFieldMaskArg whichField)
178 SizeT returnValue = Inherited::getBinSize(whichField);
181 return returnValue;
184 void PassiveViewportBase::copyToBin(BinaryDataHandler &pMem,
185 ConstFieldMaskArg whichField)
187 Inherited::copyToBin(pMem, whichField);
191 void PassiveViewportBase::copyFromBin(BinaryDataHandler &pMem,
192 ConstFieldMaskArg whichField)
194 Inherited::copyFromBin(pMem, whichField);
198 //! create a new instance of the class
199 PassiveViewportTransitPtr PassiveViewportBase::createLocal(BitVector bFlags)
201 PassiveViewportTransitPtr fc;
203 if(getClassType().getPrototype() != NULL)
205 FieldContainerTransitPtr tmpPtr =
206 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
208 fc = dynamic_pointer_cast<PassiveViewport>(tmpPtr);
211 return fc;
214 //! create a new instance of the class, copy the container flags
215 PassiveViewportTransitPtr PassiveViewportBase::createDependent(BitVector bFlags)
217 PassiveViewportTransitPtr fc;
219 if(getClassType().getPrototype() != NULL)
221 FieldContainerTransitPtr tmpPtr =
222 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
224 fc = dynamic_pointer_cast<PassiveViewport>(tmpPtr);
227 return fc;
230 //! create a new instance of the class
231 PassiveViewportTransitPtr PassiveViewportBase::create(void)
233 PassiveViewportTransitPtr fc;
235 if(getClassType().getPrototype() != NULL)
237 FieldContainerTransitPtr tmpPtr =
238 getClassType().getPrototype()-> shallowCopy();
240 fc = dynamic_pointer_cast<PassiveViewport>(tmpPtr);
243 return fc;
246 PassiveViewport *PassiveViewportBase::createEmptyLocal(BitVector bFlags)
248 PassiveViewport *returnValue;
250 newPtr<PassiveViewport>(returnValue, bFlags);
252 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
254 return returnValue;
257 //! create an empty new instance of the class, do not copy the prototype
258 PassiveViewport *PassiveViewportBase::createEmpty(void)
260 PassiveViewport *returnValue;
262 newPtr<PassiveViewport>(returnValue, Thread::getCurrentLocalFlags());
264 returnValue->_pFieldFlags->_bNamespaceMask &=
265 ~Thread::getCurrentLocalFlags();
267 return returnValue;
271 FieldContainerTransitPtr PassiveViewportBase::shallowCopyLocal(
272 BitVector bFlags) const
274 PassiveViewport *tmpPtr;
276 newPtr(tmpPtr, dynamic_cast<const PassiveViewport *>(this), bFlags);
278 FieldContainerTransitPtr returnValue(tmpPtr);
280 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
282 return returnValue;
285 FieldContainerTransitPtr PassiveViewportBase::shallowCopyDependent(
286 BitVector bFlags) const
288 PassiveViewport *tmpPtr;
290 newPtr(tmpPtr, dynamic_cast<const PassiveViewport *>(this), ~bFlags);
292 FieldContainerTransitPtr returnValue(tmpPtr);
294 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
296 return returnValue;
299 FieldContainerTransitPtr PassiveViewportBase::shallowCopy(void) const
301 PassiveViewport *tmpPtr;
303 newPtr(tmpPtr,
304 dynamic_cast<const PassiveViewport *>(this),
305 Thread::getCurrentLocalFlags());
307 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
309 FieldContainerTransitPtr returnValue(tmpPtr);
311 return returnValue;
317 /*------------------------- constructors ----------------------------------*/
319 PassiveViewportBase::PassiveViewportBase(void) :
320 Inherited()
324 PassiveViewportBase::PassiveViewportBase(const PassiveViewportBase &source) :
325 Inherited(source)
330 /*-------------------------- destructors ----------------------------------*/
332 PassiveViewportBase::~PassiveViewportBase(void)
338 #ifdef OSG_MT_CPTR_ASPECT
339 void PassiveViewportBase::execSyncV( FieldContainer &oFrom,
340 ConstFieldMaskArg whichField,
341 AspectOffsetStore &oOffsets,
342 ConstFieldMaskArg syncMode,
343 const UInt32 uiSyncInfo)
345 PassiveViewport *pThis = static_cast<PassiveViewport *>(this);
347 pThis->execSync(static_cast<PassiveViewport *>(&oFrom),
348 whichField,
349 oOffsets,
350 syncMode,
351 uiSyncInfo);
353 #endif
356 #ifdef OSG_MT_CPTR_ASPECT
357 FieldContainer *PassiveViewportBase::createAspectCopy(
358 const FieldContainer *pRefAspect) const
360 PassiveViewport *returnValue;
362 newAspectCopy(returnValue,
363 dynamic_cast<const PassiveViewport *>(pRefAspect),
364 dynamic_cast<const PassiveViewport *>(this));
366 return returnValue;
368 #endif
370 void PassiveViewportBase::resolveLinks(void)
372 Inherited::resolveLinks();
378 OSG_END_NAMESPACE