changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Helper / OSGImageFileBase.cpp
blob1f3e6fe961f998a7bd79bca151f6a477b6d8b2e3
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 ImageFile!
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"
66 #include "OSGImageFileBase.h"
67 #include "OSGImageFile.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(
96 "ImageFilePtr",
97 "ImagePtr",
98 ImageFile::getClassType(),
99 nsOSG);
100 #endif
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(),
115 "url",
117 UrlFieldId, UrlFieldMask,
118 false,
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(),
130 "NULL",
131 nsOSG, //Namespace
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)),
137 false,
139 "<?xml version=\"1.0\"?>\n"
140 "\n"
141 "<FieldContainer\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"
154 " >\n"
155 " <Field\n"
156 " name=\"url\"\n"
157 " type=\"std::string\"\n"
158 " cardinality=\"single\"\n"
159 " visibility=\"external\"\n"
160 " access=\"public\"\n"
161 " fieldFlags=\"FClusterLocal\"\n"
162 "\t>\n"
163 " </Field>\n"
164 "</FieldContainer>\n",
168 /*------------------------------ get -----------------------------------*/
170 FieldContainerType &ImageFileBase::getType(void)
172 return _type;
175 const FieldContainerType &ImageFileBase::getType(void) const
177 return _type;
180 UInt32 ImageFileBase::getContainerSize(void) const
182 return sizeof(ImageFile);
185 /*------------------------- decorator get ------------------------------*/
188 SFString *ImageFileBase::editSFUrl(void)
190 editSField(UrlFieldMask);
192 return &_sfUrl;
195 const SFString *ImageFileBase::getSFUrl(void) const
197 return &_sfUrl;
205 /*------------------------------ access -----------------------------------*/
207 SizeT ImageFileBase::getBinSize(ConstFieldMaskArg whichField)
209 SizeT returnValue = Inherited::getBinSize(whichField);
211 if(FieldBits::NoField != (UrlFieldMask & whichField))
213 returnValue += _sfUrl.getBinSize();
216 return returnValue;
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);
255 return fc;
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);
271 return fc;
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);
287 return fc;
290 ImageFile *ImageFileBase::createEmptyLocal(BitVector bFlags)
292 ImageFile *returnValue;
294 newPtr<ImageFile>(returnValue, bFlags);
296 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
298 return returnValue;
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();
311 return returnValue;
315 FieldContainerTransitPtr ImageFileBase::shallowCopyLocal(
316 BitVector bFlags) const
318 ImageFile *tmpPtr;
320 newPtr(tmpPtr, dynamic_cast<const ImageFile *>(this), bFlags);
322 FieldContainerTransitPtr returnValue(tmpPtr);
324 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
326 return returnValue;
329 FieldContainerTransitPtr ImageFileBase::shallowCopyDependent(
330 BitVector bFlags) const
332 ImageFile *tmpPtr;
334 newPtr(tmpPtr, dynamic_cast<const ImageFile *>(this), ~bFlags);
336 FieldContainerTransitPtr returnValue(tmpPtr);
338 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
340 return returnValue;
343 FieldContainerTransitPtr ImageFileBase::shallowCopy(void) const
345 ImageFile *tmpPtr;
347 newPtr(tmpPtr,
348 dynamic_cast<const ImageFile *>(this),
349 Thread::getCurrentLocalFlags());
351 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
353 FieldContainerTransitPtr returnValue(tmpPtr);
355 return returnValue;
361 /*------------------------- constructors ----------------------------------*/
363 ImageFileBase::ImageFileBase(void) :
364 Inherited(),
365 _sfUrl ()
369 ImageFileBase::ImageFileBase(const ImageFileBase &source) :
370 Inherited(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(
387 &_sfUrl,
388 this->getType().getFieldDesc(UrlFieldId),
389 const_cast<ImageFileBase *>(this)));
391 return returnValue;
394 EditFieldHandlePtr ImageFileBase::editHandleUrl (void)
396 SFString::EditHandlePtr returnValue(
397 new SFString::EditHandle(
398 &_sfUrl,
399 this->getType().getFieldDesc(UrlFieldId),
400 this));
403 editSField(UrlFieldMask);
405 return returnValue;
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),
419 whichField,
420 oOffsets,
421 syncMode,
422 uiSyncInfo);
424 #endif
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));
437 return returnValue;
439 #endif
441 void ImageFileBase::resolveLinks(void)
443 Inherited::resolveLinks();
449 OSG_END_NAMESPACE