changed: gcc8 base update
[opensg.git] / Source / Contrib / TrapezoidalShadowMaps / OSGTrapezoidalShadowMapEngineBase.cpp
blob1263c957d50987ce5a5b9d4bea404c8051bf0688
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 TrapezoidalShadowMapEngine!
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 "OSGTrapezoidalShadowMapEngineBase.h"
67 #include "OSGTrapezoidalShadowMapEngine.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::TrapezoidalShadowMapEngine
78 Implements Trapezoidal Shadow Maps.
79 See http://www.comp.nus.edu.sg/~tants/tsm.html for more information.
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
87 /***************************************************************************\
88 * FieldType/FieldTrait Instantiation *
89 \***************************************************************************/
91 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
92 PointerType FieldTraits<TrapezoidalShadowMapEngine *, nsOSG>::_type(
93 "TrapezoidalShadowMapEnginePtr",
94 "ShaderShadowMapEnginePtr",
95 TrapezoidalShadowMapEngine::getClassType(),
96 nsOSG);
97 #endif
99 OSG_FIELDTRAITS_GETTYPE_NS(TrapezoidalShadowMapEngine *, nsOSG)
101 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
102 TrapezoidalShadowMapEngine *,
103 nsOSG)
105 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
106 TrapezoidalShadowMapEngine *,
107 nsOSG)
109 /***************************************************************************\
110 * Field Description *
111 \***************************************************************************/
113 void TrapezoidalShadowMapEngineBase::classDescInserter(TypeObject &oType)
118 TrapezoidalShadowMapEngineBase::TypeObject TrapezoidalShadowMapEngineBase::_type(
119 TrapezoidalShadowMapEngineBase::getClassname(),
120 Inherited::getClassname(),
121 "NULL",
122 nsOSG, //Namespace
123 reinterpret_cast<PrototypeCreateF>(&TrapezoidalShadowMapEngineBase::createEmptyLocal),
124 reinterpret_cast<InitContainerF>(&TrapezoidalShadowMapEngine::initMethod),
125 reinterpret_cast<ExitContainerF>(&TrapezoidalShadowMapEngine::exitMethod),
126 reinterpret_cast<InitalInsertDescFunc>(
127 reinterpret_cast<void *>(&TrapezoidalShadowMapEngine::classDescInserter)),
128 false,
130 "<?xml version=\"1.0\" ?>\n"
131 "\n"
132 "<FieldContainer\n"
133 " name=\"TrapezoidalShadowMapEngine\"\n"
134 " parent=\"ShaderShadowMapEngine\"\n"
135 " library=\"ContribTrapezoidalShadowMaps\"\n"
136 " structure=\"concrete\"\n"
137 " pointerfieldtypes=\"both\"\n"
138 " systemcomponent=\"true\"\n"
139 " parentsystemcomponent=\"true\"\n"
140 " isNodeCore=\"false\"\n"
141 ">\n"
142 " Implements Trapezoidal Shadow Maps.\n"
143 " See http://www.comp.nus.edu.sg/~tants/tsm.html for more information.\n"
144 "</FieldContainer>\n",
145 "Implements Trapezoidal Shadow Maps.\n"
146 "See http://www.comp.nus.edu.sg/~tants/tsm.html for more information.\n"
149 /*------------------------------ get -----------------------------------*/
151 FieldContainerType &TrapezoidalShadowMapEngineBase::getType(void)
153 return _type;
156 const FieldContainerType &TrapezoidalShadowMapEngineBase::getType(void) const
158 return _type;
161 UInt32 TrapezoidalShadowMapEngineBase::getContainerSize(void) const
163 return sizeof(TrapezoidalShadowMapEngine);
166 /*------------------------- decorator get ------------------------------*/
173 /*------------------------------ access -----------------------------------*/
175 SizeT TrapezoidalShadowMapEngineBase::getBinSize(ConstFieldMaskArg whichField)
177 SizeT returnValue = Inherited::getBinSize(whichField);
180 return returnValue;
183 void TrapezoidalShadowMapEngineBase::copyToBin(BinaryDataHandler &pMem,
184 ConstFieldMaskArg whichField)
186 Inherited::copyToBin(pMem, whichField);
190 void TrapezoidalShadowMapEngineBase::copyFromBin(BinaryDataHandler &pMem,
191 ConstFieldMaskArg whichField)
193 Inherited::copyFromBin(pMem, whichField);
197 //! create a new instance of the class
198 TrapezoidalShadowMapEngineTransitPtr TrapezoidalShadowMapEngineBase::createLocal(BitVector bFlags)
200 TrapezoidalShadowMapEngineTransitPtr fc;
202 if(getClassType().getPrototype() != NULL)
204 FieldContainerTransitPtr tmpPtr =
205 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
207 fc = dynamic_pointer_cast<TrapezoidalShadowMapEngine>(tmpPtr);
210 return fc;
213 //! create a new instance of the class, copy the container flags
214 TrapezoidalShadowMapEngineTransitPtr TrapezoidalShadowMapEngineBase::createDependent(BitVector bFlags)
216 TrapezoidalShadowMapEngineTransitPtr fc;
218 if(getClassType().getPrototype() != NULL)
220 FieldContainerTransitPtr tmpPtr =
221 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
223 fc = dynamic_pointer_cast<TrapezoidalShadowMapEngine>(tmpPtr);
226 return fc;
229 //! create a new instance of the class
230 TrapezoidalShadowMapEngineTransitPtr TrapezoidalShadowMapEngineBase::create(void)
232 TrapezoidalShadowMapEngineTransitPtr fc;
234 if(getClassType().getPrototype() != NULL)
236 FieldContainerTransitPtr tmpPtr =
237 getClassType().getPrototype()-> shallowCopy();
239 fc = dynamic_pointer_cast<TrapezoidalShadowMapEngine>(tmpPtr);
242 return fc;
245 TrapezoidalShadowMapEngine *TrapezoidalShadowMapEngineBase::createEmptyLocal(BitVector bFlags)
247 TrapezoidalShadowMapEngine *returnValue;
249 newPtr<TrapezoidalShadowMapEngine>(returnValue, bFlags);
251 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
253 return returnValue;
256 //! create an empty new instance of the class, do not copy the prototype
257 TrapezoidalShadowMapEngine *TrapezoidalShadowMapEngineBase::createEmpty(void)
259 TrapezoidalShadowMapEngine *returnValue;
261 newPtr<TrapezoidalShadowMapEngine>(returnValue, Thread::getCurrentLocalFlags());
263 returnValue->_pFieldFlags->_bNamespaceMask &=
264 ~Thread::getCurrentLocalFlags();
266 return returnValue;
270 FieldContainerTransitPtr TrapezoidalShadowMapEngineBase::shallowCopyLocal(
271 BitVector bFlags) const
273 TrapezoidalShadowMapEngine *tmpPtr;
275 newPtr(tmpPtr, dynamic_cast<const TrapezoidalShadowMapEngine *>(this), bFlags);
277 FieldContainerTransitPtr returnValue(tmpPtr);
279 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
281 return returnValue;
284 FieldContainerTransitPtr TrapezoidalShadowMapEngineBase::shallowCopyDependent(
285 BitVector bFlags) const
287 TrapezoidalShadowMapEngine *tmpPtr;
289 newPtr(tmpPtr, dynamic_cast<const TrapezoidalShadowMapEngine *>(this), ~bFlags);
291 FieldContainerTransitPtr returnValue(tmpPtr);
293 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
295 return returnValue;
298 FieldContainerTransitPtr TrapezoidalShadowMapEngineBase::shallowCopy(void) const
300 TrapezoidalShadowMapEngine *tmpPtr;
302 newPtr(tmpPtr,
303 dynamic_cast<const TrapezoidalShadowMapEngine *>(this),
304 Thread::getCurrentLocalFlags());
306 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
308 FieldContainerTransitPtr returnValue(tmpPtr);
310 return returnValue;
316 /*------------------------- constructors ----------------------------------*/
318 TrapezoidalShadowMapEngineBase::TrapezoidalShadowMapEngineBase(void) :
319 Inherited()
323 TrapezoidalShadowMapEngineBase::TrapezoidalShadowMapEngineBase(const TrapezoidalShadowMapEngineBase &source) :
324 Inherited(source)
329 /*-------------------------- destructors ----------------------------------*/
331 TrapezoidalShadowMapEngineBase::~TrapezoidalShadowMapEngineBase(void)
337 #ifdef OSG_MT_CPTR_ASPECT
338 void TrapezoidalShadowMapEngineBase::execSyncV( FieldContainer &oFrom,
339 ConstFieldMaskArg whichField,
340 AspectOffsetStore &oOffsets,
341 ConstFieldMaskArg syncMode,
342 const UInt32 uiSyncInfo)
344 TrapezoidalShadowMapEngine *pThis = static_cast<TrapezoidalShadowMapEngine *>(this);
346 pThis->execSync(static_cast<TrapezoidalShadowMapEngine *>(&oFrom),
347 whichField,
348 oOffsets,
349 syncMode,
350 uiSyncInfo);
352 #endif
355 #ifdef OSG_MT_CPTR_ASPECT
356 FieldContainer *TrapezoidalShadowMapEngineBase::createAspectCopy(
357 const FieldContainer *pRefAspect) const
359 TrapezoidalShadowMapEngine *returnValue;
361 newAspectCopy(returnValue,
362 dynamic_cast<const TrapezoidalShadowMapEngine *>(pRefAspect),
363 dynamic_cast<const TrapezoidalShadowMapEngine *>(this));
365 return returnValue;
367 #endif
369 void TrapezoidalShadowMapEngineBase::resolveLinks(void)
371 Inherited::resolveLinks();
377 OSG_END_NAMESPACE