fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / OpenGL / OSGCubeTextureObjChunkBase.cpp
blob03536b1379f85cc7b9d4e8f82dd9b138bdea1573
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 CubeTextureObjChunk!
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 "OSGImage.h" // PosZImage Class
67 #include "OSGCubeTextureObjChunkBase.h"
68 #include "OSGCubeTextureObjChunk.h"
70 #include <boost/bind.hpp>
72 OSG_BEGIN_NAMESPACE
74 /***************************************************************************\
75 * Description *
76 \***************************************************************************/
78 /*! \class OSG::CubeTextureObjChunk
79 See \ref PageSystemCubeTextureObjChunk for a description.
81 The CubeTexture is defined by 6 separate texture images. As it is derived
82 from the standard texture chunk it already has an image, which is used for
83 the negative Z direction. The other 5 images are stored in variables that
84 are named according to the direction they represent
85 (OSG::CubeTextureObjChunk::_sfPosZImage,
86 OSG::CubeTextureObjChunk::_sfNegYImage,
87 OSG::CubeTextureObjChunk::_sfPosYImage,
88 OSG::CubeTextureObjChunk::_sfNegXImage,
89 OSG::CubeTextureObjChunk::_sfPosXImage).
92 /***************************************************************************\
93 * Field Documentation *
94 \***************************************************************************/
96 /*! \var Image * CubeTextureObjChunkBase::_sfPosZImage
97 The image for the positive Z direction of the cube texture.
100 /*! \var Image * CubeTextureObjChunkBase::_sfPosXImage
101 The image for the positive X direction of the cube texture.
104 /*! \var Image * CubeTextureObjChunkBase::_sfNegXImage
105 The image for the negative X direction of the cube texture.
108 /*! \var Image * CubeTextureObjChunkBase::_sfPosYImage
109 The image for the positive Y direction of the cube texture.
112 /*! \var Image * CubeTextureObjChunkBase::_sfNegYImage
113 The image for the negative Y direction of the cube texture.
117 /***************************************************************************\
118 * FieldType/FieldTrait Instantiation *
119 \***************************************************************************/
121 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
122 PointerType FieldTraits<CubeTextureObjChunk *, nsOSG>::_type(
123 "CubeTextureObjChunkPtr",
124 "TextureObjChunkPtr",
125 CubeTextureObjChunk::getClassType(),
126 nsOSG);
127 #endif
129 OSG_FIELDTRAITS_GETTYPE_NS(CubeTextureObjChunk *, nsOSG)
131 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
132 CubeTextureObjChunk *,
133 nsOSG)
135 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
136 CubeTextureObjChunk *,
137 nsOSG)
139 /***************************************************************************\
140 * Field Description *
141 \***************************************************************************/
143 void CubeTextureObjChunkBase::classDescInserter(TypeObject &oType)
145 FieldDescriptionBase *pDesc = NULL;
148 pDesc = new SFUnrecImagePtr::Description(
149 SFUnrecImagePtr::getClassType(),
150 "posZImage",
151 "The image for the positive Z direction of the cube texture.\n",
152 PosZImageFieldId, PosZImageFieldMask,
153 false,
154 (Field::SFDefaultFlags | Field::FStdAccess),
155 static_cast<FieldEditMethodSig>(&CubeTextureObjChunk::editHandlePosZImage),
156 static_cast<FieldGetMethodSig >(&CubeTextureObjChunk::getHandlePosZImage));
158 oType.addInitialDesc(pDesc);
160 pDesc = new SFUnrecImagePtr::Description(
161 SFUnrecImagePtr::getClassType(),
162 "posXImage",
163 "The image for the positive X direction of the cube texture.\n",
164 PosXImageFieldId, PosXImageFieldMask,
165 false,
166 (Field::SFDefaultFlags | Field::FStdAccess),
167 static_cast<FieldEditMethodSig>(&CubeTextureObjChunk::editHandlePosXImage),
168 static_cast<FieldGetMethodSig >(&CubeTextureObjChunk::getHandlePosXImage));
170 oType.addInitialDesc(pDesc);
172 pDesc = new SFUnrecImagePtr::Description(
173 SFUnrecImagePtr::getClassType(),
174 "negXImage",
175 "The image for the negative X direction of the cube texture.\n",
176 NegXImageFieldId, NegXImageFieldMask,
177 false,
178 (Field::SFDefaultFlags | Field::FStdAccess),
179 static_cast<FieldEditMethodSig>(&CubeTextureObjChunk::editHandleNegXImage),
180 static_cast<FieldGetMethodSig >(&CubeTextureObjChunk::getHandleNegXImage));
182 oType.addInitialDesc(pDesc);
184 pDesc = new SFUnrecImagePtr::Description(
185 SFUnrecImagePtr::getClassType(),
186 "posYImage",
187 "The image for the positive Y direction of the cube texture.\n",
188 PosYImageFieldId, PosYImageFieldMask,
189 false,
190 (Field::SFDefaultFlags | Field::FStdAccess),
191 static_cast<FieldEditMethodSig>(&CubeTextureObjChunk::editHandlePosYImage),
192 static_cast<FieldGetMethodSig >(&CubeTextureObjChunk::getHandlePosYImage));
194 oType.addInitialDesc(pDesc);
196 pDesc = new SFUnrecImagePtr::Description(
197 SFUnrecImagePtr::getClassType(),
198 "negYImage",
199 "The image for the negative Y direction of the cube texture.\n",
200 NegYImageFieldId, NegYImageFieldMask,
201 false,
202 (Field::SFDefaultFlags | Field::FStdAccess),
203 static_cast<FieldEditMethodSig>(&CubeTextureObjChunk::editHandleNegYImage),
204 static_cast<FieldGetMethodSig >(&CubeTextureObjChunk::getHandleNegYImage));
206 oType.addInitialDesc(pDesc);
210 CubeTextureObjChunkBase::TypeObject CubeTextureObjChunkBase::_type(
211 CubeTextureObjChunkBase::getClassname(),
212 Inherited::getClassname(),
213 "NULL",
214 nsOSG, //Namespace
215 reinterpret_cast<PrototypeCreateF>(&CubeTextureObjChunkBase::createEmptyLocal),
216 reinterpret_cast<InitContainerF>(&CubeTextureObjChunk::initMethod),
217 reinterpret_cast<ExitContainerF>(&CubeTextureObjChunk::exitMethod),
218 reinterpret_cast<InitalInsertDescFunc>(
219 reinterpret_cast<void *>(&CubeTextureObjChunk::classDescInserter)),
220 false,
222 "<?xml version=\"1.0\"?>\n"
223 "\n"
224 "<FieldContainer\n"
225 " name=\"CubeTextureObjChunk\"\n"
226 " parent=\"TextureObjChunk\"\n"
227 " library=\"State\"\n"
228 " pointerfieldtypes=\"both\"\n"
229 " structure=\"concrete\"\n"
230 " systemcomponent=\"true\"\n"
231 " parentsystemcomponent=\"true\"\n"
232 " decoratable=\"false\"\n"
233 " docGroupBase=\"GrpStateOpenGL\"\n"
234 " >\n"
235 " See \\ref PageSystemCubeTextureObjChunk for a description.\n"
236 "\n"
237 " The CubeTexture is defined by 6 separate texture images. As it is derived\n"
238 " from the standard texture chunk it already has an image, which is used for\n"
239 " the negative Z direction. The other 5 images are stored in variables that\n"
240 " are named according to the direction they represent\n"
241 " (OSG::CubeTextureObjChunk::_sfPosZImage,\n"
242 " OSG::CubeTextureObjChunk::_sfNegYImage,\n"
243 " OSG::CubeTextureObjChunk::_sfPosYImage,\n"
244 " OSG::CubeTextureObjChunk::_sfNegXImage,\n"
245 " OSG::CubeTextureObjChunk::_sfPosXImage). \n"
246 " <Field\n"
247 "\t name=\"posZImage\"\n"
248 "\t type=\"ImagePtr\"\n"
249 "\t cardinality=\"single\"\n"
250 "\t visibility=\"external\"\n"
251 "\t access=\"public\"\n"
252 "\t >\n"
253 "\tThe image for the positive Z direction of the cube texture.\n"
254 " </Field>\n"
255 " <Field\n"
256 "\t name=\"posXImage\"\n"
257 "\t type=\"ImagePtr\"\n"
258 "\t cardinality=\"single\"\n"
259 "\t visibility=\"external\"\n"
260 "\t access=\"public\"\n"
261 "\t >\n"
262 "\tThe image for the positive X direction of the cube texture.\n"
263 " </Field>\n"
264 " <Field\n"
265 "\t name=\"negXImage\"\n"
266 "\t type=\"ImagePtr\"\n"
267 "\t cardinality=\"single\"\n"
268 "\t visibility=\"external\"\n"
269 "\t access=\"public\"\n"
270 "\t >\n"
271 "\tThe image for the negative X direction of the cube texture.\n"
272 " </Field>\n"
273 " <Field\n"
274 "\t name=\"posYImage\"\n"
275 "\t type=\"ImagePtr\"\n"
276 "\t cardinality=\"single\"\n"
277 "\t visibility=\"external\"\n"
278 "\t access=\"public\"\n"
279 "\t >\n"
280 "\tThe image for the positive Y direction of the cube texture.\n"
281 " </Field>\n"
282 " <Field\n"
283 "\t name=\"negYImage\"\n"
284 "\t type=\"ImagePtr\"\n"
285 "\t cardinality=\"single\"\n"
286 "\t visibility=\"external\"\n"
287 "\t access=\"public\"\n"
288 "\t >\n"
289 "\tThe image for the negative Y direction of the cube texture.\n"
290 " </Field>\n"
291 "</FieldContainer>\n",
292 "See \\ref PageSystemCubeTextureObjChunk for a description.\n"
293 "\n"
294 "The CubeTexture is defined by 6 separate texture images. As it is derived\n"
295 "from the standard texture chunk it already has an image, which is used for\n"
296 "the negative Z direction. The other 5 images are stored in variables that\n"
297 "are named according to the direction they represent\n"
298 "(OSG::CubeTextureObjChunk::_sfPosZImage,\n"
299 "OSG::CubeTextureObjChunk::_sfNegYImage,\n"
300 "OSG::CubeTextureObjChunk::_sfPosYImage,\n"
301 "OSG::CubeTextureObjChunk::_sfNegXImage,\n"
302 "OSG::CubeTextureObjChunk::_sfPosXImage). \n"
305 /*------------------------------ get -----------------------------------*/
307 FieldContainerType &CubeTextureObjChunkBase::getType(void)
309 return _type;
312 const FieldContainerType &CubeTextureObjChunkBase::getType(void) const
314 return _type;
317 UInt32 CubeTextureObjChunkBase::getContainerSize(void) const
319 return sizeof(CubeTextureObjChunk);
322 /*------------------------- decorator get ------------------------------*/
325 //! Get the CubeTextureObjChunk::_sfPosZImage field.
326 const SFUnrecImagePtr *CubeTextureObjChunkBase::getSFPosZImage(void) const
328 return &_sfPosZImage;
331 SFUnrecImagePtr *CubeTextureObjChunkBase::editSFPosZImage (void)
333 editSField(PosZImageFieldMask);
335 return &_sfPosZImage;
338 //! Get the value of the CubeTextureObjChunk::_sfPosZImage field.
339 Image * CubeTextureObjChunkBase::getPosZImage(void) const
341 return _sfPosZImage.getValue();
344 //! Set the value of the CubeTextureObjChunk::_sfPosZImage field.
345 void CubeTextureObjChunkBase::setPosZImage(Image * const value)
347 editSField(PosZImageFieldMask);
349 _sfPosZImage.setValue(value);
353 //! Get the CubeTextureObjChunk::_sfPosXImage field.
354 const SFUnrecImagePtr *CubeTextureObjChunkBase::getSFPosXImage(void) const
356 return &_sfPosXImage;
359 SFUnrecImagePtr *CubeTextureObjChunkBase::editSFPosXImage (void)
361 editSField(PosXImageFieldMask);
363 return &_sfPosXImage;
366 //! Get the value of the CubeTextureObjChunk::_sfPosXImage field.
367 Image * CubeTextureObjChunkBase::getPosXImage(void) const
369 return _sfPosXImage.getValue();
372 //! Set the value of the CubeTextureObjChunk::_sfPosXImage field.
373 void CubeTextureObjChunkBase::setPosXImage(Image * const value)
375 editSField(PosXImageFieldMask);
377 _sfPosXImage.setValue(value);
381 //! Get the CubeTextureObjChunk::_sfNegXImage field.
382 const SFUnrecImagePtr *CubeTextureObjChunkBase::getSFNegXImage(void) const
384 return &_sfNegXImage;
387 SFUnrecImagePtr *CubeTextureObjChunkBase::editSFNegXImage (void)
389 editSField(NegXImageFieldMask);
391 return &_sfNegXImage;
394 //! Get the value of the CubeTextureObjChunk::_sfNegXImage field.
395 Image * CubeTextureObjChunkBase::getNegXImage(void) const
397 return _sfNegXImage.getValue();
400 //! Set the value of the CubeTextureObjChunk::_sfNegXImage field.
401 void CubeTextureObjChunkBase::setNegXImage(Image * const value)
403 editSField(NegXImageFieldMask);
405 _sfNegXImage.setValue(value);
409 //! Get the CubeTextureObjChunk::_sfPosYImage field.
410 const SFUnrecImagePtr *CubeTextureObjChunkBase::getSFPosYImage(void) const
412 return &_sfPosYImage;
415 SFUnrecImagePtr *CubeTextureObjChunkBase::editSFPosYImage (void)
417 editSField(PosYImageFieldMask);
419 return &_sfPosYImage;
422 //! Get the value of the CubeTextureObjChunk::_sfPosYImage field.
423 Image * CubeTextureObjChunkBase::getPosYImage(void) const
425 return _sfPosYImage.getValue();
428 //! Set the value of the CubeTextureObjChunk::_sfPosYImage field.
429 void CubeTextureObjChunkBase::setPosYImage(Image * const value)
431 editSField(PosYImageFieldMask);
433 _sfPosYImage.setValue(value);
437 //! Get the CubeTextureObjChunk::_sfNegYImage field.
438 const SFUnrecImagePtr *CubeTextureObjChunkBase::getSFNegYImage(void) const
440 return &_sfNegYImage;
443 SFUnrecImagePtr *CubeTextureObjChunkBase::editSFNegYImage (void)
445 editSField(NegYImageFieldMask);
447 return &_sfNegYImage;
450 //! Get the value of the CubeTextureObjChunk::_sfNegYImage field.
451 Image * CubeTextureObjChunkBase::getNegYImage(void) const
453 return _sfNegYImage.getValue();
456 //! Set the value of the CubeTextureObjChunk::_sfNegYImage field.
457 void CubeTextureObjChunkBase::setNegYImage(Image * const value)
459 editSField(NegYImageFieldMask);
461 _sfNegYImage.setValue(value);
469 /*------------------------------ access -----------------------------------*/
471 SizeT CubeTextureObjChunkBase::getBinSize(ConstFieldMaskArg whichField)
473 SizeT returnValue = Inherited::getBinSize(whichField);
475 if(FieldBits::NoField != (PosZImageFieldMask & whichField))
477 returnValue += _sfPosZImage.getBinSize();
479 if(FieldBits::NoField != (PosXImageFieldMask & whichField))
481 returnValue += _sfPosXImage.getBinSize();
483 if(FieldBits::NoField != (NegXImageFieldMask & whichField))
485 returnValue += _sfNegXImage.getBinSize();
487 if(FieldBits::NoField != (PosYImageFieldMask & whichField))
489 returnValue += _sfPosYImage.getBinSize();
491 if(FieldBits::NoField != (NegYImageFieldMask & whichField))
493 returnValue += _sfNegYImage.getBinSize();
496 return returnValue;
499 void CubeTextureObjChunkBase::copyToBin(BinaryDataHandler &pMem,
500 ConstFieldMaskArg whichField)
502 Inherited::copyToBin(pMem, whichField);
504 if(FieldBits::NoField != (PosZImageFieldMask & whichField))
506 _sfPosZImage.copyToBin(pMem);
508 if(FieldBits::NoField != (PosXImageFieldMask & whichField))
510 _sfPosXImage.copyToBin(pMem);
512 if(FieldBits::NoField != (NegXImageFieldMask & whichField))
514 _sfNegXImage.copyToBin(pMem);
516 if(FieldBits::NoField != (PosYImageFieldMask & whichField))
518 _sfPosYImage.copyToBin(pMem);
520 if(FieldBits::NoField != (NegYImageFieldMask & whichField))
522 _sfNegYImage.copyToBin(pMem);
526 void CubeTextureObjChunkBase::copyFromBin(BinaryDataHandler &pMem,
527 ConstFieldMaskArg whichField)
529 Inherited::copyFromBin(pMem, whichField);
531 if(FieldBits::NoField != (PosZImageFieldMask & whichField))
533 editSField(PosZImageFieldMask);
534 _sfPosZImage.copyFromBin(pMem);
536 if(FieldBits::NoField != (PosXImageFieldMask & whichField))
538 editSField(PosXImageFieldMask);
539 _sfPosXImage.copyFromBin(pMem);
541 if(FieldBits::NoField != (NegXImageFieldMask & whichField))
543 editSField(NegXImageFieldMask);
544 _sfNegXImage.copyFromBin(pMem);
546 if(FieldBits::NoField != (PosYImageFieldMask & whichField))
548 editSField(PosYImageFieldMask);
549 _sfPosYImage.copyFromBin(pMem);
551 if(FieldBits::NoField != (NegYImageFieldMask & whichField))
553 editSField(NegYImageFieldMask);
554 _sfNegYImage.copyFromBin(pMem);
558 //! create a new instance of the class
559 CubeTextureObjChunkTransitPtr CubeTextureObjChunkBase::createLocal(BitVector bFlags)
561 CubeTextureObjChunkTransitPtr fc;
563 if(getClassType().getPrototype() != NULL)
565 FieldContainerTransitPtr tmpPtr =
566 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
568 fc = dynamic_pointer_cast<CubeTextureObjChunk>(tmpPtr);
571 return fc;
574 //! create a new instance of the class, copy the container flags
575 CubeTextureObjChunkTransitPtr CubeTextureObjChunkBase::createDependent(BitVector bFlags)
577 CubeTextureObjChunkTransitPtr fc;
579 if(getClassType().getPrototype() != NULL)
581 FieldContainerTransitPtr tmpPtr =
582 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
584 fc = dynamic_pointer_cast<CubeTextureObjChunk>(tmpPtr);
587 return fc;
590 //! create a new instance of the class
591 CubeTextureObjChunkTransitPtr CubeTextureObjChunkBase::create(void)
593 CubeTextureObjChunkTransitPtr fc;
595 if(getClassType().getPrototype() != NULL)
597 FieldContainerTransitPtr tmpPtr =
598 getClassType().getPrototype()-> shallowCopy();
600 fc = dynamic_pointer_cast<CubeTextureObjChunk>(tmpPtr);
603 return fc;
606 CubeTextureObjChunk *CubeTextureObjChunkBase::createEmptyLocal(BitVector bFlags)
608 CubeTextureObjChunk *returnValue;
610 newPtr<CubeTextureObjChunk>(returnValue, bFlags);
612 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
614 return returnValue;
617 //! create an empty new instance of the class, do not copy the prototype
618 CubeTextureObjChunk *CubeTextureObjChunkBase::createEmpty(void)
620 CubeTextureObjChunk *returnValue;
622 newPtr<CubeTextureObjChunk>(returnValue, Thread::getCurrentLocalFlags());
624 returnValue->_pFieldFlags->_bNamespaceMask &=
625 ~Thread::getCurrentLocalFlags();
627 return returnValue;
631 FieldContainerTransitPtr CubeTextureObjChunkBase::shallowCopyLocal(
632 BitVector bFlags) const
634 CubeTextureObjChunk *tmpPtr;
636 newPtr(tmpPtr, dynamic_cast<const CubeTextureObjChunk *>(this), bFlags);
638 FieldContainerTransitPtr returnValue(tmpPtr);
640 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
642 return returnValue;
645 FieldContainerTransitPtr CubeTextureObjChunkBase::shallowCopyDependent(
646 BitVector bFlags) const
648 CubeTextureObjChunk *tmpPtr;
650 newPtr(tmpPtr, dynamic_cast<const CubeTextureObjChunk *>(this), ~bFlags);
652 FieldContainerTransitPtr returnValue(tmpPtr);
654 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
656 return returnValue;
659 FieldContainerTransitPtr CubeTextureObjChunkBase::shallowCopy(void) const
661 CubeTextureObjChunk *tmpPtr;
663 newPtr(tmpPtr,
664 dynamic_cast<const CubeTextureObjChunk *>(this),
665 Thread::getCurrentLocalFlags());
667 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
669 FieldContainerTransitPtr returnValue(tmpPtr);
671 return returnValue;
677 /*------------------------- constructors ----------------------------------*/
679 CubeTextureObjChunkBase::CubeTextureObjChunkBase(void) :
680 Inherited(),
681 _sfPosZImage (NULL),
682 _sfPosXImage (NULL),
683 _sfNegXImage (NULL),
684 _sfPosYImage (NULL),
685 _sfNegYImage (NULL)
689 CubeTextureObjChunkBase::CubeTextureObjChunkBase(const CubeTextureObjChunkBase &source) :
690 Inherited(source),
691 _sfPosZImage (NULL),
692 _sfPosXImage (NULL),
693 _sfNegXImage (NULL),
694 _sfPosYImage (NULL),
695 _sfNegYImage (NULL)
700 /*-------------------------- destructors ----------------------------------*/
702 CubeTextureObjChunkBase::~CubeTextureObjChunkBase(void)
706 void CubeTextureObjChunkBase::onCreate(const CubeTextureObjChunk *source)
708 Inherited::onCreate(source);
710 if(source != NULL)
712 CubeTextureObjChunk *pThis = static_cast<CubeTextureObjChunk *>(this);
714 pThis->setPosZImage(source->getPosZImage());
716 pThis->setPosXImage(source->getPosXImage());
718 pThis->setNegXImage(source->getNegXImage());
720 pThis->setPosYImage(source->getPosYImage());
722 pThis->setNegYImage(source->getNegYImage());
726 GetFieldHandlePtr CubeTextureObjChunkBase::getHandlePosZImage (void) const
728 SFUnrecImagePtr::GetHandlePtr returnValue(
729 new SFUnrecImagePtr::GetHandle(
730 &_sfPosZImage,
731 this->getType().getFieldDesc(PosZImageFieldId),
732 const_cast<CubeTextureObjChunkBase *>(this)));
734 return returnValue;
737 EditFieldHandlePtr CubeTextureObjChunkBase::editHandlePosZImage (void)
739 SFUnrecImagePtr::EditHandlePtr returnValue(
740 new SFUnrecImagePtr::EditHandle(
741 &_sfPosZImage,
742 this->getType().getFieldDesc(PosZImageFieldId),
743 this));
745 returnValue->setSetMethod(
746 boost::bind(&CubeTextureObjChunk::setPosZImage,
747 static_cast<CubeTextureObjChunk *>(this), _1));
749 editSField(PosZImageFieldMask);
751 return returnValue;
754 GetFieldHandlePtr CubeTextureObjChunkBase::getHandlePosXImage (void) const
756 SFUnrecImagePtr::GetHandlePtr returnValue(
757 new SFUnrecImagePtr::GetHandle(
758 &_sfPosXImage,
759 this->getType().getFieldDesc(PosXImageFieldId),
760 const_cast<CubeTextureObjChunkBase *>(this)));
762 return returnValue;
765 EditFieldHandlePtr CubeTextureObjChunkBase::editHandlePosXImage (void)
767 SFUnrecImagePtr::EditHandlePtr returnValue(
768 new SFUnrecImagePtr::EditHandle(
769 &_sfPosXImage,
770 this->getType().getFieldDesc(PosXImageFieldId),
771 this));
773 returnValue->setSetMethod(
774 boost::bind(&CubeTextureObjChunk::setPosXImage,
775 static_cast<CubeTextureObjChunk *>(this), _1));
777 editSField(PosXImageFieldMask);
779 return returnValue;
782 GetFieldHandlePtr CubeTextureObjChunkBase::getHandleNegXImage (void) const
784 SFUnrecImagePtr::GetHandlePtr returnValue(
785 new SFUnrecImagePtr::GetHandle(
786 &_sfNegXImage,
787 this->getType().getFieldDesc(NegXImageFieldId),
788 const_cast<CubeTextureObjChunkBase *>(this)));
790 return returnValue;
793 EditFieldHandlePtr CubeTextureObjChunkBase::editHandleNegXImage (void)
795 SFUnrecImagePtr::EditHandlePtr returnValue(
796 new SFUnrecImagePtr::EditHandle(
797 &_sfNegXImage,
798 this->getType().getFieldDesc(NegXImageFieldId),
799 this));
801 returnValue->setSetMethod(
802 boost::bind(&CubeTextureObjChunk::setNegXImage,
803 static_cast<CubeTextureObjChunk *>(this), _1));
805 editSField(NegXImageFieldMask);
807 return returnValue;
810 GetFieldHandlePtr CubeTextureObjChunkBase::getHandlePosYImage (void) const
812 SFUnrecImagePtr::GetHandlePtr returnValue(
813 new SFUnrecImagePtr::GetHandle(
814 &_sfPosYImage,
815 this->getType().getFieldDesc(PosYImageFieldId),
816 const_cast<CubeTextureObjChunkBase *>(this)));
818 return returnValue;
821 EditFieldHandlePtr CubeTextureObjChunkBase::editHandlePosYImage (void)
823 SFUnrecImagePtr::EditHandlePtr returnValue(
824 new SFUnrecImagePtr::EditHandle(
825 &_sfPosYImage,
826 this->getType().getFieldDesc(PosYImageFieldId),
827 this));
829 returnValue->setSetMethod(
830 boost::bind(&CubeTextureObjChunk::setPosYImage,
831 static_cast<CubeTextureObjChunk *>(this), _1));
833 editSField(PosYImageFieldMask);
835 return returnValue;
838 GetFieldHandlePtr CubeTextureObjChunkBase::getHandleNegYImage (void) const
840 SFUnrecImagePtr::GetHandlePtr returnValue(
841 new SFUnrecImagePtr::GetHandle(
842 &_sfNegYImage,
843 this->getType().getFieldDesc(NegYImageFieldId),
844 const_cast<CubeTextureObjChunkBase *>(this)));
846 return returnValue;
849 EditFieldHandlePtr CubeTextureObjChunkBase::editHandleNegYImage (void)
851 SFUnrecImagePtr::EditHandlePtr returnValue(
852 new SFUnrecImagePtr::EditHandle(
853 &_sfNegYImage,
854 this->getType().getFieldDesc(NegYImageFieldId),
855 this));
857 returnValue->setSetMethod(
858 boost::bind(&CubeTextureObjChunk::setNegYImage,
859 static_cast<CubeTextureObjChunk *>(this), _1));
861 editSField(NegYImageFieldMask);
863 return returnValue;
867 #ifdef OSG_MT_CPTR_ASPECT
868 void CubeTextureObjChunkBase::execSyncV( FieldContainer &oFrom,
869 ConstFieldMaskArg whichField,
870 AspectOffsetStore &oOffsets,
871 ConstFieldMaskArg syncMode,
872 const UInt32 uiSyncInfo)
874 CubeTextureObjChunk *pThis = static_cast<CubeTextureObjChunk *>(this);
876 pThis->execSync(static_cast<CubeTextureObjChunk *>(&oFrom),
877 whichField,
878 oOffsets,
879 syncMode,
880 uiSyncInfo);
882 #endif
885 #ifdef OSG_MT_CPTR_ASPECT
886 FieldContainer *CubeTextureObjChunkBase::createAspectCopy(
887 const FieldContainer *pRefAspect) const
889 CubeTextureObjChunk *returnValue;
891 newAspectCopy(returnValue,
892 dynamic_cast<const CubeTextureObjChunk *>(pRefAspect),
893 dynamic_cast<const CubeTextureObjChunk *>(this));
895 return returnValue;
897 #endif
899 void CubeTextureObjChunkBase::resolveLinks(void)
901 Inherited::resolveLinks();
903 static_cast<CubeTextureObjChunk *>(this)->setPosZImage(NULL);
905 static_cast<CubeTextureObjChunk *>(this)->setPosXImage(NULL);
907 static_cast<CubeTextureObjChunk *>(this)->setNegXImage(NULL);
909 static_cast<CubeTextureObjChunk *>(this)->setPosYImage(NULL);
911 static_cast<CubeTextureObjChunk *>(this)->setNegYImage(NULL);
917 OSG_END_NAMESPACE