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 CSMSortFirstWinOptions!
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 "OSGCSMSortFirstWinOptionsBase.h"
67 #include "OSGCSMSortFirstWinOptions.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CSMSortFirstWinOptions
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var std::string CSMSortFirstWinOptionsBase::_sfCompression
89 /*! \var UInt32 CSMSortFirstWinOptionsBase::_sfSubtileSize
93 /*! \var bool CSMSortFirstWinOptionsBase::_sfCompose
97 /*! \var bool CSMSortFirstWinOptionsBase::_sfUseFaceDistribution
98 Enabe, disable analysation of face distribution
102 /***************************************************************************\
103 * FieldType/FieldTrait Instantiation *
104 \***************************************************************************/
106 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
107 PointerType FieldTraits
<CSMSortFirstWinOptions
*, nsOSG
>::_type(
108 "CSMSortFirstWinOptionsPtr",
109 "CSMClusterWinOptionsPtr",
110 CSMSortFirstWinOptions::getClassType(),
114 OSG_FIELDTRAITS_GETTYPE_NS(CSMSortFirstWinOptions
*, nsOSG
)
116 /***************************************************************************\
117 * Field Description *
118 \***************************************************************************/
120 void CSMSortFirstWinOptionsBase::classDescInserter(TypeObject
&oType
)
122 FieldDescriptionBase
*pDesc
= NULL
;
125 pDesc
= new SFString::Description(
126 SFString::getClassType(),
129 CompressionFieldId
, CompressionFieldMask
,
131 (Field::SFDefaultFlags
| Field::FStdAccess
),
132 static_cast<FieldEditMethodSig
>(&CSMSortFirstWinOptions::editHandleCompression
),
133 static_cast<FieldGetMethodSig
>(&CSMSortFirstWinOptions::getHandleCompression
));
135 oType
.addInitialDesc(pDesc
);
137 pDesc
= new SFUInt32::Description(
138 SFUInt32::getClassType(),
141 SubtileSizeFieldId
, SubtileSizeFieldMask
,
143 (Field::SFDefaultFlags
| Field::FStdAccess
),
144 static_cast<FieldEditMethodSig
>(&CSMSortFirstWinOptions::editHandleSubtileSize
),
145 static_cast<FieldGetMethodSig
>(&CSMSortFirstWinOptions::getHandleSubtileSize
));
147 oType
.addInitialDesc(pDesc
);
149 pDesc
= new SFBool::Description(
150 SFBool::getClassType(),
153 ComposeFieldId
, ComposeFieldMask
,
155 (Field::SFDefaultFlags
| Field::FStdAccess
),
156 static_cast<FieldEditMethodSig
>(&CSMSortFirstWinOptions::editHandleCompose
),
157 static_cast<FieldGetMethodSig
>(&CSMSortFirstWinOptions::getHandleCompose
));
159 oType
.addInitialDesc(pDesc
);
161 pDesc
= new SFBool::Description(
162 SFBool::getClassType(),
163 "useFaceDistribution",
164 "Enabe, disable analysation of face distribution\n",
165 UseFaceDistributionFieldId
, UseFaceDistributionFieldMask
,
167 (Field::SFDefaultFlags
| Field::FStdAccess
),
168 static_cast<FieldEditMethodSig
>(&CSMSortFirstWinOptions::editHandleUseFaceDistribution
),
169 static_cast<FieldGetMethodSig
>(&CSMSortFirstWinOptions::getHandleUseFaceDistribution
));
171 oType
.addInitialDesc(pDesc
);
175 CSMSortFirstWinOptionsBase::TypeObject
CSMSortFirstWinOptionsBase::_type(
176 CSMSortFirstWinOptionsBase::getClassname(),
177 Inherited::getClassname(),
180 reinterpret_cast<PrototypeCreateF
>(&CSMSortFirstWinOptionsBase::createEmptyLocal
),
181 reinterpret_cast<InitContainerF
>(&CSMSortFirstWinOptions::initMethod
),
182 reinterpret_cast<ExitContainerF
>(&CSMSortFirstWinOptions::exitMethod
),
183 reinterpret_cast<InitalInsertDescFunc
>(
184 reinterpret_cast<void *>(&CSMSortFirstWinOptions::classDescInserter
)),
187 "<?xml version=\"1.0\"?>\n"
190 " name=\"CSMSortFirstWinOptions\"\n"
191 " parent=\"CSMClusterWinOptions\"\n"
192 " library=\"ContribCSM\"\n"
193 " pointerfieldtypes=\"none\"\n"
194 " structure=\"concrete\"\n"
195 " systemcomponent=\"true\"\n"
196 " parentsystemcomponent=\"true\"\n"
197 " decoratable=\"false\"\n"
198 " useLocalIncludes=\"false\"\n"
199 " isNodeCore=\"false\"\n"
200 " isBundle=\"true\"\n"
201 " parentFields=\"none\"\n"
204 "\t\tname=\"compression\"\n"
205 "\t\ttype=\"std::string\"\n"
206 "\t\tcardinality=\"single\"\n"
207 "\t\tvisibility=\"external\"\n"
208 "\t\taccess=\"public\"\n"
212 "\t\tname=\"subtileSize\"\n"
213 "\t\ttype=\"UInt32\"\n"
214 "\t\tcardinality=\"single\"\n"
215 "\t\tvisibility=\"external\"\n"
216 "\t\tdefaultValue=\"32\"\n"
217 "\t\taccess=\"public\"\n"
221 "\t\tname=\"compose\"\n"
222 "\t\ttype=\"bool\"\n"
223 "\t\tcardinality=\"single\"\n"
224 "\t\tvisibility=\"external\"\n"
225 "\t\tdefaultValue=\"true\"\n"
226 "\t\taccess=\"public\"\n"
230 "\t\tname=\"useFaceDistribution\"\n"
231 "\t\ttype=\"bool\"\n"
232 "\t\tcardinality=\"single\"\n"
233 "\t\tvisibility=\"external\"\n"
234 "\t\tdefaultValue=\"false\"\n"
235 "\t\taccess=\"public\"\n"
237 "\tEnabe, disable analysation of face distribution\n"
239 "</FieldContainer>\n",
243 /*------------------------------ get -----------------------------------*/
245 FieldContainerType
&CSMSortFirstWinOptionsBase::getType(void)
250 const FieldContainerType
&CSMSortFirstWinOptionsBase::getType(void) const
255 UInt32
CSMSortFirstWinOptionsBase::getContainerSize(void) const
257 return sizeof(CSMSortFirstWinOptions
);
260 /*------------------------- decorator get ------------------------------*/
263 SFString
*CSMSortFirstWinOptionsBase::editSFCompression(void)
265 editSField(CompressionFieldMask
);
267 return &_sfCompression
;
270 const SFString
*CSMSortFirstWinOptionsBase::getSFCompression(void) const
272 return &_sfCompression
;
276 SFUInt32
*CSMSortFirstWinOptionsBase::editSFSubtileSize(void)
278 editSField(SubtileSizeFieldMask
);
280 return &_sfSubtileSize
;
283 const SFUInt32
*CSMSortFirstWinOptionsBase::getSFSubtileSize(void) const
285 return &_sfSubtileSize
;
289 SFBool
*CSMSortFirstWinOptionsBase::editSFCompose(void)
291 editSField(ComposeFieldMask
);
296 const SFBool
*CSMSortFirstWinOptionsBase::getSFCompose(void) const
302 SFBool
*CSMSortFirstWinOptionsBase::editSFUseFaceDistribution(void)
304 editSField(UseFaceDistributionFieldMask
);
306 return &_sfUseFaceDistribution
;
309 const SFBool
*CSMSortFirstWinOptionsBase::getSFUseFaceDistribution(void) const
311 return &_sfUseFaceDistribution
;
319 /*------------------------------ access -----------------------------------*/
321 SizeT
CSMSortFirstWinOptionsBase::getBinSize(ConstFieldMaskArg whichField
)
323 SizeT returnValue
= Inherited::getBinSize(whichField
);
325 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
327 returnValue
+= _sfCompression
.getBinSize();
329 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
331 returnValue
+= _sfSubtileSize
.getBinSize();
333 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
335 returnValue
+= _sfCompose
.getBinSize();
337 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
339 returnValue
+= _sfUseFaceDistribution
.getBinSize();
345 void CSMSortFirstWinOptionsBase::copyToBin(BinaryDataHandler
&pMem
,
346 ConstFieldMaskArg whichField
)
348 Inherited::copyToBin(pMem
, whichField
);
350 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
352 _sfCompression
.copyToBin(pMem
);
354 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
356 _sfSubtileSize
.copyToBin(pMem
);
358 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
360 _sfCompose
.copyToBin(pMem
);
362 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
364 _sfUseFaceDistribution
.copyToBin(pMem
);
368 void CSMSortFirstWinOptionsBase::copyFromBin(BinaryDataHandler
&pMem
,
369 ConstFieldMaskArg whichField
)
371 Inherited::copyFromBin(pMem
, whichField
);
373 if(FieldBits::NoField
!= (CompressionFieldMask
& whichField
))
375 editSField(CompressionFieldMask
);
376 _sfCompression
.copyFromBin(pMem
);
378 if(FieldBits::NoField
!= (SubtileSizeFieldMask
& whichField
))
380 editSField(SubtileSizeFieldMask
);
381 _sfSubtileSize
.copyFromBin(pMem
);
383 if(FieldBits::NoField
!= (ComposeFieldMask
& whichField
))
385 editSField(ComposeFieldMask
);
386 _sfCompose
.copyFromBin(pMem
);
388 if(FieldBits::NoField
!= (UseFaceDistributionFieldMask
& whichField
))
390 editSField(UseFaceDistributionFieldMask
);
391 _sfUseFaceDistribution
.copyFromBin(pMem
);
395 //! create a new instance of the class
396 CSMSortFirstWinOptionsTransitPtr
CSMSortFirstWinOptionsBase::createLocal(BitVector bFlags
)
398 CSMSortFirstWinOptionsTransitPtr fc
;
400 if(getClassType().getPrototype() != NULL
)
402 FieldContainerTransitPtr tmpPtr
=
403 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
405 fc
= dynamic_pointer_cast
<CSMSortFirstWinOptions
>(tmpPtr
);
411 //! create a new instance of the class, copy the container flags
412 CSMSortFirstWinOptionsTransitPtr
CSMSortFirstWinOptionsBase::createDependent(BitVector bFlags
)
414 CSMSortFirstWinOptionsTransitPtr fc
;
416 if(getClassType().getPrototype() != NULL
)
418 FieldContainerTransitPtr tmpPtr
=
419 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
421 fc
= dynamic_pointer_cast
<CSMSortFirstWinOptions
>(tmpPtr
);
427 //! create a new instance of the class
428 CSMSortFirstWinOptionsTransitPtr
CSMSortFirstWinOptionsBase::create(void)
430 return createLocal();
433 CSMSortFirstWinOptions
*CSMSortFirstWinOptionsBase::createEmptyLocal(BitVector bFlags
)
435 CSMSortFirstWinOptions
*returnValue
;
437 newPtr
<CSMSortFirstWinOptions
>(returnValue
, bFlags
);
439 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
444 //! create an empty new instance of the class, do not copy the prototype
445 CSMSortFirstWinOptions
*CSMSortFirstWinOptionsBase::createEmpty(void)
447 return createEmptyLocal();
451 FieldContainerTransitPtr
CSMSortFirstWinOptionsBase::shallowCopyLocal(
452 BitVector bFlags
) const
454 CSMSortFirstWinOptions
*tmpPtr
;
456 newPtr(tmpPtr
, dynamic_cast<const CSMSortFirstWinOptions
*>(this), bFlags
);
458 FieldContainerTransitPtr
returnValue(tmpPtr
);
460 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
465 FieldContainerTransitPtr
CSMSortFirstWinOptionsBase::shallowCopyDependent(
466 BitVector bFlags
) const
468 CSMSortFirstWinOptions
*tmpPtr
;
470 newPtr(tmpPtr
, dynamic_cast<const CSMSortFirstWinOptions
*>(this), ~bFlags
);
472 FieldContainerTransitPtr
returnValue(tmpPtr
);
474 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
479 FieldContainerTransitPtr
CSMSortFirstWinOptionsBase::shallowCopy(void) const
481 return shallowCopyLocal();
487 /*------------------------- constructors ----------------------------------*/
489 CSMSortFirstWinOptionsBase::CSMSortFirstWinOptionsBase(void) :
492 _sfSubtileSize (UInt32(32)),
493 _sfCompose (bool(true)),
494 _sfUseFaceDistribution (bool(false))
498 CSMSortFirstWinOptionsBase::CSMSortFirstWinOptionsBase(const CSMSortFirstWinOptionsBase
&source
) :
500 _sfCompression (source
._sfCompression
),
501 _sfSubtileSize (source
._sfSubtileSize
),
502 _sfCompose (source
._sfCompose
),
503 _sfUseFaceDistribution (source
._sfUseFaceDistribution
)
508 /*-------------------------- destructors ----------------------------------*/
510 CSMSortFirstWinOptionsBase::~CSMSortFirstWinOptionsBase(void)
515 GetFieldHandlePtr
CSMSortFirstWinOptionsBase::getHandleCompression (void) const
517 SFString::GetHandlePtr
returnValue(
518 new SFString::GetHandle(
520 this->getType().getFieldDesc(CompressionFieldId
),
521 const_cast<CSMSortFirstWinOptionsBase
*>(this)));
526 EditFieldHandlePtr
CSMSortFirstWinOptionsBase::editHandleCompression (void)
528 SFString::EditHandlePtr
returnValue(
529 new SFString::EditHandle(
531 this->getType().getFieldDesc(CompressionFieldId
),
535 editSField(CompressionFieldMask
);
540 GetFieldHandlePtr
CSMSortFirstWinOptionsBase::getHandleSubtileSize (void) const
542 SFUInt32::GetHandlePtr
returnValue(
543 new SFUInt32::GetHandle(
545 this->getType().getFieldDesc(SubtileSizeFieldId
),
546 const_cast<CSMSortFirstWinOptionsBase
*>(this)));
551 EditFieldHandlePtr
CSMSortFirstWinOptionsBase::editHandleSubtileSize (void)
553 SFUInt32::EditHandlePtr
returnValue(
554 new SFUInt32::EditHandle(
556 this->getType().getFieldDesc(SubtileSizeFieldId
),
560 editSField(SubtileSizeFieldMask
);
565 GetFieldHandlePtr
CSMSortFirstWinOptionsBase::getHandleCompose (void) const
567 SFBool::GetHandlePtr
returnValue(
568 new SFBool::GetHandle(
570 this->getType().getFieldDesc(ComposeFieldId
),
571 const_cast<CSMSortFirstWinOptionsBase
*>(this)));
576 EditFieldHandlePtr
CSMSortFirstWinOptionsBase::editHandleCompose (void)
578 SFBool::EditHandlePtr
returnValue(
579 new SFBool::EditHandle(
581 this->getType().getFieldDesc(ComposeFieldId
),
585 editSField(ComposeFieldMask
);
590 GetFieldHandlePtr
CSMSortFirstWinOptionsBase::getHandleUseFaceDistribution (void) const
592 SFBool::GetHandlePtr
returnValue(
593 new SFBool::GetHandle(
594 &_sfUseFaceDistribution
,
595 this->getType().getFieldDesc(UseFaceDistributionFieldId
),
596 const_cast<CSMSortFirstWinOptionsBase
*>(this)));
601 EditFieldHandlePtr
CSMSortFirstWinOptionsBase::editHandleUseFaceDistribution(void)
603 SFBool::EditHandlePtr
returnValue(
604 new SFBool::EditHandle(
605 &_sfUseFaceDistribution
,
606 this->getType().getFieldDesc(UseFaceDistributionFieldId
),
610 editSField(UseFaceDistributionFieldMask
);
616 #ifdef OSG_MT_CPTR_ASPECT
617 void CSMSortFirstWinOptionsBase::execSyncV( FieldContainer
&oFrom
,
618 ConstFieldMaskArg whichField
,
619 AspectOffsetStore
&oOffsets
,
620 ConstFieldMaskArg syncMode
,
621 const UInt32 uiSyncInfo
)
623 CSMSortFirstWinOptions
*pThis
= static_cast<CSMSortFirstWinOptions
*>(this);
625 pThis
->execSync(static_cast<CSMSortFirstWinOptions
*>(&oFrom
),
634 #ifdef OSG_MT_CPTR_ASPECT
635 FieldContainer
*CSMSortFirstWinOptionsBase::createAspectCopy(
636 const FieldContainer
*pRefAspect
) const
638 CSMSortFirstWinOptions
*returnValue
;
640 newAspectCopy(returnValue
,
641 dynamic_cast<const CSMSortFirstWinOptions
*>(pRefAspect
),
642 dynamic_cast<const CSMSortFirstWinOptions
*>(this));
648 void CSMSortFirstWinOptionsBase::resolveLinks(void)
650 Inherited::resolveLinks();