fixed: compile issue
[opensg.git] / Source / System / Window / Background / OSGTextureBackgroundBase.cpp
blob671e0e13ed23d402ed508b3ec49142b30efbfbac
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 TextureBackground!
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 "OSGTextureBaseChunk.h" // Texture Class
67 #include "OSGTextureBackgroundBase.h"
68 #include "OSGTextureBackground.h"
70 #include <boost/bind.hpp>
72 OSG_BEGIN_NAMESPACE
74 /***************************************************************************\
75 * Description *
76 \***************************************************************************/
78 /*! \class OSG::TextureBackground
79 A textured background e.g for distortion corrected fast live video from a
80 camera with known intrinsic parameters.
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var Color4f TextureBackgroundBase::_sfColor
91 /*! \var TextureBaseChunk * TextureBackgroundBase::_sfTexture
95 /*! \var Pnt2f TextureBackgroundBase::_mfTexCoords
99 /*! \var Real32 TextureBackgroundBase::_sfRadialDistortion
103 /*! \var Vec2f TextureBackgroundBase::_sfCenterOfDistortion
107 /*! \var UInt16 TextureBackgroundBase::_sfHor
108 Horizontal subdivision.
111 /*! \var UInt16 TextureBackgroundBase::_sfVert
112 Vertical subdivision.
116 /***************************************************************************\
117 * FieldType/FieldTrait Instantiation *
118 \***************************************************************************/
120 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
121 PointerType FieldTraits<TextureBackground *, nsOSG>::_type(
122 "TextureBackgroundPtr",
123 "BackgroundPtr",
124 TextureBackground::getClassType(),
125 nsOSG);
126 #endif
128 OSG_FIELDTRAITS_GETTYPE_NS(TextureBackground *, nsOSG)
130 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
131 TextureBackground *,
132 nsOSG)
135 /***************************************************************************\
136 * Field Description *
137 \***************************************************************************/
139 void TextureBackgroundBase::classDescInserter(TypeObject &oType)
141 FieldDescriptionBase *pDesc = NULL;
144 pDesc = new SFColor4f::Description(
145 SFColor4f::getClassType(),
146 "color",
148 ColorFieldId, ColorFieldMask,
149 false,
150 (Field::SFDefaultFlags | Field::FStdAccess),
151 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleColor),
152 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleColor));
154 oType.addInitialDesc(pDesc);
156 pDesc = new SFUnrecTextureBaseChunkPtr::Description(
157 SFUnrecTextureBaseChunkPtr::getClassType(),
158 "texture",
160 TextureFieldId, TextureFieldMask,
161 false,
162 (Field::SFDefaultFlags | Field::FStdAccess),
163 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleTexture),
164 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleTexture));
166 oType.addInitialDesc(pDesc);
168 pDesc = new MFPnt2f::Description(
169 MFPnt2f::getClassType(),
170 "texCoords",
172 TexCoordsFieldId, TexCoordsFieldMask,
173 false,
174 (Field::MFDefaultFlags | Field::FStdAccess),
175 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleTexCoords),
176 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleTexCoords));
178 oType.addInitialDesc(pDesc);
180 pDesc = new SFReal32::Description(
181 SFReal32::getClassType(),
182 "radialDistortion",
184 RadialDistortionFieldId, RadialDistortionFieldMask,
185 false,
186 (Field::SFDefaultFlags | Field::FStdAccess),
187 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleRadialDistortion),
188 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleRadialDistortion));
190 oType.addInitialDesc(pDesc);
192 pDesc = new SFVec2f::Description(
193 SFVec2f::getClassType(),
194 "centerOfDistortion",
196 CenterOfDistortionFieldId, CenterOfDistortionFieldMask,
197 false,
198 (Field::SFDefaultFlags | Field::FStdAccess),
199 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleCenterOfDistortion),
200 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleCenterOfDistortion));
202 oType.addInitialDesc(pDesc);
204 pDesc = new SFUInt16::Description(
205 SFUInt16::getClassType(),
206 "hor",
207 "Horizontal subdivision.\n",
208 HorFieldId, HorFieldMask,
209 false,
210 (Field::SFDefaultFlags | Field::FStdAccess),
211 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleHor),
212 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleHor));
214 oType.addInitialDesc(pDesc);
216 pDesc = new SFUInt16::Description(
217 SFUInt16::getClassType(),
218 "vert",
219 "Vertical subdivision.\n",
220 VertFieldId, VertFieldMask,
221 false,
222 (Field::SFDefaultFlags | Field::FStdAccess),
223 static_cast<FieldEditMethodSig>(&TextureBackground::editHandleVert),
224 static_cast<FieldGetMethodSig >(&TextureBackground::getHandleVert));
226 oType.addInitialDesc(pDesc);
230 TextureBackgroundBase::TypeObject TextureBackgroundBase::_type(
231 TextureBackgroundBase::getClassname(),
232 Inherited::getClassname(),
233 "NULL",
234 nsOSG, //Namespace
235 reinterpret_cast<PrototypeCreateF>(&TextureBackgroundBase::createEmptyLocal),
236 reinterpret_cast<InitContainerF>(&TextureBackground::initMethod),
237 reinterpret_cast<ExitContainerF>(&TextureBackground::exitMethod),
238 reinterpret_cast<InitalInsertDescFunc>(
239 reinterpret_cast<void *>(&TextureBackground::classDescInserter)),
240 false,
242 "<?xml version=\"1.0\"?>\n"
243 "\n"
244 "<FieldContainer\n"
245 " name=\"TextureBackground\"\n"
246 " parent=\"Background\"\n"
247 " library=\"Window\"\n"
248 " pointerfieldtypes=\"single\"\n"
249 " structure=\"concrete\"\n"
250 " systemcomponent=\"true\"\n"
251 " parentsystemcomponent=\"true\"\n"
252 " decoratable=\"false\"\n"
253 " useLocalIncludes=\"false\"\n"
254 " docGroupBase=\"GrpWindowBackground\"\n"
255 " >\n"
256 " A textured background e.g for distortion corrected fast live video from a\n"
257 " camera with known intrinsic parameters.\n"
258 " <Field\n"
259 "\t name=\"color\"\n"
260 "\t type=\"Color4f\"\n"
261 "\t cardinality=\"single\"\n"
262 "\t visibility=\"external\"\n"
263 "\t access=\"public\"\n"
264 "\t defaultValue=\"1.f, 1.f, 1.f, 0.f\"\n"
265 "\t >\n"
266 " </Field>\n"
267 " <Field\n"
268 "\t name=\"texture\"\n"
269 "\t type=\"TextureBaseChunkPtr\"\n"
270 "\t cardinality=\"single\"\n"
271 "\t visibility=\"external\"\n"
272 "\t access=\"public\"\n"
273 "\t >\n"
274 " </Field>\n"
275 " <Field\n"
276 "\t name=\"texCoords\"\n"
277 "\t type=\"Pnt2f\"\n"
278 "\t cardinality=\"multi\"\n"
279 "\t visibility=\"external\"\n"
280 "\t access=\"public\"\n"
281 "\t >\n"
282 " </Field>\n"
283 " <Field\n"
284 "\t name=\"radialDistortion\"\n"
285 "\t type=\"Real32\"\n"
286 "\t cardinality=\"single\"\n"
287 "\t visibility=\"external\"\n"
288 "\t defaultValue=\"0\"\n"
289 "\t access=\"public\"\n"
290 "\t >\n"
291 " </Field>\n"
292 " <Field\n"
293 "\t name=\"centerOfDistortion\"\n"
294 "\t type=\"Vec2f\"\n"
295 "\t cardinality=\"single\"\n"
296 "\t visibility=\"external\"\n"
297 "\t defaultValue=\"0.5, 0.5\"\n"
298 "\t access=\"public\"\n"
299 "\t >\n"
300 " </Field>\n"
301 " <Field\n"
302 "\t name=\"hor\"\n"
303 "\t type=\"UInt16\"\n"
304 "\t cardinality=\"single\"\n"
305 "\t visibility=\"external\"\n"
306 "\t defaultValue=\"2\"\n"
307 "\t access=\"public\"\n"
308 "\t >\n"
309 "\tHorizontal subdivision.\n"
310 " </Field>\n"
311 " <Field\n"
312 "\t name=\"vert\"\n"
313 "\t type=\"UInt16\"\n"
314 "\t cardinality=\"single\"\n"
315 "\t visibility=\"external\"\n"
316 "\t defaultValue=\"2\"\n"
317 "\t access=\"public\"\n"
318 "\t >\n"
319 "\tVertical subdivision.\n"
320 " </Field>\n"
321 "</FieldContainer>\n",
322 "A textured background e.g for distortion corrected fast live video from a\n"
323 "camera with known intrinsic parameters.\n"
326 /*------------------------------ get -----------------------------------*/
328 FieldContainerType &TextureBackgroundBase::getType(void)
330 return _type;
333 const FieldContainerType &TextureBackgroundBase::getType(void) const
335 return _type;
338 UInt32 TextureBackgroundBase::getContainerSize(void) const
340 return sizeof(TextureBackground);
343 /*------------------------- decorator get ------------------------------*/
346 SFColor4f *TextureBackgroundBase::editSFColor(void)
348 editSField(ColorFieldMask);
350 return &_sfColor;
353 const SFColor4f *TextureBackgroundBase::getSFColor(void) const
355 return &_sfColor;
359 //! Get the TextureBackground::_sfTexture field.
360 const SFUnrecTextureBaseChunkPtr *TextureBackgroundBase::getSFTexture(void) const
362 return &_sfTexture;
365 SFUnrecTextureBaseChunkPtr *TextureBackgroundBase::editSFTexture (void)
367 editSField(TextureFieldMask);
369 return &_sfTexture;
372 //! Get the value of the TextureBackground::_sfTexture field.
373 TextureBaseChunk * TextureBackgroundBase::getTexture(void) const
375 return _sfTexture.getValue();
378 //! Set the value of the TextureBackground::_sfTexture field.
379 void TextureBackgroundBase::setTexture(TextureBaseChunk * const value)
381 editSField(TextureFieldMask);
383 _sfTexture.setValue(value);
387 MFPnt2f *TextureBackgroundBase::editMFTexCoords(void)
389 editMField(TexCoordsFieldMask, _mfTexCoords);
391 return &_mfTexCoords;
394 const MFPnt2f *TextureBackgroundBase::getMFTexCoords(void) const
396 return &_mfTexCoords;
400 SFReal32 *TextureBackgroundBase::editSFRadialDistortion(void)
402 editSField(RadialDistortionFieldMask);
404 return &_sfRadialDistortion;
407 const SFReal32 *TextureBackgroundBase::getSFRadialDistortion(void) const
409 return &_sfRadialDistortion;
413 SFVec2f *TextureBackgroundBase::editSFCenterOfDistortion(void)
415 editSField(CenterOfDistortionFieldMask);
417 return &_sfCenterOfDistortion;
420 const SFVec2f *TextureBackgroundBase::getSFCenterOfDistortion(void) const
422 return &_sfCenterOfDistortion;
426 SFUInt16 *TextureBackgroundBase::editSFHor(void)
428 editSField(HorFieldMask);
430 return &_sfHor;
433 const SFUInt16 *TextureBackgroundBase::getSFHor(void) const
435 return &_sfHor;
439 SFUInt16 *TextureBackgroundBase::editSFVert(void)
441 editSField(VertFieldMask);
443 return &_sfVert;
446 const SFUInt16 *TextureBackgroundBase::getSFVert(void) const
448 return &_sfVert;
456 /*------------------------------ access -----------------------------------*/
458 SizeT TextureBackgroundBase::getBinSize(ConstFieldMaskArg whichField)
460 SizeT returnValue = Inherited::getBinSize(whichField);
462 if(FieldBits::NoField != (ColorFieldMask & whichField))
464 returnValue += _sfColor.getBinSize();
466 if(FieldBits::NoField != (TextureFieldMask & whichField))
468 returnValue += _sfTexture.getBinSize();
470 if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
472 returnValue += _mfTexCoords.getBinSize();
474 if(FieldBits::NoField != (RadialDistortionFieldMask & whichField))
476 returnValue += _sfRadialDistortion.getBinSize();
478 if(FieldBits::NoField != (CenterOfDistortionFieldMask & whichField))
480 returnValue += _sfCenterOfDistortion.getBinSize();
482 if(FieldBits::NoField != (HorFieldMask & whichField))
484 returnValue += _sfHor.getBinSize();
486 if(FieldBits::NoField != (VertFieldMask & whichField))
488 returnValue += _sfVert.getBinSize();
491 return returnValue;
494 void TextureBackgroundBase::copyToBin(BinaryDataHandler &pMem,
495 ConstFieldMaskArg whichField)
497 Inherited::copyToBin(pMem, whichField);
499 if(FieldBits::NoField != (ColorFieldMask & whichField))
501 _sfColor.copyToBin(pMem);
503 if(FieldBits::NoField != (TextureFieldMask & whichField))
505 _sfTexture.copyToBin(pMem);
507 if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
509 _mfTexCoords.copyToBin(pMem);
511 if(FieldBits::NoField != (RadialDistortionFieldMask & whichField))
513 _sfRadialDistortion.copyToBin(pMem);
515 if(FieldBits::NoField != (CenterOfDistortionFieldMask & whichField))
517 _sfCenterOfDistortion.copyToBin(pMem);
519 if(FieldBits::NoField != (HorFieldMask & whichField))
521 _sfHor.copyToBin(pMem);
523 if(FieldBits::NoField != (VertFieldMask & whichField))
525 _sfVert.copyToBin(pMem);
529 void TextureBackgroundBase::copyFromBin(BinaryDataHandler &pMem,
530 ConstFieldMaskArg whichField)
532 Inherited::copyFromBin(pMem, whichField);
534 if(FieldBits::NoField != (ColorFieldMask & whichField))
536 editSField(ColorFieldMask);
537 _sfColor.copyFromBin(pMem);
539 if(FieldBits::NoField != (TextureFieldMask & whichField))
541 editSField(TextureFieldMask);
542 _sfTexture.copyFromBin(pMem);
544 if(FieldBits::NoField != (TexCoordsFieldMask & whichField))
546 editMField(TexCoordsFieldMask, _mfTexCoords);
547 _mfTexCoords.copyFromBin(pMem);
549 if(FieldBits::NoField != (RadialDistortionFieldMask & whichField))
551 editSField(RadialDistortionFieldMask);
552 _sfRadialDistortion.copyFromBin(pMem);
554 if(FieldBits::NoField != (CenterOfDistortionFieldMask & whichField))
556 editSField(CenterOfDistortionFieldMask);
557 _sfCenterOfDistortion.copyFromBin(pMem);
559 if(FieldBits::NoField != (HorFieldMask & whichField))
561 editSField(HorFieldMask);
562 _sfHor.copyFromBin(pMem);
564 if(FieldBits::NoField != (VertFieldMask & whichField))
566 editSField(VertFieldMask);
567 _sfVert.copyFromBin(pMem);
571 //! create a new instance of the class
572 TextureBackgroundTransitPtr TextureBackgroundBase::createLocal(BitVector bFlags)
574 TextureBackgroundTransitPtr fc;
576 if(getClassType().getPrototype() != NULL)
578 FieldContainerTransitPtr tmpPtr =
579 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
581 fc = dynamic_pointer_cast<TextureBackground>(tmpPtr);
584 return fc;
587 //! create a new instance of the class, copy the container flags
588 TextureBackgroundTransitPtr TextureBackgroundBase::createDependent(BitVector bFlags)
590 TextureBackgroundTransitPtr fc;
592 if(getClassType().getPrototype() != NULL)
594 FieldContainerTransitPtr tmpPtr =
595 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
597 fc = dynamic_pointer_cast<TextureBackground>(tmpPtr);
600 return fc;
603 //! create a new instance of the class
604 TextureBackgroundTransitPtr TextureBackgroundBase::create(void)
606 TextureBackgroundTransitPtr fc;
608 if(getClassType().getPrototype() != NULL)
610 FieldContainerTransitPtr tmpPtr =
611 getClassType().getPrototype()-> shallowCopy();
613 fc = dynamic_pointer_cast<TextureBackground>(tmpPtr);
616 return fc;
619 TextureBackground *TextureBackgroundBase::createEmptyLocal(BitVector bFlags)
621 TextureBackground *returnValue;
623 newPtr<TextureBackground>(returnValue, bFlags);
625 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
627 return returnValue;
630 //! create an empty new instance of the class, do not copy the prototype
631 TextureBackground *TextureBackgroundBase::createEmpty(void)
633 TextureBackground *returnValue;
635 newPtr<TextureBackground>(returnValue, Thread::getCurrentLocalFlags());
637 returnValue->_pFieldFlags->_bNamespaceMask &=
638 ~Thread::getCurrentLocalFlags();
640 return returnValue;
644 FieldContainerTransitPtr TextureBackgroundBase::shallowCopyLocal(
645 BitVector bFlags) const
647 TextureBackground *tmpPtr;
649 newPtr(tmpPtr, dynamic_cast<const TextureBackground *>(this), bFlags);
651 FieldContainerTransitPtr returnValue(tmpPtr);
653 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
655 return returnValue;
658 FieldContainerTransitPtr TextureBackgroundBase::shallowCopyDependent(
659 BitVector bFlags) const
661 TextureBackground *tmpPtr;
663 newPtr(tmpPtr, dynamic_cast<const TextureBackground *>(this), ~bFlags);
665 FieldContainerTransitPtr returnValue(tmpPtr);
667 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
669 return returnValue;
672 FieldContainerTransitPtr TextureBackgroundBase::shallowCopy(void) const
674 TextureBackground *tmpPtr;
676 newPtr(tmpPtr,
677 dynamic_cast<const TextureBackground *>(this),
678 Thread::getCurrentLocalFlags());
680 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
682 FieldContainerTransitPtr returnValue(tmpPtr);
684 return returnValue;
690 /*------------------------- constructors ----------------------------------*/
692 TextureBackgroundBase::TextureBackgroundBase(void) :
693 Inherited(),
694 _sfColor (Color4f(1.f, 1.f, 1.f, 0.f)),
695 _sfTexture (NULL),
696 _mfTexCoords (),
697 _sfRadialDistortion (Real32(0)),
698 _sfCenterOfDistortion (Vec2f(0.5, 0.5)),
699 _sfHor (UInt16(2)),
700 _sfVert (UInt16(2))
704 TextureBackgroundBase::TextureBackgroundBase(const TextureBackgroundBase &source) :
705 Inherited(source),
706 _sfColor (source._sfColor ),
707 _sfTexture (NULL),
708 _mfTexCoords (source._mfTexCoords ),
709 _sfRadialDistortion (source._sfRadialDistortion ),
710 _sfCenterOfDistortion (source._sfCenterOfDistortion ),
711 _sfHor (source._sfHor ),
712 _sfVert (source._sfVert )
717 /*-------------------------- destructors ----------------------------------*/
719 TextureBackgroundBase::~TextureBackgroundBase(void)
723 void TextureBackgroundBase::onCreate(const TextureBackground *source)
725 Inherited::onCreate(source);
727 if(source != NULL)
729 TextureBackground *pThis = static_cast<TextureBackground *>(this);
731 pThis->setTexture(source->getTexture());
735 GetFieldHandlePtr TextureBackgroundBase::getHandleColor (void) const
737 SFColor4f::GetHandlePtr returnValue(
738 new SFColor4f::GetHandle(
739 &_sfColor,
740 this->getType().getFieldDesc(ColorFieldId),
741 const_cast<TextureBackgroundBase *>(this)));
743 return returnValue;
746 EditFieldHandlePtr TextureBackgroundBase::editHandleColor (void)
748 SFColor4f::EditHandlePtr returnValue(
749 new SFColor4f::EditHandle(
750 &_sfColor,
751 this->getType().getFieldDesc(ColorFieldId),
752 this));
755 editSField(ColorFieldMask);
757 return returnValue;
760 GetFieldHandlePtr TextureBackgroundBase::getHandleTexture (void) const
762 SFUnrecTextureBaseChunkPtr::GetHandlePtr returnValue(
763 new SFUnrecTextureBaseChunkPtr::GetHandle(
764 &_sfTexture,
765 this->getType().getFieldDesc(TextureFieldId),
766 const_cast<TextureBackgroundBase *>(this)));
768 return returnValue;
771 EditFieldHandlePtr TextureBackgroundBase::editHandleTexture (void)
773 SFUnrecTextureBaseChunkPtr::EditHandlePtr returnValue(
774 new SFUnrecTextureBaseChunkPtr::EditHandle(
775 &_sfTexture,
776 this->getType().getFieldDesc(TextureFieldId),
777 this));
779 returnValue->setSetMethod(
780 boost::bind(&TextureBackground::setTexture,
781 static_cast<TextureBackground *>(this), _1));
783 editSField(TextureFieldMask);
785 return returnValue;
788 GetFieldHandlePtr TextureBackgroundBase::getHandleTexCoords (void) const
790 MFPnt2f::GetHandlePtr returnValue(
791 new MFPnt2f::GetHandle(
792 &_mfTexCoords,
793 this->getType().getFieldDesc(TexCoordsFieldId),
794 const_cast<TextureBackgroundBase *>(this)));
796 return returnValue;
799 EditFieldHandlePtr TextureBackgroundBase::editHandleTexCoords (void)
801 MFPnt2f::EditHandlePtr returnValue(
802 new MFPnt2f::EditHandle(
803 &_mfTexCoords,
804 this->getType().getFieldDesc(TexCoordsFieldId),
805 this));
808 editMField(TexCoordsFieldMask, _mfTexCoords);
810 return returnValue;
813 GetFieldHandlePtr TextureBackgroundBase::getHandleRadialDistortion (void) const
815 SFReal32::GetHandlePtr returnValue(
816 new SFReal32::GetHandle(
817 &_sfRadialDistortion,
818 this->getType().getFieldDesc(RadialDistortionFieldId),
819 const_cast<TextureBackgroundBase *>(this)));
821 return returnValue;
824 EditFieldHandlePtr TextureBackgroundBase::editHandleRadialDistortion(void)
826 SFReal32::EditHandlePtr returnValue(
827 new SFReal32::EditHandle(
828 &_sfRadialDistortion,
829 this->getType().getFieldDesc(RadialDistortionFieldId),
830 this));
833 editSField(RadialDistortionFieldMask);
835 return returnValue;
838 GetFieldHandlePtr TextureBackgroundBase::getHandleCenterOfDistortion (void) const
840 SFVec2f::GetHandlePtr returnValue(
841 new SFVec2f::GetHandle(
842 &_sfCenterOfDistortion,
843 this->getType().getFieldDesc(CenterOfDistortionFieldId),
844 const_cast<TextureBackgroundBase *>(this)));
846 return returnValue;
849 EditFieldHandlePtr TextureBackgroundBase::editHandleCenterOfDistortion(void)
851 SFVec2f::EditHandlePtr returnValue(
852 new SFVec2f::EditHandle(
853 &_sfCenterOfDistortion,
854 this->getType().getFieldDesc(CenterOfDistortionFieldId),
855 this));
858 editSField(CenterOfDistortionFieldMask);
860 return returnValue;
863 GetFieldHandlePtr TextureBackgroundBase::getHandleHor (void) const
865 SFUInt16::GetHandlePtr returnValue(
866 new SFUInt16::GetHandle(
867 &_sfHor,
868 this->getType().getFieldDesc(HorFieldId),
869 const_cast<TextureBackgroundBase *>(this)));
871 return returnValue;
874 EditFieldHandlePtr TextureBackgroundBase::editHandleHor (void)
876 SFUInt16::EditHandlePtr returnValue(
877 new SFUInt16::EditHandle(
878 &_sfHor,
879 this->getType().getFieldDesc(HorFieldId),
880 this));
883 editSField(HorFieldMask);
885 return returnValue;
888 GetFieldHandlePtr TextureBackgroundBase::getHandleVert (void) const
890 SFUInt16::GetHandlePtr returnValue(
891 new SFUInt16::GetHandle(
892 &_sfVert,
893 this->getType().getFieldDesc(VertFieldId),
894 const_cast<TextureBackgroundBase *>(this)));
896 return returnValue;
899 EditFieldHandlePtr TextureBackgroundBase::editHandleVert (void)
901 SFUInt16::EditHandlePtr returnValue(
902 new SFUInt16::EditHandle(
903 &_sfVert,
904 this->getType().getFieldDesc(VertFieldId),
905 this));
908 editSField(VertFieldMask);
910 return returnValue;
914 #ifdef OSG_MT_CPTR_ASPECT
915 void TextureBackgroundBase::execSyncV( FieldContainer &oFrom,
916 ConstFieldMaskArg whichField,
917 AspectOffsetStore &oOffsets,
918 ConstFieldMaskArg syncMode,
919 const UInt32 uiSyncInfo)
921 TextureBackground *pThis = static_cast<TextureBackground *>(this);
923 pThis->execSync(static_cast<TextureBackground *>(&oFrom),
924 whichField,
925 oOffsets,
926 syncMode,
927 uiSyncInfo);
929 #endif
932 #ifdef OSG_MT_CPTR_ASPECT
933 FieldContainer *TextureBackgroundBase::createAspectCopy(
934 const FieldContainer *pRefAspect) const
936 TextureBackground *returnValue;
938 newAspectCopy(returnValue,
939 dynamic_cast<const TextureBackground *>(pRefAspect),
940 dynamic_cast<const TextureBackground *>(this));
942 return returnValue;
944 #endif
946 void TextureBackgroundBase::resolveLinks(void)
948 Inherited::resolveLinks();
950 static_cast<TextureBackground *>(this)->setTexture(NULL);
952 #ifdef OSG_MT_CPTR_ASPECT
953 AspectOffsetStore oOffsets;
955 _pAspectStore->fillOffsetArray(oOffsets, this);
956 #endif
958 #ifdef OSG_MT_CPTR_ASPECT
959 _mfTexCoords.terminateShare(Thread::getCurrentAspect(),
960 oOffsets);
961 #endif
965 OSG_END_NAMESPACE