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 **
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 "OSGImageFileBase.h"
67 #include "OSGImageFile.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::ImageFile
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string ImageFileBase::_sfUrl
90 /***************************************************************************\
91 * FieldType/FieldTrait Instantiation *
92 \***************************************************************************/
94 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
95 PointerType FieldTraits
<ImageFile
*, nsOSG
>::_type(
98 ImageFile::getClassType(),
102 OSG_FIELDTRAITS_GETTYPE_NS(ImageFile
*, nsOSG
)
104 /***************************************************************************\
105 * Field Description *
106 \***************************************************************************/
108 void ImageFileBase::classDescInserter(TypeObject
&oType
)
110 FieldDescriptionBase
*pDesc
= NULL
;
113 pDesc
= new SFString::Description(
114 SFString::getClassType(),
117 UrlFieldId
, UrlFieldMask
,
119 (Field::FClusterLocal
),
120 static_cast<FieldEditMethodSig
>(&ImageFile::editHandleUrl
),
121 static_cast<FieldGetMethodSig
>(&ImageFile::getHandleUrl
));
123 oType
.addInitialDesc(pDesc
);
127 ImageFileBase::TypeObject
ImageFileBase::_type(
128 ImageFileBase::getClassname(),
129 Inherited::getClassname(),
132 reinterpret_cast<PrototypeCreateF
>(&ImageFileBase::createEmptyLocal
),
133 reinterpret_cast<InitContainerF
>(&ImageFile::initMethod
),
134 reinterpret_cast<ExitContainerF
>(&ImageFile::exitMethod
),
135 reinterpret_cast<InitalInsertDescFunc
>(
136 reinterpret_cast<void *>(&ImageFile::classDescInserter
)),
139 "<?xml version=\"1.0\"?>\n"
142 " name=\"ImageFile\"\n"
143 " parent=\"Image\"\n"
144 " library=\"ContribCSM\"\n"
145 " pointerfieldtypes=\"none\"\n"
146 " structure=\"concrete\"\n"
147 " systemcomponent=\"true\"\n"
148 " parentsystemcomponent=\"true\"\n"
149 " decoratable=\"false\"\n"
150 " useLocalIncludes=\"false\"\n"
151 " isNodeCore=\"false\"\n"
152 " isBundle=\"false\"\n"
153 " parentFields=\"none\"\n"
157 " type=\"std::string\"\n"
158 " cardinality=\"single\"\n"
159 " visibility=\"external\"\n"
160 " access=\"public\"\n"
161 " fieldFlags=\"FClusterLocal\"\n"
164 "</FieldContainer>\n",
168 /*------------------------------ get -----------------------------------*/
170 FieldContainerType
&ImageFileBase::getType(void)
175 const FieldContainerType
&ImageFileBase::getType(void) const
180 UInt32
ImageFileBase::getContainerSize(void) const
182 return sizeof(ImageFile
);
185 /*------------------------- decorator get ------------------------------*/
188 SFString
*ImageFileBase::editSFUrl(void)
190 editSField(UrlFieldMask
);
195 const SFString
*ImageFileBase::getSFUrl(void) const
205 /*------------------------------ access -----------------------------------*/
207 SizeT
ImageFileBase::getBinSize(ConstFieldMaskArg whichField
)
209 SizeT returnValue
= Inherited::getBinSize(whichField
);
211 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
213 returnValue
+= _sfUrl
.getBinSize();
219 void ImageFileBase::copyToBin(BinaryDataHandler
&pMem
,
220 ConstFieldMaskArg whichField
)
222 Inherited::copyToBin(pMem
, whichField
);
224 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
226 _sfUrl
.copyToBin(pMem
);
230 void ImageFileBase::copyFromBin(BinaryDataHandler
&pMem
,
231 ConstFieldMaskArg whichField
)
233 Inherited::copyFromBin(pMem
, whichField
);
235 if(FieldBits::NoField
!= (UrlFieldMask
& whichField
))
237 editSField(UrlFieldMask
);
238 _sfUrl
.copyFromBin(pMem
);
242 //! create a new instance of the class
243 ImageFileTransitPtr
ImageFileBase::createLocal(BitVector bFlags
)
245 ImageFileTransitPtr fc
;
247 if(getClassType().getPrototype() != NULL
)
249 FieldContainerTransitPtr tmpPtr
=
250 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
252 fc
= dynamic_pointer_cast
<ImageFile
>(tmpPtr
);
258 //! create a new instance of the class, copy the container flags
259 ImageFileTransitPtr
ImageFileBase::createDependent(BitVector bFlags
)
261 ImageFileTransitPtr fc
;
263 if(getClassType().getPrototype() != NULL
)
265 FieldContainerTransitPtr tmpPtr
=
266 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
268 fc
= dynamic_pointer_cast
<ImageFile
>(tmpPtr
);
274 //! create a new instance of the class
275 ImageFileTransitPtr
ImageFileBase::create(void)
277 ImageFileTransitPtr fc
;
279 if(getClassType().getPrototype() != NULL
)
281 FieldContainerTransitPtr tmpPtr
=
282 getClassType().getPrototype()-> shallowCopy();
284 fc
= dynamic_pointer_cast
<ImageFile
>(tmpPtr
);
290 ImageFile
*ImageFileBase::createEmptyLocal(BitVector bFlags
)
292 ImageFile
*returnValue
;
294 newPtr
<ImageFile
>(returnValue
, bFlags
);
296 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
301 //! create an empty new instance of the class, do not copy the prototype
302 ImageFile
*ImageFileBase::createEmpty(void)
304 ImageFile
*returnValue
;
306 newPtr
<ImageFile
>(returnValue
, Thread::getCurrentLocalFlags());
308 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
309 ~Thread::getCurrentLocalFlags();
315 FieldContainerTransitPtr
ImageFileBase::shallowCopyLocal(
316 BitVector bFlags
) const
320 newPtr(tmpPtr
, dynamic_cast<const ImageFile
*>(this), bFlags
);
322 FieldContainerTransitPtr
returnValue(tmpPtr
);
324 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
329 FieldContainerTransitPtr
ImageFileBase::shallowCopyDependent(
330 BitVector bFlags
) const
334 newPtr(tmpPtr
, dynamic_cast<const ImageFile
*>(this), ~bFlags
);
336 FieldContainerTransitPtr
returnValue(tmpPtr
);
338 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
343 FieldContainerTransitPtr
ImageFileBase::shallowCopy(void) const
348 dynamic_cast<const ImageFile
*>(this),
349 Thread::getCurrentLocalFlags());
351 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
353 FieldContainerTransitPtr
returnValue(tmpPtr
);
361 /*------------------------- constructors ----------------------------------*/
363 ImageFileBase::ImageFileBase(void) :
369 ImageFileBase::ImageFileBase(const ImageFileBase
&source
) :
371 _sfUrl (source
._sfUrl
)
376 /*-------------------------- destructors ----------------------------------*/
378 ImageFileBase::~ImageFileBase(void)
383 GetFieldHandlePtr
ImageFileBase::getHandleUrl (void) const
385 SFString::GetHandlePtr
returnValue(
386 new SFString::GetHandle(
388 this->getType().getFieldDesc(UrlFieldId
),
389 const_cast<ImageFileBase
*>(this)));
394 EditFieldHandlePtr
ImageFileBase::editHandleUrl (void)
396 SFString::EditHandlePtr
returnValue(
397 new SFString::EditHandle(
399 this->getType().getFieldDesc(UrlFieldId
),
403 editSField(UrlFieldMask
);
409 #ifdef OSG_MT_CPTR_ASPECT
410 void ImageFileBase::execSyncV( FieldContainer
&oFrom
,
411 ConstFieldMaskArg whichField
,
412 AspectOffsetStore
&oOffsets
,
413 ConstFieldMaskArg syncMode
,
414 const UInt32 uiSyncInfo
)
416 ImageFile
*pThis
= static_cast<ImageFile
*>(this);
418 pThis
->execSync(static_cast<ImageFile
*>(&oFrom
),
427 #ifdef OSG_MT_CPTR_ASPECT
428 FieldContainer
*ImageFileBase::createAspectCopy(
429 const FieldContainer
*pRefAspect
) const
431 ImageFile
*returnValue
;
433 newAspectCopy(returnValue
,
434 dynamic_cast<const ImageFile
*>(pRefAspect
),
435 dynamic_cast<const ImageFile
*>(this));
441 void ImageFileBase::resolveLinks(void)
443 Inherited::resolveLinks();