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 PassiveViewport!
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"
66 #include "OSGPassiveViewportBase.h"
67 #include "OSGPassiveViewport.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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(
95 PassiveViewport::getClassType(),
99 OSG_FIELDTRAITS_GETTYPE_NS(PassiveViewport
*, nsOSG
)
101 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
105 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
109 /***************************************************************************\
110 * Field Description *
111 \***************************************************************************/
113 void PassiveViewportBase::classDescInserter(TypeObject
&oType
)
118 PassiveViewportBase::TypeObject
PassiveViewportBase::_type(
119 PassiveViewportBase::getClassname(),
120 Inherited::getClassname(),
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
)),
130 "<?xml version=\"1.0\"?>\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"
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)
157 const FieldContainerType
&PassiveViewportBase::getType(void) const
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
);
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
);
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
);
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
);
246 PassiveViewport
*PassiveViewportBase::createEmptyLocal(BitVector bFlags
)
248 PassiveViewport
*returnValue
;
250 newPtr
<PassiveViewport
>(returnValue
, bFlags
);
252 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
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();
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
;
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
;
299 FieldContainerTransitPtr
PassiveViewportBase::shallowCopy(void) const
301 PassiveViewport
*tmpPtr
;
304 dynamic_cast<const PassiveViewport
*>(this),
305 Thread::getCurrentLocalFlags());
307 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
309 FieldContainerTransitPtr
returnValue(tmpPtr
);
317 /*------------------------- constructors ----------------------------------*/
319 PassiveViewportBase::PassiveViewportBase(void) :
324 PassiveViewportBase::PassiveViewportBase(const PassiveViewportBase
&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
),
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));
370 void PassiveViewportBase::resolveLinks(void)
372 Inherited::resolveLinks();