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 TrapezoidalShadowMapEngine!
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 "OSGTrapezoidalShadowMapEngineBase.h"
67 #include "OSGTrapezoidalShadowMapEngine.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
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(),
99 OSG_FIELDTRAITS_GETTYPE_NS(TrapezoidalShadowMapEngine
*, nsOSG
)
101 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
102 TrapezoidalShadowMapEngine
*,
105 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
106 TrapezoidalShadowMapEngine
*,
109 /***************************************************************************\
110 * Field Description *
111 \***************************************************************************/
113 void TrapezoidalShadowMapEngineBase::classDescInserter(TypeObject
&oType
)
118 TrapezoidalShadowMapEngineBase::TypeObject
TrapezoidalShadowMapEngineBase::_type(
119 TrapezoidalShadowMapEngineBase::getClassname(),
120 Inherited::getClassname(),
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
)),
130 "<?xml version=\"1.0\" ?>\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"
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)
156 const FieldContainerType
&TrapezoidalShadowMapEngineBase::getType(void) const
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
);
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
);
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
);
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
);
245 TrapezoidalShadowMapEngine
*TrapezoidalShadowMapEngineBase::createEmptyLocal(BitVector bFlags
)
247 TrapezoidalShadowMapEngine
*returnValue
;
249 newPtr
<TrapezoidalShadowMapEngine
>(returnValue
, bFlags
);
251 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
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();
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
;
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
;
298 FieldContainerTransitPtr
TrapezoidalShadowMapEngineBase::shallowCopy(void) const
300 TrapezoidalShadowMapEngine
*tmpPtr
;
303 dynamic_cast<const TrapezoidalShadowMapEngine
*>(this),
304 Thread::getCurrentLocalFlags());
306 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
308 FieldContainerTransitPtr
returnValue(tmpPtr
);
316 /*------------------------- constructors ----------------------------------*/
318 TrapezoidalShadowMapEngineBase::TrapezoidalShadowMapEngineBase(void) :
323 TrapezoidalShadowMapEngineBase::TrapezoidalShadowMapEngineBase(const TrapezoidalShadowMapEngineBase
&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
),
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));
369 void TrapezoidalShadowMapEngineBase::resolveLinks(void)
371 Inherited::resolveLinks();