fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Contrib / ComplexSceneManager / Helper / OSGCSMSortFirstWinOptionsBase.cpp
blob36d2db376df740f7c242738dbbd8bccb521a376d
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 CSMSortFirstWinOptions!
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 "OSGCSMSortFirstWinOptionsBase.h"
67 #include "OSGCSMSortFirstWinOptions.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
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(),
111 nsOSG);
112 #endif
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(),
127 "compression",
129 CompressionFieldId, CompressionFieldMask,
130 false,
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(),
139 "subtileSize",
141 SubtileSizeFieldId, SubtileSizeFieldMask,
142 false,
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(),
151 "compose",
153 ComposeFieldId, ComposeFieldMask,
154 false,
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,
166 false,
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(),
178 "NULL",
179 nsOSG, //Namespace
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)),
185 false,
187 "<?xml version=\"1.0\"?>\n"
188 "\n"
189 "<FieldContainer\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"
202 ">\n"
203 "\t<Field\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"
209 "\t>\n"
210 "\t</Field>\n"
211 "\t<Field\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"
218 "\t>\n"
219 "\t</Field>\n"
220 "\t<Field\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"
227 "\t>\n"
228 "\t</Field>\n"
229 "\t<Field\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"
236 "\t>\n"
237 "\tEnabe, disable analysation of face distribution\n"
238 "\t</Field>\n"
239 "</FieldContainer>\n",
243 /*------------------------------ get -----------------------------------*/
245 FieldContainerType &CSMSortFirstWinOptionsBase::getType(void)
247 return _type;
250 const FieldContainerType &CSMSortFirstWinOptionsBase::getType(void) const
252 return _type;
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);
293 return &_sfCompose;
296 const SFBool *CSMSortFirstWinOptionsBase::getSFCompose(void) const
298 return &_sfCompose;
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();
342 return returnValue;
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);
408 return fc;
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);
424 return fc;
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;
441 return returnValue;
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;
462 return returnValue;
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;
476 return returnValue;
479 FieldContainerTransitPtr CSMSortFirstWinOptionsBase::shallowCopy(void) const
481 return shallowCopyLocal();
487 /*------------------------- constructors ----------------------------------*/
489 CSMSortFirstWinOptionsBase::CSMSortFirstWinOptionsBase(void) :
490 Inherited(),
491 _sfCompression (),
492 _sfSubtileSize (UInt32(32)),
493 _sfCompose (bool(true)),
494 _sfUseFaceDistribution (bool(false))
498 CSMSortFirstWinOptionsBase::CSMSortFirstWinOptionsBase(const CSMSortFirstWinOptionsBase &source) :
499 Inherited(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(
519 &_sfCompression,
520 this->getType().getFieldDesc(CompressionFieldId),
521 const_cast<CSMSortFirstWinOptionsBase *>(this)));
523 return returnValue;
526 EditFieldHandlePtr CSMSortFirstWinOptionsBase::editHandleCompression (void)
528 SFString::EditHandlePtr returnValue(
529 new SFString::EditHandle(
530 &_sfCompression,
531 this->getType().getFieldDesc(CompressionFieldId),
532 this));
535 editSField(CompressionFieldMask);
537 return returnValue;
540 GetFieldHandlePtr CSMSortFirstWinOptionsBase::getHandleSubtileSize (void) const
542 SFUInt32::GetHandlePtr returnValue(
543 new SFUInt32::GetHandle(
544 &_sfSubtileSize,
545 this->getType().getFieldDesc(SubtileSizeFieldId),
546 const_cast<CSMSortFirstWinOptionsBase *>(this)));
548 return returnValue;
551 EditFieldHandlePtr CSMSortFirstWinOptionsBase::editHandleSubtileSize (void)
553 SFUInt32::EditHandlePtr returnValue(
554 new SFUInt32::EditHandle(
555 &_sfSubtileSize,
556 this->getType().getFieldDesc(SubtileSizeFieldId),
557 this));
560 editSField(SubtileSizeFieldMask);
562 return returnValue;
565 GetFieldHandlePtr CSMSortFirstWinOptionsBase::getHandleCompose (void) const
567 SFBool::GetHandlePtr returnValue(
568 new SFBool::GetHandle(
569 &_sfCompose,
570 this->getType().getFieldDesc(ComposeFieldId),
571 const_cast<CSMSortFirstWinOptionsBase *>(this)));
573 return returnValue;
576 EditFieldHandlePtr CSMSortFirstWinOptionsBase::editHandleCompose (void)
578 SFBool::EditHandlePtr returnValue(
579 new SFBool::EditHandle(
580 &_sfCompose,
581 this->getType().getFieldDesc(ComposeFieldId),
582 this));
585 editSField(ComposeFieldMask);
587 return returnValue;
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)));
598 return returnValue;
601 EditFieldHandlePtr CSMSortFirstWinOptionsBase::editHandleUseFaceDistribution(void)
603 SFBool::EditHandlePtr returnValue(
604 new SFBool::EditHandle(
605 &_sfUseFaceDistribution,
606 this->getType().getFieldDesc(UseFaceDistributionFieldId),
607 this));
610 editSField(UseFaceDistributionFieldMask);
612 return returnValue;
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),
626 whichField,
627 oOffsets,
628 syncMode,
629 uiSyncInfo);
631 #endif
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));
644 return returnValue;
646 #endif
648 void CSMSortFirstWinOptionsBase::resolveLinks(void)
650 Inherited::resolveLinks();
656 OSG_END_NAMESPACE