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 **
48 ** class GeoReferenceAttachment!
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 "OSGGeoReferenceAttachmentBase.h"
67 #include "OSGGeoReferenceAttachment.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::GeoReferenceAttachment
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 GeoReferenceAttachmentBase::_sfDatum
89 /*! \var Vec2f GeoReferenceAttachmentBase::_sfEllipsoidAxis
93 /*! \var Vec2f GeoReferenceAttachmentBase::_sfOrigin
97 /*! \var Vec2f GeoReferenceAttachmentBase::_sfPixelSize
101 /*! \var Real64 GeoReferenceAttachmentBase::_sfNoDataValue
106 /***************************************************************************\
107 * FieldType/FieldTrait Instantiation *
108 \***************************************************************************/
110 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
111 PointerType FieldTraits
<GeoReferenceAttachment
*, nsOSG
>::_type(
112 "GeoReferenceAttachmentPtr",
114 GeoReferenceAttachment::getClassType(),
118 OSG_FIELDTRAITS_GETTYPE_NS(GeoReferenceAttachment
*, nsOSG
)
120 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
121 GeoReferenceAttachment
*,
124 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
125 GeoReferenceAttachment
*,
128 /***************************************************************************\
129 * Field Description *
130 \***************************************************************************/
132 void GeoReferenceAttachmentBase::classDescInserter(TypeObject
&oType
)
134 FieldDescriptionBase
*pDesc
= NULL
;
137 pDesc
= new SFUInt32::Description(
138 SFUInt32::getClassType(),
141 DatumFieldId
, DatumFieldMask
,
143 (Field::SFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&GeoReferenceAttachment::editHandleDatum
),
145 static_cast<FieldGetMethodSig
>(&GeoReferenceAttachment::getHandleDatum
));
147 oType
.addInitialDesc(pDesc
);
149 pDesc
= new SFVec2f::Description(
150 SFVec2f::getClassType(),
153 EllipsoidAxisFieldId
, EllipsoidAxisFieldMask
,
155 (Field::SFDefaultFlags
| Field::FStdAccess
),
156 static_cast<FieldEditMethodSig
>(&GeoReferenceAttachment::editHandleEllipsoidAxis
),
157 static_cast<FieldGetMethodSig
>(&GeoReferenceAttachment::getHandleEllipsoidAxis
));
159 oType
.addInitialDesc(pDesc
);
161 pDesc
= new SFVec2f::Description(
162 SFVec2f::getClassType(),
165 OriginFieldId
, OriginFieldMask
,
167 (Field::SFDefaultFlags
| Field::FStdAccess
),
168 static_cast<FieldEditMethodSig
>(&GeoReferenceAttachment::editHandleOrigin
),
169 static_cast<FieldGetMethodSig
>(&GeoReferenceAttachment::getHandleOrigin
));
171 oType
.addInitialDesc(pDesc
);
173 pDesc
= new SFVec2f::Description(
174 SFVec2f::getClassType(),
177 PixelSizeFieldId
, PixelSizeFieldMask
,
179 (Field::SFDefaultFlags
| Field::FStdAccess
),
180 static_cast<FieldEditMethodSig
>(&GeoReferenceAttachment::editHandlePixelSize
),
181 static_cast<FieldGetMethodSig
>(&GeoReferenceAttachment::getHandlePixelSize
));
183 oType
.addInitialDesc(pDesc
);
185 pDesc
= new SFReal64::Description(
186 SFReal64::getClassType(),
189 NoDataValueFieldId
, NoDataValueFieldMask
,
191 (Field::SFDefaultFlags
| Field::FStdAccess
),
192 static_cast<FieldEditMethodSig
>(&GeoReferenceAttachment::editHandleNoDataValue
),
193 static_cast<FieldGetMethodSig
>(&GeoReferenceAttachment::getHandleNoDataValue
));
195 oType
.addInitialDesc(pDesc
);
199 GeoReferenceAttachmentBase::TypeObject
GeoReferenceAttachmentBase::_type(
200 GeoReferenceAttachmentBase::getClassname(),
201 Inherited::getClassname(),
202 "GeoReferenceAttachment",
204 reinterpret_cast<PrototypeCreateF
>(&GeoReferenceAttachmentBase::createEmptyLocal
),
205 reinterpret_cast<InitContainerF
>(&GeoReferenceAttachment::initMethod
),
206 reinterpret_cast<ExitContainerF
>(&GeoReferenceAttachment::exitMethod
),
207 reinterpret_cast<InitalInsertDescFunc
>(
208 reinterpret_cast<void *>(&GeoReferenceAttachment::classDescInserter
)),
211 "<?xml version=\"1.0\"?>\n"
214 " name=\"GeoReferenceAttachment\"\n"
215 " parent=\"Attachment\"\n"
216 " library=\"System\"\n"
217 " pointerfieldtypes=\"both\"\n"
218 " structure=\"concrete\"\n"
219 " systemcomponent=\"true\"\n"
220 " parentsystemcomponent=\"true\"\n"
221 " decoratable=\"false\"\n"
222 " docGroupBase=\"GrpSystemImage\"\n"
225 "\t name=\"datum\"\n"
226 "\t type=\"UInt32\"\n"
227 "\t cardinality=\"single\"\n"
228 "\t visibility=\"external\"\n"
229 "\t defaultValue=\"GeoReferenceAttachment::WGS84\"\n"
230 "\t access=\"public\"\n"
234 "\t name=\"ellipsoidAxis\"\n"
235 "\t type=\"Vec2f\"\n"
236 "\t cardinality=\"single\"\n"
237 "\t visibility=\"external\"\n"
238 "\t defaultValue=\"\"\n"
239 "\t access=\"public\"\n"
243 "\t name=\"origin\"\n"
244 "\t type=\"Vec2f\"\n"
245 "\t cardinality=\"single\"\n"
246 "\t visibility=\"external\"\n"
247 "\t defaultValue=\"\"\n"
248 "\t access=\"public\"\n"
252 "\t name=\"pixelSize\"\n"
253 "\t type=\"Vec2f\"\n"
254 "\t cardinality=\"single\"\n"
255 "\t visibility=\"external\"\n"
256 "\t defaultValue=\"\"\n"
257 "\t access=\"public\"\n"
261 "\t name=\"noDataValue\"\n"
262 "\t type=\"Real64\"\n"
263 "\t cardinality=\"single\"\n"
264 "\t visibility=\"external\"\n"
265 "\t defaultValue=\"\"\n"
266 "\t access=\"public\"\n"
269 "</FieldContainer>\n",
273 /*------------------------------ get -----------------------------------*/
275 FieldContainerType
&GeoReferenceAttachmentBase::getType(void)
280 const FieldContainerType
&GeoReferenceAttachmentBase::getType(void) const
285 UInt32
GeoReferenceAttachmentBase::getContainerSize(void) const
287 return sizeof(GeoReferenceAttachment
);
290 /*------------------------- decorator get ------------------------------*/
293 SFUInt32
*GeoReferenceAttachmentBase::editSFDatum(void)
295 editSField(DatumFieldMask
);
300 const SFUInt32
*GeoReferenceAttachmentBase::getSFDatum(void) const
306 SFVec2f
*GeoReferenceAttachmentBase::editSFEllipsoidAxis(void)
308 editSField(EllipsoidAxisFieldMask
);
310 return &_sfEllipsoidAxis
;
313 const SFVec2f
*GeoReferenceAttachmentBase::getSFEllipsoidAxis(void) const
315 return &_sfEllipsoidAxis
;
319 SFVec2f
*GeoReferenceAttachmentBase::editSFOrigin(void)
321 editSField(OriginFieldMask
);
326 const SFVec2f
*GeoReferenceAttachmentBase::getSFOrigin(void) const
332 SFVec2f
*GeoReferenceAttachmentBase::editSFPixelSize(void)
334 editSField(PixelSizeFieldMask
);
336 return &_sfPixelSize
;
339 const SFVec2f
*GeoReferenceAttachmentBase::getSFPixelSize(void) const
341 return &_sfPixelSize
;
345 SFReal64
*GeoReferenceAttachmentBase::editSFNoDataValue(void)
347 editSField(NoDataValueFieldMask
);
349 return &_sfNoDataValue
;
352 const SFReal64
*GeoReferenceAttachmentBase::getSFNoDataValue(void) const
354 return &_sfNoDataValue
;
362 /*------------------------------ access -----------------------------------*/
364 SizeT
GeoReferenceAttachmentBase::getBinSize(ConstFieldMaskArg whichField
)
366 SizeT returnValue
= Inherited::getBinSize(whichField
);
368 if(FieldBits::NoField
!= (DatumFieldMask
& whichField
))
370 returnValue
+= _sfDatum
.getBinSize();
372 if(FieldBits::NoField
!= (EllipsoidAxisFieldMask
& whichField
))
374 returnValue
+= _sfEllipsoidAxis
.getBinSize();
376 if(FieldBits::NoField
!= (OriginFieldMask
& whichField
))
378 returnValue
+= _sfOrigin
.getBinSize();
380 if(FieldBits::NoField
!= (PixelSizeFieldMask
& whichField
))
382 returnValue
+= _sfPixelSize
.getBinSize();
384 if(FieldBits::NoField
!= (NoDataValueFieldMask
& whichField
))
386 returnValue
+= _sfNoDataValue
.getBinSize();
392 void GeoReferenceAttachmentBase::copyToBin(BinaryDataHandler
&pMem
,
393 ConstFieldMaskArg whichField
)
395 Inherited::copyToBin(pMem
, whichField
);
397 if(FieldBits::NoField
!= (DatumFieldMask
& whichField
))
399 _sfDatum
.copyToBin(pMem
);
401 if(FieldBits::NoField
!= (EllipsoidAxisFieldMask
& whichField
))
403 _sfEllipsoidAxis
.copyToBin(pMem
);
405 if(FieldBits::NoField
!= (OriginFieldMask
& whichField
))
407 _sfOrigin
.copyToBin(pMem
);
409 if(FieldBits::NoField
!= (PixelSizeFieldMask
& whichField
))
411 _sfPixelSize
.copyToBin(pMem
);
413 if(FieldBits::NoField
!= (NoDataValueFieldMask
& whichField
))
415 _sfNoDataValue
.copyToBin(pMem
);
419 void GeoReferenceAttachmentBase::copyFromBin(BinaryDataHandler
&pMem
,
420 ConstFieldMaskArg whichField
)
422 Inherited::copyFromBin(pMem
, whichField
);
424 if(FieldBits::NoField
!= (DatumFieldMask
& whichField
))
426 editSField(DatumFieldMask
);
427 _sfDatum
.copyFromBin(pMem
);
429 if(FieldBits::NoField
!= (EllipsoidAxisFieldMask
& whichField
))
431 editSField(EllipsoidAxisFieldMask
);
432 _sfEllipsoidAxis
.copyFromBin(pMem
);
434 if(FieldBits::NoField
!= (OriginFieldMask
& whichField
))
436 editSField(OriginFieldMask
);
437 _sfOrigin
.copyFromBin(pMem
);
439 if(FieldBits::NoField
!= (PixelSizeFieldMask
& whichField
))
441 editSField(PixelSizeFieldMask
);
442 _sfPixelSize
.copyFromBin(pMem
);
444 if(FieldBits::NoField
!= (NoDataValueFieldMask
& whichField
))
446 editSField(NoDataValueFieldMask
);
447 _sfNoDataValue
.copyFromBin(pMem
);
451 //! create a new instance of the class
452 GeoReferenceAttachmentTransitPtr
GeoReferenceAttachmentBase::createLocal(BitVector bFlags
)
454 GeoReferenceAttachmentTransitPtr fc
;
456 if(getClassType().getPrototype() != NULL
)
458 FieldContainerTransitPtr tmpPtr
=
459 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
461 fc
= dynamic_pointer_cast
<GeoReferenceAttachment
>(tmpPtr
);
467 //! create a new instance of the class, copy the container flags
468 GeoReferenceAttachmentTransitPtr
GeoReferenceAttachmentBase::createDependent(BitVector bFlags
)
470 GeoReferenceAttachmentTransitPtr fc
;
472 if(getClassType().getPrototype() != NULL
)
474 FieldContainerTransitPtr tmpPtr
=
475 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
477 fc
= dynamic_pointer_cast
<GeoReferenceAttachment
>(tmpPtr
);
483 //! create a new instance of the class
484 GeoReferenceAttachmentTransitPtr
GeoReferenceAttachmentBase::create(void)
486 GeoReferenceAttachmentTransitPtr fc
;
488 if(getClassType().getPrototype() != NULL
)
490 FieldContainerTransitPtr tmpPtr
=
491 getClassType().getPrototype()-> shallowCopy();
493 fc
= dynamic_pointer_cast
<GeoReferenceAttachment
>(tmpPtr
);
499 GeoReferenceAttachment
*GeoReferenceAttachmentBase::createEmptyLocal(BitVector bFlags
)
501 GeoReferenceAttachment
*returnValue
;
503 newPtr
<GeoReferenceAttachment
>(returnValue
, bFlags
);
505 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
510 //! create an empty new instance of the class, do not copy the prototype
511 GeoReferenceAttachment
*GeoReferenceAttachmentBase::createEmpty(void)
513 GeoReferenceAttachment
*returnValue
;
515 newPtr
<GeoReferenceAttachment
>(returnValue
, Thread::getCurrentLocalFlags());
517 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
518 ~Thread::getCurrentLocalFlags();
524 FieldContainerTransitPtr
GeoReferenceAttachmentBase::shallowCopyLocal(
525 BitVector bFlags
) const
527 GeoReferenceAttachment
*tmpPtr
;
529 newPtr(tmpPtr
, dynamic_cast<const GeoReferenceAttachment
*>(this), bFlags
);
531 FieldContainerTransitPtr
returnValue(tmpPtr
);
533 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
538 FieldContainerTransitPtr
GeoReferenceAttachmentBase::shallowCopyDependent(
539 BitVector bFlags
) const
541 GeoReferenceAttachment
*tmpPtr
;
543 newPtr(tmpPtr
, dynamic_cast<const GeoReferenceAttachment
*>(this), ~bFlags
);
545 FieldContainerTransitPtr
returnValue(tmpPtr
);
547 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
552 FieldContainerTransitPtr
GeoReferenceAttachmentBase::shallowCopy(void) const
554 GeoReferenceAttachment
*tmpPtr
;
557 dynamic_cast<const GeoReferenceAttachment
*>(this),
558 Thread::getCurrentLocalFlags());
560 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
562 FieldContainerTransitPtr
returnValue(tmpPtr
);
570 /*------------------------- constructors ----------------------------------*/
572 GeoReferenceAttachmentBase::GeoReferenceAttachmentBase(void) :
574 _sfDatum (UInt32(GeoReferenceAttachment::WGS84
)),
582 GeoReferenceAttachmentBase::GeoReferenceAttachmentBase(const GeoReferenceAttachmentBase
&source
) :
584 _sfDatum (source
._sfDatum
),
585 _sfEllipsoidAxis (source
._sfEllipsoidAxis
),
586 _sfOrigin (source
._sfOrigin
),
587 _sfPixelSize (source
._sfPixelSize
),
588 _sfNoDataValue (source
._sfNoDataValue
)
593 /*-------------------------- destructors ----------------------------------*/
595 GeoReferenceAttachmentBase::~GeoReferenceAttachmentBase(void)
600 GetFieldHandlePtr
GeoReferenceAttachmentBase::getHandleDatum (void) const
602 SFUInt32::GetHandlePtr
returnValue(
603 new SFUInt32::GetHandle(
605 this->getType().getFieldDesc(DatumFieldId
),
606 const_cast<GeoReferenceAttachmentBase
*>(this)));
611 EditFieldHandlePtr
GeoReferenceAttachmentBase::editHandleDatum (void)
613 SFUInt32::EditHandlePtr
returnValue(
614 new SFUInt32::EditHandle(
616 this->getType().getFieldDesc(DatumFieldId
),
620 editSField(DatumFieldMask
);
625 GetFieldHandlePtr
GeoReferenceAttachmentBase::getHandleEllipsoidAxis (void) const
627 SFVec2f::GetHandlePtr
returnValue(
628 new SFVec2f::GetHandle(
630 this->getType().getFieldDesc(EllipsoidAxisFieldId
),
631 const_cast<GeoReferenceAttachmentBase
*>(this)));
636 EditFieldHandlePtr
GeoReferenceAttachmentBase::editHandleEllipsoidAxis (void)
638 SFVec2f::EditHandlePtr
returnValue(
639 new SFVec2f::EditHandle(
641 this->getType().getFieldDesc(EllipsoidAxisFieldId
),
645 editSField(EllipsoidAxisFieldMask
);
650 GetFieldHandlePtr
GeoReferenceAttachmentBase::getHandleOrigin (void) const
652 SFVec2f::GetHandlePtr
returnValue(
653 new SFVec2f::GetHandle(
655 this->getType().getFieldDesc(OriginFieldId
),
656 const_cast<GeoReferenceAttachmentBase
*>(this)));
661 EditFieldHandlePtr
GeoReferenceAttachmentBase::editHandleOrigin (void)
663 SFVec2f::EditHandlePtr
returnValue(
664 new SFVec2f::EditHandle(
666 this->getType().getFieldDesc(OriginFieldId
),
670 editSField(OriginFieldMask
);
675 GetFieldHandlePtr
GeoReferenceAttachmentBase::getHandlePixelSize (void) const
677 SFVec2f::GetHandlePtr
returnValue(
678 new SFVec2f::GetHandle(
680 this->getType().getFieldDesc(PixelSizeFieldId
),
681 const_cast<GeoReferenceAttachmentBase
*>(this)));
686 EditFieldHandlePtr
GeoReferenceAttachmentBase::editHandlePixelSize (void)
688 SFVec2f::EditHandlePtr
returnValue(
689 new SFVec2f::EditHandle(
691 this->getType().getFieldDesc(PixelSizeFieldId
),
695 editSField(PixelSizeFieldMask
);
700 GetFieldHandlePtr
GeoReferenceAttachmentBase::getHandleNoDataValue (void) const
702 SFReal64::GetHandlePtr
returnValue(
703 new SFReal64::GetHandle(
705 this->getType().getFieldDesc(NoDataValueFieldId
),
706 const_cast<GeoReferenceAttachmentBase
*>(this)));
711 EditFieldHandlePtr
GeoReferenceAttachmentBase::editHandleNoDataValue (void)
713 SFReal64::EditHandlePtr
returnValue(
714 new SFReal64::EditHandle(
716 this->getType().getFieldDesc(NoDataValueFieldId
),
720 editSField(NoDataValueFieldMask
);
726 #ifdef OSG_MT_CPTR_ASPECT
727 void GeoReferenceAttachmentBase::execSyncV( FieldContainer
&oFrom
,
728 ConstFieldMaskArg whichField
,
729 AspectOffsetStore
&oOffsets
,
730 ConstFieldMaskArg syncMode
,
731 const UInt32 uiSyncInfo
)
733 GeoReferenceAttachment
*pThis
= static_cast<GeoReferenceAttachment
*>(this);
735 pThis
->execSync(static_cast<GeoReferenceAttachment
*>(&oFrom
),
744 #ifdef OSG_MT_CPTR_ASPECT
745 FieldContainer
*GeoReferenceAttachmentBase::createAspectCopy(
746 const FieldContainer
*pRefAspect
) const
748 GeoReferenceAttachment
*returnValue
;
750 newAspectCopy(returnValue
,
751 dynamic_cast<const GeoReferenceAttachment
*>(pRefAspect
),
752 dynamic_cast<const GeoReferenceAttachment
*>(this));
758 void GeoReferenceAttachmentBase::resolveLinks(void)
760 Inherited::resolveLinks();