fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Light / Shadow / Engines / OSGSimpleShadowMapEngineDataBase.cpp
blobc66894e701c1c93c221aed6be6443585cefd2fb3
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 SimpleShadowMapEngineData!
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"
65 #include "OSGCamera.h" // Camera Class
66 #include "OSGFrameBufferObject.h" // RenderTarget Class
67 #include "OSGTextureObjChunk.h" // TexChunk Class
68 #include "OSGTextureBuffer.h" // TexBuffer Class
69 #include "OSGLightChunk.h" // LightChunk Class
70 #include "OSGBlendChunk.h" // BlendChunk Class
71 #include "OSGTexGenChunk.h" // TexGenChunk Class
72 #include "OSGPolygonChunk.h" // PolyChunk Class
74 #include "OSGSimpleShadowMapEngineDataBase.h"
75 #include "OSGSimpleShadowMapEngineData.h"
77 #include <boost/bind.hpp>
79 OSG_BEGIN_NAMESPACE
81 /***************************************************************************\
82 * Description *
83 \***************************************************************************/
85 /*! \class OSG::SimpleShadowMapEngineData
86 Data use for rendering by the SimpleShadowmap stage
89 /***************************************************************************\
90 * Field Documentation *
91 \***************************************************************************/
93 /*! \var Camera * SimpleShadowMapEngineDataBase::_sfCamera
97 /*! \var FrameBufferObject * SimpleShadowMapEngineDataBase::_sfRenderTarget
101 /*! \var TextureObjChunk * SimpleShadowMapEngineDataBase::_sfTexChunk
105 /*! \var TextureBuffer * SimpleShadowMapEngineDataBase::_sfTexBuffer
109 /*! \var LightChunk * SimpleShadowMapEngineDataBase::_sfLightChunk
113 /*! \var BlendChunk * SimpleShadowMapEngineDataBase::_sfBlendChunk
117 /*! \var TexGenChunk * SimpleShadowMapEngineDataBase::_sfTexGenChunk
121 /*! \var PolygonChunk * SimpleShadowMapEngineDataBase::_sfPolyChunk
126 /***************************************************************************\
127 * FieldType/FieldTrait Instantiation *
128 \***************************************************************************/
130 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
131 PointerType FieldTraits<SimpleShadowMapEngineData *, nsOSG>::_type(
132 "SimpleShadowMapEngineDataPtr",
133 "StageDataPtr",
134 SimpleShadowMapEngineData::getClassType(),
135 nsOSG);
136 #endif
138 OSG_FIELDTRAITS_GETTYPE_NS(SimpleShadowMapEngineData *, nsOSG)
140 /***************************************************************************\
141 * Field Description *
142 \***************************************************************************/
144 void SimpleShadowMapEngineDataBase::classDescInserter(TypeObject &oType)
146 FieldDescriptionBase *pDesc = NULL;
149 pDesc = new SFUnrecCameraPtr::Description(
150 SFUnrecCameraPtr::getClassType(),
151 "camera",
153 CameraFieldId, CameraFieldMask,
154 false,
155 (Field::SFDefaultFlags | Field::FStdAccess),
156 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleCamera),
157 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleCamera));
159 oType.addInitialDesc(pDesc);
161 pDesc = new SFUnrecFrameBufferObjectPtr::Description(
162 SFUnrecFrameBufferObjectPtr::getClassType(),
163 "renderTarget",
165 RenderTargetFieldId, RenderTargetFieldMask,
166 false,
167 (Field::SFDefaultFlags | Field::FStdAccess),
168 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleRenderTarget),
169 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleRenderTarget));
171 oType.addInitialDesc(pDesc);
173 pDesc = new SFUnrecTextureObjChunkPtr::Description(
174 SFUnrecTextureObjChunkPtr::getClassType(),
175 "texChunk",
177 TexChunkFieldId, TexChunkFieldMask,
178 false,
179 (Field::SFDefaultFlags | Field::FStdAccess),
180 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleTexChunk),
181 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleTexChunk));
183 oType.addInitialDesc(pDesc);
185 pDesc = new SFUnrecTextureBufferPtr::Description(
186 SFUnrecTextureBufferPtr::getClassType(),
187 "texBuffer",
189 TexBufferFieldId, TexBufferFieldMask,
190 false,
191 (Field::SFDefaultFlags | Field::FStdAccess),
192 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleTexBuffer),
193 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleTexBuffer));
195 oType.addInitialDesc(pDesc);
197 pDesc = new SFUnrecLightChunkPtr::Description(
198 SFUnrecLightChunkPtr::getClassType(),
199 "lightChunk",
201 LightChunkFieldId, LightChunkFieldMask,
202 false,
203 (Field::SFDefaultFlags | Field::FStdAccess),
204 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleLightChunk),
205 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleLightChunk));
207 oType.addInitialDesc(pDesc);
209 pDesc = new SFUnrecBlendChunkPtr::Description(
210 SFUnrecBlendChunkPtr::getClassType(),
211 "blendChunk",
213 BlendChunkFieldId, BlendChunkFieldMask,
214 false,
215 (Field::SFDefaultFlags | Field::FStdAccess),
216 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleBlendChunk),
217 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleBlendChunk));
219 oType.addInitialDesc(pDesc);
221 pDesc = new SFUnrecTexGenChunkPtr::Description(
222 SFUnrecTexGenChunkPtr::getClassType(),
223 "texGenChunk",
225 TexGenChunkFieldId, TexGenChunkFieldMask,
226 false,
227 (Field::SFDefaultFlags | Field::FStdAccess),
228 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandleTexGenChunk),
229 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandleTexGenChunk));
231 oType.addInitialDesc(pDesc);
233 pDesc = new SFUnrecPolygonChunkPtr::Description(
234 SFUnrecPolygonChunkPtr::getClassType(),
235 "polyChunk",
237 PolyChunkFieldId, PolyChunkFieldMask,
238 false,
239 (Field::SFDefaultFlags | Field::FStdAccess),
240 static_cast<FieldEditMethodSig>(&SimpleShadowMapEngineData::editHandlePolyChunk),
241 static_cast<FieldGetMethodSig >(&SimpleShadowMapEngineData::getHandlePolyChunk));
243 oType.addInitialDesc(pDesc);
247 SimpleShadowMapEngineDataBase::TypeObject SimpleShadowMapEngineDataBase::_type(
248 SimpleShadowMapEngineDataBase::getClassname(),
249 Inherited::getClassname(),
250 "NULL",
251 nsOSG, //Namespace
252 reinterpret_cast<PrototypeCreateF>(&SimpleShadowMapEngineDataBase::createEmptyLocal),
253 reinterpret_cast<InitContainerF>(&SimpleShadowMapEngineData::initMethod),
254 reinterpret_cast<ExitContainerF>(&SimpleShadowMapEngineData::exitMethod),
255 reinterpret_cast<InitalInsertDescFunc>(
256 reinterpret_cast<void *>(&SimpleShadowMapEngineData::classDescInserter)),
257 false,
259 "<?xml version=\"1.0\"?>\n"
260 "\n"
261 "<FieldContainer\n"
262 " name=\"SimpleShadowMapEngineData\"\n"
263 " parent=\"StageData\"\n"
264 " library=\"Group\"\n"
265 " pointerfieldtypes=\"none\"\n"
266 " structure=\"concrete\"\n"
267 " systemcomponent=\"true\"\n"
268 " parentsystemcomponent=\"true\"\n"
269 " decoratable=\"false\"\n"
270 " useLocalIncludes=\"false\"\n"
271 " isNodeCore=\"false\"\n"
272 " isBundle=\"true\"\n"
273 " docGroupBase=\"GrpGroupLightShadowEngines\"\n"
274 " >\n"
275 " Data use for rendering by the SimpleShadowmap stage\n"
276 " <Field\n"
277 "\t name=\"camera\"\n"
278 "\t type=\"CameraPtr\"\n"
279 "\t cardinality=\"single\"\n"
280 "\t visibility=\"external\"\n"
281 "\t defaultValue=\"NULL\"\n"
282 "\t access=\"public\"\n"
283 "\t >\n"
284 " </Field>\n"
285 " <Field\n"
286 " name=\"renderTarget\"\n"
287 " category=\"pointer\"\n"
288 " type=\"FrameBufferObject\"\n"
289 " cardinality=\"single\"\n"
290 " visibility=\"external\"\n"
291 " defaultValue=\"NULL\"\n"
292 " access=\"public\"\n"
293 " >\n"
294 " </Field>\n"
295 " <Field\n"
296 "\t name=\"texChunk\"\n"
297 "\t type=\"TextureObjChunkPtr\"\n"
298 "\t cardinality=\"single\"\n"
299 "\t visibility=\"external\"\n"
300 "\t defaultValue=\"NULL\"\n"
301 "\t access=\"public\"\n"
302 "\t >\n"
303 " </Field>\n"
304 " <Field\n"
305 "\t name=\"texBuffer\"\n"
306 "\t type=\"TextureBufferPtr\"\n"
307 "\t cardinality=\"single\"\n"
308 "\t visibility=\"external\"\n"
309 "\t defaultValue=\"NULL\"\n"
310 "\t access=\"public\"\n"
311 "\t >\n"
312 " </Field>\n"
313 " <Field\n"
314 "\t name=\"lightChunk\"\n"
315 "\t type=\"LightChunkPtr\"\n"
316 "\t cardinality=\"single\"\n"
317 "\t visibility=\"external\"\n"
318 "\t defaultValue=\"NULL\"\n"
319 "\t access=\"public\"\n"
320 "\t >\n"
321 " </Field>\n"
322 " <Field\n"
323 "\t name=\"blendChunk\"\n"
324 "\t type=\"BlendChunkPtr\"\n"
325 "\t cardinality=\"single\"\n"
326 "\t visibility=\"external\"\n"
327 "\t defaultValue=\"NULL\"\n"
328 "\t access=\"public\"\n"
329 "\t >\n"
330 " </Field>\n"
331 " <Field\n"
332 "\t name=\"texGenChunk\"\n"
333 "\t type=\"TexGenChunkPtr\"\n"
334 "\t cardinality=\"single\"\n"
335 "\t visibility=\"external\"\n"
336 "\t defaultValue=\"NULL\"\n"
337 "\t access=\"public\"\n"
338 "\t >\n"
339 " </Field>\n"
340 " <Field\n"
341 "\t name=\"polyChunk\"\n"
342 "\t type=\"PolygonChunkPtr\"\n"
343 "\t cardinality=\"single\"\n"
344 "\t visibility=\"external\"\n"
345 "\t defaultValue=\"NULL\"\n"
346 "\t access=\"public\"\n"
347 "\t >\n"
348 " </Field>\n"
349 "</FieldContainer>\n",
350 "Data use for rendering by the SimpleShadowmap stage\n"
353 /*------------------------------ get -----------------------------------*/
355 FieldContainerType &SimpleShadowMapEngineDataBase::getType(void)
357 return _type;
360 const FieldContainerType &SimpleShadowMapEngineDataBase::getType(void) const
362 return _type;
365 UInt32 SimpleShadowMapEngineDataBase::getContainerSize(void) const
367 return sizeof(SimpleShadowMapEngineData);
370 /*------------------------- decorator get ------------------------------*/
373 //! Get the SimpleShadowMapEngineData::_sfCamera field.
374 const SFUnrecCameraPtr *SimpleShadowMapEngineDataBase::getSFCamera(void) const
376 return &_sfCamera;
379 SFUnrecCameraPtr *SimpleShadowMapEngineDataBase::editSFCamera (void)
381 editSField(CameraFieldMask);
383 return &_sfCamera;
386 //! Get the value of the SimpleShadowMapEngineData::_sfCamera field.
387 Camera * SimpleShadowMapEngineDataBase::getCamera(void) const
389 return _sfCamera.getValue();
392 //! Set the value of the SimpleShadowMapEngineData::_sfCamera field.
393 void SimpleShadowMapEngineDataBase::setCamera(Camera * const value)
395 editSField(CameraFieldMask);
397 _sfCamera.setValue(value);
401 //! Get the SimpleShadowMapEngineData::_sfRenderTarget field.
402 const SFUnrecFrameBufferObjectPtr *SimpleShadowMapEngineDataBase::getSFRenderTarget(void) const
404 return &_sfRenderTarget;
407 SFUnrecFrameBufferObjectPtr *SimpleShadowMapEngineDataBase::editSFRenderTarget (void)
409 editSField(RenderTargetFieldMask);
411 return &_sfRenderTarget;
414 //! Get the value of the SimpleShadowMapEngineData::_sfRenderTarget field.
415 FrameBufferObject * SimpleShadowMapEngineDataBase::getRenderTarget(void) const
417 return _sfRenderTarget.getValue();
420 //! Set the value of the SimpleShadowMapEngineData::_sfRenderTarget field.
421 void SimpleShadowMapEngineDataBase::setRenderTarget(FrameBufferObject * const value)
423 editSField(RenderTargetFieldMask);
425 _sfRenderTarget.setValue(value);
429 //! Get the SimpleShadowMapEngineData::_sfTexChunk field.
430 const SFUnrecTextureObjChunkPtr *SimpleShadowMapEngineDataBase::getSFTexChunk(void) const
432 return &_sfTexChunk;
435 SFUnrecTextureObjChunkPtr *SimpleShadowMapEngineDataBase::editSFTexChunk (void)
437 editSField(TexChunkFieldMask);
439 return &_sfTexChunk;
442 //! Get the value of the SimpleShadowMapEngineData::_sfTexChunk field.
443 TextureObjChunk * SimpleShadowMapEngineDataBase::getTexChunk(void) const
445 return _sfTexChunk.getValue();
448 //! Set the value of the SimpleShadowMapEngineData::_sfTexChunk field.
449 void SimpleShadowMapEngineDataBase::setTexChunk(TextureObjChunk * const value)
451 editSField(TexChunkFieldMask);
453 _sfTexChunk.setValue(value);
457 //! Get the SimpleShadowMapEngineData::_sfTexBuffer field.
458 const SFUnrecTextureBufferPtr *SimpleShadowMapEngineDataBase::getSFTexBuffer(void) const
460 return &_sfTexBuffer;
463 SFUnrecTextureBufferPtr *SimpleShadowMapEngineDataBase::editSFTexBuffer (void)
465 editSField(TexBufferFieldMask);
467 return &_sfTexBuffer;
470 //! Get the value of the SimpleShadowMapEngineData::_sfTexBuffer field.
471 TextureBuffer * SimpleShadowMapEngineDataBase::getTexBuffer(void) const
473 return _sfTexBuffer.getValue();
476 //! Set the value of the SimpleShadowMapEngineData::_sfTexBuffer field.
477 void SimpleShadowMapEngineDataBase::setTexBuffer(TextureBuffer * const value)
479 editSField(TexBufferFieldMask);
481 _sfTexBuffer.setValue(value);
485 //! Get the SimpleShadowMapEngineData::_sfLightChunk field.
486 const SFUnrecLightChunkPtr *SimpleShadowMapEngineDataBase::getSFLightChunk(void) const
488 return &_sfLightChunk;
491 SFUnrecLightChunkPtr *SimpleShadowMapEngineDataBase::editSFLightChunk (void)
493 editSField(LightChunkFieldMask);
495 return &_sfLightChunk;
498 //! Get the value of the SimpleShadowMapEngineData::_sfLightChunk field.
499 LightChunk * SimpleShadowMapEngineDataBase::getLightChunk(void) const
501 return _sfLightChunk.getValue();
504 //! Set the value of the SimpleShadowMapEngineData::_sfLightChunk field.
505 void SimpleShadowMapEngineDataBase::setLightChunk(LightChunk * const value)
507 editSField(LightChunkFieldMask);
509 _sfLightChunk.setValue(value);
513 //! Get the SimpleShadowMapEngineData::_sfBlendChunk field.
514 const SFUnrecBlendChunkPtr *SimpleShadowMapEngineDataBase::getSFBlendChunk(void) const
516 return &_sfBlendChunk;
519 SFUnrecBlendChunkPtr *SimpleShadowMapEngineDataBase::editSFBlendChunk (void)
521 editSField(BlendChunkFieldMask);
523 return &_sfBlendChunk;
526 //! Get the value of the SimpleShadowMapEngineData::_sfBlendChunk field.
527 BlendChunk * SimpleShadowMapEngineDataBase::getBlendChunk(void) const
529 return _sfBlendChunk.getValue();
532 //! Set the value of the SimpleShadowMapEngineData::_sfBlendChunk field.
533 void SimpleShadowMapEngineDataBase::setBlendChunk(BlendChunk * const value)
535 editSField(BlendChunkFieldMask);
537 _sfBlendChunk.setValue(value);
541 //! Get the SimpleShadowMapEngineData::_sfTexGenChunk field.
542 const SFUnrecTexGenChunkPtr *SimpleShadowMapEngineDataBase::getSFTexGenChunk(void) const
544 return &_sfTexGenChunk;
547 SFUnrecTexGenChunkPtr *SimpleShadowMapEngineDataBase::editSFTexGenChunk (void)
549 editSField(TexGenChunkFieldMask);
551 return &_sfTexGenChunk;
554 //! Get the value of the SimpleShadowMapEngineData::_sfTexGenChunk field.
555 TexGenChunk * SimpleShadowMapEngineDataBase::getTexGenChunk(void) const
557 return _sfTexGenChunk.getValue();
560 //! Set the value of the SimpleShadowMapEngineData::_sfTexGenChunk field.
561 void SimpleShadowMapEngineDataBase::setTexGenChunk(TexGenChunk * const value)
563 editSField(TexGenChunkFieldMask);
565 _sfTexGenChunk.setValue(value);
569 //! Get the SimpleShadowMapEngineData::_sfPolyChunk field.
570 const SFUnrecPolygonChunkPtr *SimpleShadowMapEngineDataBase::getSFPolyChunk(void) const
572 return &_sfPolyChunk;
575 SFUnrecPolygonChunkPtr *SimpleShadowMapEngineDataBase::editSFPolyChunk (void)
577 editSField(PolyChunkFieldMask);
579 return &_sfPolyChunk;
582 //! Get the value of the SimpleShadowMapEngineData::_sfPolyChunk field.
583 PolygonChunk * SimpleShadowMapEngineDataBase::getPolyChunk(void) const
585 return _sfPolyChunk.getValue();
588 //! Set the value of the SimpleShadowMapEngineData::_sfPolyChunk field.
589 void SimpleShadowMapEngineDataBase::setPolyChunk(PolygonChunk * const value)
591 editSField(PolyChunkFieldMask);
593 _sfPolyChunk.setValue(value);
601 /*------------------------------ access -----------------------------------*/
603 SizeT SimpleShadowMapEngineDataBase::getBinSize(ConstFieldMaskArg whichField)
605 SizeT returnValue = Inherited::getBinSize(whichField);
607 if(FieldBits::NoField != (CameraFieldMask & whichField))
609 returnValue += _sfCamera.getBinSize();
611 if(FieldBits::NoField != (RenderTargetFieldMask & whichField))
613 returnValue += _sfRenderTarget.getBinSize();
615 if(FieldBits::NoField != (TexChunkFieldMask & whichField))
617 returnValue += _sfTexChunk.getBinSize();
619 if(FieldBits::NoField != (TexBufferFieldMask & whichField))
621 returnValue += _sfTexBuffer.getBinSize();
623 if(FieldBits::NoField != (LightChunkFieldMask & whichField))
625 returnValue += _sfLightChunk.getBinSize();
627 if(FieldBits::NoField != (BlendChunkFieldMask & whichField))
629 returnValue += _sfBlendChunk.getBinSize();
631 if(FieldBits::NoField != (TexGenChunkFieldMask & whichField))
633 returnValue += _sfTexGenChunk.getBinSize();
635 if(FieldBits::NoField != (PolyChunkFieldMask & whichField))
637 returnValue += _sfPolyChunk.getBinSize();
640 return returnValue;
643 void SimpleShadowMapEngineDataBase::copyToBin(BinaryDataHandler &pMem,
644 ConstFieldMaskArg whichField)
646 Inherited::copyToBin(pMem, whichField);
648 if(FieldBits::NoField != (CameraFieldMask & whichField))
650 _sfCamera.copyToBin(pMem);
652 if(FieldBits::NoField != (RenderTargetFieldMask & whichField))
654 _sfRenderTarget.copyToBin(pMem);
656 if(FieldBits::NoField != (TexChunkFieldMask & whichField))
658 _sfTexChunk.copyToBin(pMem);
660 if(FieldBits::NoField != (TexBufferFieldMask & whichField))
662 _sfTexBuffer.copyToBin(pMem);
664 if(FieldBits::NoField != (LightChunkFieldMask & whichField))
666 _sfLightChunk.copyToBin(pMem);
668 if(FieldBits::NoField != (BlendChunkFieldMask & whichField))
670 _sfBlendChunk.copyToBin(pMem);
672 if(FieldBits::NoField != (TexGenChunkFieldMask & whichField))
674 _sfTexGenChunk.copyToBin(pMem);
676 if(FieldBits::NoField != (PolyChunkFieldMask & whichField))
678 _sfPolyChunk.copyToBin(pMem);
682 void SimpleShadowMapEngineDataBase::copyFromBin(BinaryDataHandler &pMem,
683 ConstFieldMaskArg whichField)
685 Inherited::copyFromBin(pMem, whichField);
687 if(FieldBits::NoField != (CameraFieldMask & whichField))
689 editSField(CameraFieldMask);
690 _sfCamera.copyFromBin(pMem);
692 if(FieldBits::NoField != (RenderTargetFieldMask & whichField))
694 editSField(RenderTargetFieldMask);
695 _sfRenderTarget.copyFromBin(pMem);
697 if(FieldBits::NoField != (TexChunkFieldMask & whichField))
699 editSField(TexChunkFieldMask);
700 _sfTexChunk.copyFromBin(pMem);
702 if(FieldBits::NoField != (TexBufferFieldMask & whichField))
704 editSField(TexBufferFieldMask);
705 _sfTexBuffer.copyFromBin(pMem);
707 if(FieldBits::NoField != (LightChunkFieldMask & whichField))
709 editSField(LightChunkFieldMask);
710 _sfLightChunk.copyFromBin(pMem);
712 if(FieldBits::NoField != (BlendChunkFieldMask & whichField))
714 editSField(BlendChunkFieldMask);
715 _sfBlendChunk.copyFromBin(pMem);
717 if(FieldBits::NoField != (TexGenChunkFieldMask & whichField))
719 editSField(TexGenChunkFieldMask);
720 _sfTexGenChunk.copyFromBin(pMem);
722 if(FieldBits::NoField != (PolyChunkFieldMask & whichField))
724 editSField(PolyChunkFieldMask);
725 _sfPolyChunk.copyFromBin(pMem);
729 //! create a new instance of the class
730 SimpleShadowMapEngineDataTransitPtr SimpleShadowMapEngineDataBase::createLocal(BitVector bFlags)
732 SimpleShadowMapEngineDataTransitPtr fc;
734 if(getClassType().getPrototype() != NULL)
736 FieldContainerTransitPtr tmpPtr =
737 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
739 fc = dynamic_pointer_cast<SimpleShadowMapEngineData>(tmpPtr);
742 return fc;
745 //! create a new instance of the class, copy the container flags
746 SimpleShadowMapEngineDataTransitPtr SimpleShadowMapEngineDataBase::createDependent(BitVector bFlags)
748 SimpleShadowMapEngineDataTransitPtr fc;
750 if(getClassType().getPrototype() != NULL)
752 FieldContainerTransitPtr tmpPtr =
753 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
755 fc = dynamic_pointer_cast<SimpleShadowMapEngineData>(tmpPtr);
758 return fc;
761 //! create a new instance of the class
762 SimpleShadowMapEngineDataTransitPtr SimpleShadowMapEngineDataBase::create(void)
764 return createLocal();
767 SimpleShadowMapEngineData *SimpleShadowMapEngineDataBase::createEmptyLocal(BitVector bFlags)
769 SimpleShadowMapEngineData *returnValue;
771 newPtr<SimpleShadowMapEngineData>(returnValue, bFlags);
773 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
775 return returnValue;
778 //! create an empty new instance of the class, do not copy the prototype
779 SimpleShadowMapEngineData *SimpleShadowMapEngineDataBase::createEmpty(void)
781 return createEmptyLocal();
785 FieldContainerTransitPtr SimpleShadowMapEngineDataBase::shallowCopyLocal(
786 BitVector bFlags) const
788 SimpleShadowMapEngineData *tmpPtr;
790 newPtr(tmpPtr, dynamic_cast<const SimpleShadowMapEngineData *>(this), bFlags);
792 FieldContainerTransitPtr returnValue(tmpPtr);
794 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
796 return returnValue;
799 FieldContainerTransitPtr SimpleShadowMapEngineDataBase::shallowCopyDependent(
800 BitVector bFlags) const
802 SimpleShadowMapEngineData *tmpPtr;
804 newPtr(tmpPtr, dynamic_cast<const SimpleShadowMapEngineData *>(this), ~bFlags);
806 FieldContainerTransitPtr returnValue(tmpPtr);
808 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
810 return returnValue;
813 FieldContainerTransitPtr SimpleShadowMapEngineDataBase::shallowCopy(void) const
815 return shallowCopyLocal();
821 /*------------------------- constructors ----------------------------------*/
823 SimpleShadowMapEngineDataBase::SimpleShadowMapEngineDataBase(void) :
824 Inherited(),
825 _sfCamera (NULL),
826 _sfRenderTarget (NULL),
827 _sfTexChunk (NULL),
828 _sfTexBuffer (NULL),
829 _sfLightChunk (NULL),
830 _sfBlendChunk (NULL),
831 _sfTexGenChunk (NULL),
832 _sfPolyChunk (NULL)
836 SimpleShadowMapEngineDataBase::SimpleShadowMapEngineDataBase(const SimpleShadowMapEngineDataBase &source) :
837 Inherited(source),
838 _sfCamera (NULL),
839 _sfRenderTarget (NULL),
840 _sfTexChunk (NULL),
841 _sfTexBuffer (NULL),
842 _sfLightChunk (NULL),
843 _sfBlendChunk (NULL),
844 _sfTexGenChunk (NULL),
845 _sfPolyChunk (NULL)
850 /*-------------------------- destructors ----------------------------------*/
852 SimpleShadowMapEngineDataBase::~SimpleShadowMapEngineDataBase(void)
856 void SimpleShadowMapEngineDataBase::onCreate(const SimpleShadowMapEngineData *source)
858 Inherited::onCreate(source);
860 if(source != NULL)
862 SimpleShadowMapEngineData *pThis = static_cast<SimpleShadowMapEngineData *>(this);
864 pThis->setCamera(source->getCamera());
866 pThis->setRenderTarget(source->getRenderTarget());
868 pThis->setTexChunk(source->getTexChunk());
870 pThis->setTexBuffer(source->getTexBuffer());
872 pThis->setLightChunk(source->getLightChunk());
874 pThis->setBlendChunk(source->getBlendChunk());
876 pThis->setTexGenChunk(source->getTexGenChunk());
878 pThis->setPolyChunk(source->getPolyChunk());
882 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleCamera (void) const
884 SFUnrecCameraPtr::GetHandlePtr returnValue(
885 new SFUnrecCameraPtr::GetHandle(
886 &_sfCamera,
887 this->getType().getFieldDesc(CameraFieldId),
888 const_cast<SimpleShadowMapEngineDataBase *>(this)));
890 return returnValue;
893 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleCamera (void)
895 SFUnrecCameraPtr::EditHandlePtr returnValue(
896 new SFUnrecCameraPtr::EditHandle(
897 &_sfCamera,
898 this->getType().getFieldDesc(CameraFieldId),
899 this));
901 returnValue->setSetMethod(
902 boost::bind(&SimpleShadowMapEngineData::setCamera,
903 static_cast<SimpleShadowMapEngineData *>(this), _1));
905 editSField(CameraFieldMask);
907 return returnValue;
910 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleRenderTarget (void) const
912 SFUnrecFrameBufferObjectPtr::GetHandlePtr returnValue(
913 new SFUnrecFrameBufferObjectPtr::GetHandle(
914 &_sfRenderTarget,
915 this->getType().getFieldDesc(RenderTargetFieldId),
916 const_cast<SimpleShadowMapEngineDataBase *>(this)));
918 return returnValue;
921 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleRenderTarget (void)
923 SFUnrecFrameBufferObjectPtr::EditHandlePtr returnValue(
924 new SFUnrecFrameBufferObjectPtr::EditHandle(
925 &_sfRenderTarget,
926 this->getType().getFieldDesc(RenderTargetFieldId),
927 this));
929 returnValue->setSetMethod(
930 boost::bind(&SimpleShadowMapEngineData::setRenderTarget,
931 static_cast<SimpleShadowMapEngineData *>(this), _1));
933 editSField(RenderTargetFieldMask);
935 return returnValue;
938 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleTexChunk (void) const
940 SFUnrecTextureObjChunkPtr::GetHandlePtr returnValue(
941 new SFUnrecTextureObjChunkPtr::GetHandle(
942 &_sfTexChunk,
943 this->getType().getFieldDesc(TexChunkFieldId),
944 const_cast<SimpleShadowMapEngineDataBase *>(this)));
946 return returnValue;
949 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleTexChunk (void)
951 SFUnrecTextureObjChunkPtr::EditHandlePtr returnValue(
952 new SFUnrecTextureObjChunkPtr::EditHandle(
953 &_sfTexChunk,
954 this->getType().getFieldDesc(TexChunkFieldId),
955 this));
957 returnValue->setSetMethod(
958 boost::bind(&SimpleShadowMapEngineData::setTexChunk,
959 static_cast<SimpleShadowMapEngineData *>(this), _1));
961 editSField(TexChunkFieldMask);
963 return returnValue;
966 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleTexBuffer (void) const
968 SFUnrecTextureBufferPtr::GetHandlePtr returnValue(
969 new SFUnrecTextureBufferPtr::GetHandle(
970 &_sfTexBuffer,
971 this->getType().getFieldDesc(TexBufferFieldId),
972 const_cast<SimpleShadowMapEngineDataBase *>(this)));
974 return returnValue;
977 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleTexBuffer (void)
979 SFUnrecTextureBufferPtr::EditHandlePtr returnValue(
980 new SFUnrecTextureBufferPtr::EditHandle(
981 &_sfTexBuffer,
982 this->getType().getFieldDesc(TexBufferFieldId),
983 this));
985 returnValue->setSetMethod(
986 boost::bind(&SimpleShadowMapEngineData::setTexBuffer,
987 static_cast<SimpleShadowMapEngineData *>(this), _1));
989 editSField(TexBufferFieldMask);
991 return returnValue;
994 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleLightChunk (void) const
996 SFUnrecLightChunkPtr::GetHandlePtr returnValue(
997 new SFUnrecLightChunkPtr::GetHandle(
998 &_sfLightChunk,
999 this->getType().getFieldDesc(LightChunkFieldId),
1000 const_cast<SimpleShadowMapEngineDataBase *>(this)));
1002 return returnValue;
1005 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleLightChunk (void)
1007 SFUnrecLightChunkPtr::EditHandlePtr returnValue(
1008 new SFUnrecLightChunkPtr::EditHandle(
1009 &_sfLightChunk,
1010 this->getType().getFieldDesc(LightChunkFieldId),
1011 this));
1013 returnValue->setSetMethod(
1014 boost::bind(&SimpleShadowMapEngineData::setLightChunk,
1015 static_cast<SimpleShadowMapEngineData *>(this), _1));
1017 editSField(LightChunkFieldMask);
1019 return returnValue;
1022 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleBlendChunk (void) const
1024 SFUnrecBlendChunkPtr::GetHandlePtr returnValue(
1025 new SFUnrecBlendChunkPtr::GetHandle(
1026 &_sfBlendChunk,
1027 this->getType().getFieldDesc(BlendChunkFieldId),
1028 const_cast<SimpleShadowMapEngineDataBase *>(this)));
1030 return returnValue;
1033 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleBlendChunk (void)
1035 SFUnrecBlendChunkPtr::EditHandlePtr returnValue(
1036 new SFUnrecBlendChunkPtr::EditHandle(
1037 &_sfBlendChunk,
1038 this->getType().getFieldDesc(BlendChunkFieldId),
1039 this));
1041 returnValue->setSetMethod(
1042 boost::bind(&SimpleShadowMapEngineData::setBlendChunk,
1043 static_cast<SimpleShadowMapEngineData *>(this), _1));
1045 editSField(BlendChunkFieldMask);
1047 return returnValue;
1050 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandleTexGenChunk (void) const
1052 SFUnrecTexGenChunkPtr::GetHandlePtr returnValue(
1053 new SFUnrecTexGenChunkPtr::GetHandle(
1054 &_sfTexGenChunk,
1055 this->getType().getFieldDesc(TexGenChunkFieldId),
1056 const_cast<SimpleShadowMapEngineDataBase *>(this)));
1058 return returnValue;
1061 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandleTexGenChunk (void)
1063 SFUnrecTexGenChunkPtr::EditHandlePtr returnValue(
1064 new SFUnrecTexGenChunkPtr::EditHandle(
1065 &_sfTexGenChunk,
1066 this->getType().getFieldDesc(TexGenChunkFieldId),
1067 this));
1069 returnValue->setSetMethod(
1070 boost::bind(&SimpleShadowMapEngineData::setTexGenChunk,
1071 static_cast<SimpleShadowMapEngineData *>(this), _1));
1073 editSField(TexGenChunkFieldMask);
1075 return returnValue;
1078 GetFieldHandlePtr SimpleShadowMapEngineDataBase::getHandlePolyChunk (void) const
1080 SFUnrecPolygonChunkPtr::GetHandlePtr returnValue(
1081 new SFUnrecPolygonChunkPtr::GetHandle(
1082 &_sfPolyChunk,
1083 this->getType().getFieldDesc(PolyChunkFieldId),
1084 const_cast<SimpleShadowMapEngineDataBase *>(this)));
1086 return returnValue;
1089 EditFieldHandlePtr SimpleShadowMapEngineDataBase::editHandlePolyChunk (void)
1091 SFUnrecPolygonChunkPtr::EditHandlePtr returnValue(
1092 new SFUnrecPolygonChunkPtr::EditHandle(
1093 &_sfPolyChunk,
1094 this->getType().getFieldDesc(PolyChunkFieldId),
1095 this));
1097 returnValue->setSetMethod(
1098 boost::bind(&SimpleShadowMapEngineData::setPolyChunk,
1099 static_cast<SimpleShadowMapEngineData *>(this), _1));
1101 editSField(PolyChunkFieldMask);
1103 return returnValue;
1107 #ifdef OSG_MT_CPTR_ASPECT
1108 void SimpleShadowMapEngineDataBase::execSyncV( FieldContainer &oFrom,
1109 ConstFieldMaskArg whichField,
1110 AspectOffsetStore &oOffsets,
1111 ConstFieldMaskArg syncMode,
1112 const UInt32 uiSyncInfo)
1114 SimpleShadowMapEngineData *pThis = static_cast<SimpleShadowMapEngineData *>(this);
1116 pThis->execSync(static_cast<SimpleShadowMapEngineData *>(&oFrom),
1117 whichField,
1118 oOffsets,
1119 syncMode,
1120 uiSyncInfo);
1122 #endif
1125 #ifdef OSG_MT_CPTR_ASPECT
1126 FieldContainer *SimpleShadowMapEngineDataBase::createAspectCopy(
1127 const FieldContainer *pRefAspect) const
1129 SimpleShadowMapEngineData *returnValue;
1131 newAspectCopy(returnValue,
1132 dynamic_cast<const SimpleShadowMapEngineData *>(pRefAspect),
1133 dynamic_cast<const SimpleShadowMapEngineData *>(this));
1135 return returnValue;
1137 #endif
1139 void SimpleShadowMapEngineDataBase::resolveLinks(void)
1141 Inherited::resolveLinks();
1143 static_cast<SimpleShadowMapEngineData *>(this)->setCamera(NULL);
1145 static_cast<SimpleShadowMapEngineData *>(this)->setRenderTarget(NULL);
1147 static_cast<SimpleShadowMapEngineData *>(this)->setTexChunk(NULL);
1149 static_cast<SimpleShadowMapEngineData *>(this)->setTexBuffer(NULL);
1151 static_cast<SimpleShadowMapEngineData *>(this)->setLightChunk(NULL);
1153 static_cast<SimpleShadowMapEngineData *>(this)->setBlendChunk(NULL);
1155 static_cast<SimpleShadowMapEngineData *>(this)->setTexGenChunk(NULL);
1157 static_cast<SimpleShadowMapEngineData *>(this)->setPolyChunk(NULL);
1163 OSG_END_NAMESPACE