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"
64 #include "OSGGL.h" // Smooth default header
65 #include "OSGGL.h" // Sprite default header
66 #include "OSGGL.h" // RMode default header
69 #include "OSGPointChunkBase.h"
70 #include "OSGPointChunk.h"
72 #include <boost/bind.hpp>
76 /***************************************************************************\
78 \***************************************************************************/
80 /*! \class OSG::PointChunk
81 See \ref PageSystemPointChunk for a description.
83 This chunk wraps glPointSize() (OSG::PointChunk::_sfSize) and
84 glEnable(GL_POINT_SMOOTH) (OSG::PointChunk::_sfSmooth). It encompasses the
85 ARB_point_parameters extension (OSG::PointChunk::_sfMinSize,
86 OSG::PointChunk::_sfMaxSize, OSG::PointChunk::_sfFadeThreshold,
87 OSG::PointChunk::_sfConstantAttenuation,
88 OSG::PointChunk::_sfLinearAttenuation,
89 OSG::PointChunk::_sfQuadraticAttenuation) and ARB_point_sprite
90 (OSG::PointChunk::_sfSprite, OSG::PointChunk::_sfRMode).
93 /***************************************************************************\
94 * Field Documentation *
95 \***************************************************************************/
97 /*! \var Real32 PointChunkBase::_sfSize
98 The point's size in pixel.
101 /*! \var bool PointChunkBase::_sfSmooth
102 Defines if line antialiasing is used.
105 /*! \var Real32 PointChunkBase::_sfMinSize
106 Minimum point size for attenuation, use less than 0 to disable it. See
107 ARB_point_parameters extension.
110 /*! \var Real32 PointChunkBase::_sfMaxSize
111 Maximum point size for attenuation. See ARB_point_parameters extension.
114 /*! \var Real32 PointChunkBase::_sfConstantAttenuation
115 The point size's constant attenuation.
118 /*! \var Real32 PointChunkBase::_sfLinearAttenuation
119 The point size's linear attenuation.
122 /*! \var Real32 PointChunkBase::_sfQuadraticAttenuation
123 The point size's quadratic attenuation.
126 /*! \var Real32 PointChunkBase::_sfFadeThreshold
127 Minimum point size for attenuation. See ARB_point_parameters extension.
130 /*! \var bool PointChunkBase::_sfSprite
131 Flag to enable point sprites, see ARB_point_sprite for details.
134 /*! \var GLenum PointChunkBase::_sfRMode
139 /***************************************************************************\
140 * FieldType/FieldTrait Instantiation *
141 \***************************************************************************/
143 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
144 PointerType FieldTraits
<PointChunk
*, nsOSG
>::_type(
147 PointChunk::getClassType(),
151 OSG_FIELDTRAITS_GETTYPE_NS(PointChunk
*, nsOSG
)
153 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
157 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
161 /***************************************************************************\
162 * Field Description *
163 \***************************************************************************/
165 void PointChunkBase::classDescInserter(TypeObject
&oType
)
167 FieldDescriptionBase
*pDesc
= NULL
;
170 pDesc
= new SFReal32::Description(
171 SFReal32::getClassType(),
173 "The point's size in pixel.\n",
174 SizeFieldId
, SizeFieldMask
,
176 (Field::SFDefaultFlags
| Field::FStdAccess
),
177 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleSize
),
178 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleSize
));
180 oType
.addInitialDesc(pDesc
);
182 pDesc
= new SFBool::Description(
183 SFBool::getClassType(),
185 "Defines if line antialiasing is used.\n",
186 SmoothFieldId
, SmoothFieldMask
,
188 (Field::SFDefaultFlags
| Field::FStdAccess
),
189 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleSmooth
),
190 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleSmooth
));
192 oType
.addInitialDesc(pDesc
);
194 pDesc
= new SFReal32::Description(
195 SFReal32::getClassType(),
197 "Minimum point size for attenuation, use less than 0 to disable it. See\n"
198 "ARB_point_parameters extension. \n",
199 MinSizeFieldId
, MinSizeFieldMask
,
201 (Field::SFDefaultFlags
| Field::FStdAccess
),
202 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleMinSize
),
203 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleMinSize
));
205 oType
.addInitialDesc(pDesc
);
207 pDesc
= new SFReal32::Description(
208 SFReal32::getClassType(),
210 "Maximum point size for attenuation. See ARB_point_parameters extension.\n",
211 MaxSizeFieldId
, MaxSizeFieldMask
,
213 (Field::SFDefaultFlags
| Field::FStdAccess
),
214 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleMaxSize
),
215 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleMaxSize
));
217 oType
.addInitialDesc(pDesc
);
219 pDesc
= new SFReal32::Description(
220 SFReal32::getClassType(),
221 "constantAttenuation",
222 "The point size's constant attenuation.\n",
223 ConstantAttenuationFieldId
, ConstantAttenuationFieldMask
,
225 (Field::SFDefaultFlags
| Field::FStdAccess
),
226 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleConstantAttenuation
),
227 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleConstantAttenuation
));
229 oType
.addInitialDesc(pDesc
);
231 pDesc
= new SFReal32::Description(
232 SFReal32::getClassType(),
234 "The point size's linear attenuation.\n",
235 LinearAttenuationFieldId
, LinearAttenuationFieldMask
,
237 (Field::SFDefaultFlags
| Field::FStdAccess
),
238 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleLinearAttenuation
),
239 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleLinearAttenuation
));
241 oType
.addInitialDesc(pDesc
);
243 pDesc
= new SFReal32::Description(
244 SFReal32::getClassType(),
245 "quadraticAttenuation",
246 "The point size's quadratic attenuation.\n",
247 QuadraticAttenuationFieldId
, QuadraticAttenuationFieldMask
,
249 (Field::SFDefaultFlags
| Field::FStdAccess
),
250 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleQuadraticAttenuation
),
251 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleQuadraticAttenuation
));
253 oType
.addInitialDesc(pDesc
);
255 pDesc
= new SFReal32::Description(
256 SFReal32::getClassType(),
258 "Minimum point size for attenuation. See ARB_point_parameters extension.\n",
259 FadeThresholdFieldId
, FadeThresholdFieldMask
,
261 (Field::SFDefaultFlags
| Field::FStdAccess
),
262 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleFadeThreshold
),
263 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleFadeThreshold
));
265 oType
.addInitialDesc(pDesc
);
267 pDesc
= new SFBool::Description(
268 SFBool::getClassType(),
270 "Flag to enable point sprites, see ARB_point_sprite for details.\n",
271 SpriteFieldId
, SpriteFieldMask
,
273 (Field::SFDefaultFlags
| Field::FStdAccess
),
274 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleSprite
),
275 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleSprite
));
277 oType
.addInitialDesc(pDesc
);
279 pDesc
= new SFGLenum::Description(
280 SFGLenum::getClassType(),
283 RModeFieldId
, RModeFieldMask
,
285 (Field::SFDefaultFlags
| Field::FStdAccess
),
286 static_cast<FieldEditMethodSig
>(&PointChunk::editHandleRMode
),
287 static_cast<FieldGetMethodSig
>(&PointChunk::getHandleRMode
));
289 oType
.addInitialDesc(pDesc
);
293 PointChunkBase::TypeObject
PointChunkBase::_type(
294 PointChunkBase::getClassname(),
295 Inherited::getClassname(),
298 reinterpret_cast<PrototypeCreateF
>(&PointChunkBase::createEmptyLocal
),
299 reinterpret_cast<InitContainerF
>(&PointChunk::initMethod
),
300 reinterpret_cast<ExitContainerF
>(&PointChunk::exitMethod
),
301 reinterpret_cast<InitalInsertDescFunc
>(
302 reinterpret_cast<void *>(&PointChunk::classDescInserter
)),
305 "<?xml version=\"1.0\"?>\n"
308 " name=\"PointChunk\"\n"
309 " parent=\"StateChunk\"\n"
310 " library=\"State\"\n"
311 " pointerfieldtypes=\"both\"\n"
312 " structure=\"concrete\"\n"
313 " systemcomponent=\"true\"\n"
314 " parentsystemcomponent=\"true\"\n"
315 " decoratable=\"false\"\n"
316 " docGroupBase=\"GrpStateOpenGL\"\n"
318 " See \\ref PageSystemPointChunk for a description. \n"
320 " This chunk wraps glPointSize() (OSG::PointChunk::_sfSize) and\n"
321 " glEnable(GL_POINT_SMOOTH) (OSG::PointChunk::_sfSmooth). It encompasses the\n"
322 " ARB_point_parameters extension (OSG::PointChunk::_sfMinSize, \n"
323 " OSG::PointChunk::_sfMaxSize, OSG::PointChunk::_sfFadeThreshold, \n"
324 " OSG::PointChunk::_sfConstantAttenuation, \n"
325 " OSG::PointChunk::_sfLinearAttenuation,\n"
326 " OSG::PointChunk::_sfQuadraticAttenuation) and ARB_point_sprite\n"
327 " (OSG::PointChunk::_sfSprite, OSG::PointChunk::_sfRMode).\n"
330 "\t type=\"Real32\"\n"
331 "\t cardinality=\"single\"\n"
332 "\t visibility=\"external\"\n"
333 "\t defaultValue=\"1\"\n"
334 "\t access=\"public\"\n"
336 "\tThe point's size in pixel.\n"
339 "\t name=\"smooth\"\n"
341 "\t cardinality=\"single\"\n"
342 "\t visibility=\"external\"\n"
343 "\t defaultValue=\"GL_FALSE\"\n"
344 "\t defaultHeader=\""OSGGL.h"\"\n"
345 "\t access=\"public\"\n"
347 "\tDefines if line antialiasing is used.\n"
350 "\t name=\"minSize\"\n"
351 "\t type=\"Real32\"\n"
352 "\t cardinality=\"single\"\n"
353 "\t visibility=\"external\"\n"
354 "\t defaultValue=\"-1.f\"\n"
355 "\t access=\"public\"\n"
357 "\tMinimum point size for attenuation, use less than 0 to disable it. See\n"
358 "\tARB_point_parameters extension. \n"
361 "\t name=\"maxSize\"\n"
362 "\t type=\"Real32\"\n"
363 "\t cardinality=\"single\"\n"
364 "\t visibility=\"external\"\n"
365 "\t defaultValue=\"-1.f\"\n"
366 "\t access=\"public\"\n"
368 "\tMaximum point size for attenuation. See ARB_point_parameters extension.\n"
371 "\t name=\"constantAttenuation\"\n"
372 "\t type=\"Real32\"\n"
373 "\t cardinality=\"single\"\n"
374 "\t visibility=\"external\"\n"
375 "\t defaultValue=\"1\"\n"
376 "\t access=\"public\"\n"
378 "\tThe point size's constant attenuation.\n"
381 "\t name=\"linearAttenuation\"\n"
382 "\t type=\"Real32\"\n"
383 "\t cardinality=\"single\"\n"
384 "\t visibility=\"external\"\n"
385 "\t defaultValue=\"0\"\n"
386 "\t access=\"public\"\n"
388 "\tThe point size's linear attenuation.\n"
391 "\t name=\"quadraticAttenuation\"\n"
392 "\t type=\"Real32\"\n"
393 "\t cardinality=\"single\"\n"
394 "\t visibility=\"external\"\n"
395 "\t defaultValue=\"0\"\n"
396 "\t access=\"public\"\n"
398 "\tThe point size's quadratic attenuation.\n"
401 "\t name=\"fadeThreshold\"\n"
402 "\t type=\"Real32\"\n"
403 "\t cardinality=\"single\"\n"
404 "\t visibility=\"external\"\n"
405 "\t defaultValue=\"0.f\"\n"
406 "\t access=\"public\"\n"
408 "\tMinimum point size for attenuation. See ARB_point_parameters extension.\n"
411 "\t name=\"sprite\"\n"
413 "\t cardinality=\"single\"\n"
414 "\t visibility=\"external\"\n"
415 "\t defaultValue=\"GL_FALSE\"\n"
416 "\t defaultHeader=\""OSGGL.h"\"\n"
417 "\t access=\"public\"\n"
419 "\tFlag to enable point sprites, see ARB_point_sprite for details.\n"
422 "\t name=\"rMode\"\n"
423 "\t type=\"GLenum\"\n"
424 "\t cardinality=\"single\"\n"
425 "\t visibility=\"external\"\n"
426 "\t defaultValue=\"GL_ZERO\"\n"
427 "\t defaultHeader=\""OSGGL.h"\"\n"
428 "\t access=\"public\"\n"
431 "</FieldContainer>\n",
432 "See \\ref PageSystemPointChunk for a description. \n"
434 "This chunk wraps glPointSize() (OSG::PointChunk::_sfSize) and\n"
435 "glEnable(GL_POINT_SMOOTH) (OSG::PointChunk::_sfSmooth). It encompasses the\n"
436 "ARB_point_parameters extension (OSG::PointChunk::_sfMinSize, \n"
437 "OSG::PointChunk::_sfMaxSize, OSG::PointChunk::_sfFadeThreshold, \n"
438 "OSG::PointChunk::_sfConstantAttenuation, \n"
439 "OSG::PointChunk::_sfLinearAttenuation,\n"
440 "OSG::PointChunk::_sfQuadraticAttenuation) and ARB_point_sprite\n"
441 "(OSG::PointChunk::_sfSprite, OSG::PointChunk::_sfRMode).\n"
444 /*------------------------------ get -----------------------------------*/
446 FieldContainerType
&PointChunkBase::getType(void)
451 const FieldContainerType
&PointChunkBase::getType(void) const
456 UInt32
PointChunkBase::getContainerSize(void) const
458 return sizeof(PointChunk
);
461 /*------------------------- decorator get ------------------------------*/
464 SFReal32
*PointChunkBase::editSFSize(void)
466 editSField(SizeFieldMask
);
471 const SFReal32
*PointChunkBase::getSFSize(void) const
477 SFBool
*PointChunkBase::editSFSmooth(void)
479 editSField(SmoothFieldMask
);
484 const SFBool
*PointChunkBase::getSFSmooth(void) const
490 SFReal32
*PointChunkBase::editSFMinSize(void)
492 editSField(MinSizeFieldMask
);
497 const SFReal32
*PointChunkBase::getSFMinSize(void) const
503 SFReal32
*PointChunkBase::editSFMaxSize(void)
505 editSField(MaxSizeFieldMask
);
510 const SFReal32
*PointChunkBase::getSFMaxSize(void) const
516 SFReal32
*PointChunkBase::editSFConstantAttenuation(void)
518 editSField(ConstantAttenuationFieldMask
);
520 return &_sfConstantAttenuation
;
523 const SFReal32
*PointChunkBase::getSFConstantAttenuation(void) const
525 return &_sfConstantAttenuation
;
529 SFReal32
*PointChunkBase::editSFLinearAttenuation(void)
531 editSField(LinearAttenuationFieldMask
);
533 return &_sfLinearAttenuation
;
536 const SFReal32
*PointChunkBase::getSFLinearAttenuation(void) const
538 return &_sfLinearAttenuation
;
542 SFReal32
*PointChunkBase::editSFQuadraticAttenuation(void)
544 editSField(QuadraticAttenuationFieldMask
);
546 return &_sfQuadraticAttenuation
;
549 const SFReal32
*PointChunkBase::getSFQuadraticAttenuation(void) const
551 return &_sfQuadraticAttenuation
;
555 SFReal32
*PointChunkBase::editSFFadeThreshold(void)
557 editSField(FadeThresholdFieldMask
);
559 return &_sfFadeThreshold
;
562 const SFReal32
*PointChunkBase::getSFFadeThreshold(void) const
564 return &_sfFadeThreshold
;
568 SFBool
*PointChunkBase::editSFSprite(void)
570 editSField(SpriteFieldMask
);
575 const SFBool
*PointChunkBase::getSFSprite(void) const
581 SFGLenum
*PointChunkBase::editSFRMode(void)
583 editSField(RModeFieldMask
);
588 const SFGLenum
*PointChunkBase::getSFRMode(void) const
598 /*------------------------------ access -----------------------------------*/
600 SizeT
PointChunkBase::getBinSize(ConstFieldMaskArg whichField
)
602 SizeT returnValue
= Inherited::getBinSize(whichField
);
604 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
606 returnValue
+= _sfSize
.getBinSize();
608 if(FieldBits::NoField
!= (SmoothFieldMask
& whichField
))
610 returnValue
+= _sfSmooth
.getBinSize();
612 if(FieldBits::NoField
!= (MinSizeFieldMask
& whichField
))
614 returnValue
+= _sfMinSize
.getBinSize();
616 if(FieldBits::NoField
!= (MaxSizeFieldMask
& whichField
))
618 returnValue
+= _sfMaxSize
.getBinSize();
620 if(FieldBits::NoField
!= (ConstantAttenuationFieldMask
& whichField
))
622 returnValue
+= _sfConstantAttenuation
.getBinSize();
624 if(FieldBits::NoField
!= (LinearAttenuationFieldMask
& whichField
))
626 returnValue
+= _sfLinearAttenuation
.getBinSize();
628 if(FieldBits::NoField
!= (QuadraticAttenuationFieldMask
& whichField
))
630 returnValue
+= _sfQuadraticAttenuation
.getBinSize();
632 if(FieldBits::NoField
!= (FadeThresholdFieldMask
& whichField
))
634 returnValue
+= _sfFadeThreshold
.getBinSize();
636 if(FieldBits::NoField
!= (SpriteFieldMask
& whichField
))
638 returnValue
+= _sfSprite
.getBinSize();
640 if(FieldBits::NoField
!= (RModeFieldMask
& whichField
))
642 returnValue
+= _sfRMode
.getBinSize();
648 void PointChunkBase::copyToBin(BinaryDataHandler
&pMem
,
649 ConstFieldMaskArg whichField
)
651 Inherited::copyToBin(pMem
, whichField
);
653 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
655 _sfSize
.copyToBin(pMem
);
657 if(FieldBits::NoField
!= (SmoothFieldMask
& whichField
))
659 _sfSmooth
.copyToBin(pMem
);
661 if(FieldBits::NoField
!= (MinSizeFieldMask
& whichField
))
663 _sfMinSize
.copyToBin(pMem
);
665 if(FieldBits::NoField
!= (MaxSizeFieldMask
& whichField
))
667 _sfMaxSize
.copyToBin(pMem
);
669 if(FieldBits::NoField
!= (ConstantAttenuationFieldMask
& whichField
))
671 _sfConstantAttenuation
.copyToBin(pMem
);
673 if(FieldBits::NoField
!= (LinearAttenuationFieldMask
& whichField
))
675 _sfLinearAttenuation
.copyToBin(pMem
);
677 if(FieldBits::NoField
!= (QuadraticAttenuationFieldMask
& whichField
))
679 _sfQuadraticAttenuation
.copyToBin(pMem
);
681 if(FieldBits::NoField
!= (FadeThresholdFieldMask
& whichField
))
683 _sfFadeThreshold
.copyToBin(pMem
);
685 if(FieldBits::NoField
!= (SpriteFieldMask
& whichField
))
687 _sfSprite
.copyToBin(pMem
);
689 if(FieldBits::NoField
!= (RModeFieldMask
& whichField
))
691 _sfRMode
.copyToBin(pMem
);
695 void PointChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
696 ConstFieldMaskArg whichField
)
698 Inherited::copyFromBin(pMem
, whichField
);
700 if(FieldBits::NoField
!= (SizeFieldMask
& whichField
))
702 editSField(SizeFieldMask
);
703 _sfSize
.copyFromBin(pMem
);
705 if(FieldBits::NoField
!= (SmoothFieldMask
& whichField
))
707 editSField(SmoothFieldMask
);
708 _sfSmooth
.copyFromBin(pMem
);
710 if(FieldBits::NoField
!= (MinSizeFieldMask
& whichField
))
712 editSField(MinSizeFieldMask
);
713 _sfMinSize
.copyFromBin(pMem
);
715 if(FieldBits::NoField
!= (MaxSizeFieldMask
& whichField
))
717 editSField(MaxSizeFieldMask
);
718 _sfMaxSize
.copyFromBin(pMem
);
720 if(FieldBits::NoField
!= (ConstantAttenuationFieldMask
& whichField
))
722 editSField(ConstantAttenuationFieldMask
);
723 _sfConstantAttenuation
.copyFromBin(pMem
);
725 if(FieldBits::NoField
!= (LinearAttenuationFieldMask
& whichField
))
727 editSField(LinearAttenuationFieldMask
);
728 _sfLinearAttenuation
.copyFromBin(pMem
);
730 if(FieldBits::NoField
!= (QuadraticAttenuationFieldMask
& whichField
))
732 editSField(QuadraticAttenuationFieldMask
);
733 _sfQuadraticAttenuation
.copyFromBin(pMem
);
735 if(FieldBits::NoField
!= (FadeThresholdFieldMask
& whichField
))
737 editSField(FadeThresholdFieldMask
);
738 _sfFadeThreshold
.copyFromBin(pMem
);
740 if(FieldBits::NoField
!= (SpriteFieldMask
& whichField
))
742 editSField(SpriteFieldMask
);
743 _sfSprite
.copyFromBin(pMem
);
745 if(FieldBits::NoField
!= (RModeFieldMask
& whichField
))
747 editSField(RModeFieldMask
);
748 _sfRMode
.copyFromBin(pMem
);
752 //! create a new instance of the class
753 PointChunkTransitPtr
PointChunkBase::createLocal(BitVector bFlags
)
755 PointChunkTransitPtr fc
;
757 if(getClassType().getPrototype() != NULL
)
759 FieldContainerTransitPtr tmpPtr
=
760 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
762 fc
= dynamic_pointer_cast
<PointChunk
>(tmpPtr
);
768 //! create a new instance of the class, copy the container flags
769 PointChunkTransitPtr
PointChunkBase::createDependent(BitVector bFlags
)
771 PointChunkTransitPtr fc
;
773 if(getClassType().getPrototype() != NULL
)
775 FieldContainerTransitPtr tmpPtr
=
776 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
778 fc
= dynamic_pointer_cast
<PointChunk
>(tmpPtr
);
784 //! create a new instance of the class
785 PointChunkTransitPtr
PointChunkBase::create(void)
787 PointChunkTransitPtr fc
;
789 if(getClassType().getPrototype() != NULL
)
791 FieldContainerTransitPtr tmpPtr
=
792 getClassType().getPrototype()-> shallowCopy();
794 fc
= dynamic_pointer_cast
<PointChunk
>(tmpPtr
);
800 PointChunk
*PointChunkBase::createEmptyLocal(BitVector bFlags
)
802 PointChunk
*returnValue
;
804 newPtr
<PointChunk
>(returnValue
, bFlags
);
806 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
811 //! create an empty new instance of the class, do not copy the prototype
812 PointChunk
*PointChunkBase::createEmpty(void)
814 PointChunk
*returnValue
;
816 newPtr
<PointChunk
>(returnValue
, Thread::getCurrentLocalFlags());
818 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
819 ~Thread::getCurrentLocalFlags();
825 FieldContainerTransitPtr
PointChunkBase::shallowCopyLocal(
826 BitVector bFlags
) const
830 newPtr(tmpPtr
, dynamic_cast<const PointChunk
*>(this), bFlags
);
832 FieldContainerTransitPtr
returnValue(tmpPtr
);
834 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
839 FieldContainerTransitPtr
PointChunkBase::shallowCopyDependent(
840 BitVector bFlags
) const
844 newPtr(tmpPtr
, dynamic_cast<const PointChunk
*>(this), ~bFlags
);
846 FieldContainerTransitPtr
returnValue(tmpPtr
);
848 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
853 FieldContainerTransitPtr
PointChunkBase::shallowCopy(void) const
858 dynamic_cast<const PointChunk
*>(this),
859 Thread::getCurrentLocalFlags());
861 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
863 FieldContainerTransitPtr
returnValue(tmpPtr
);
871 /*------------------------- constructors ----------------------------------*/
873 PointChunkBase::PointChunkBase(void) :
876 _sfSmooth (bool(GL_FALSE
)),
877 _sfMinSize (Real32(-1.f
)),
878 _sfMaxSize (Real32(-1.f
)),
879 _sfConstantAttenuation (Real32(1)),
880 _sfLinearAttenuation (Real32(0)),
881 _sfQuadraticAttenuation (Real32(0)),
882 _sfFadeThreshold (Real32(0.f
)),
883 _sfSprite (bool(GL_FALSE
)),
884 _sfRMode (GLenum(GL_ZERO
))
888 PointChunkBase::PointChunkBase(const PointChunkBase
&source
) :
890 _sfSize (source
._sfSize
),
891 _sfSmooth (source
._sfSmooth
),
892 _sfMinSize (source
._sfMinSize
),
893 _sfMaxSize (source
._sfMaxSize
),
894 _sfConstantAttenuation (source
._sfConstantAttenuation
),
895 _sfLinearAttenuation (source
._sfLinearAttenuation
),
896 _sfQuadraticAttenuation (source
._sfQuadraticAttenuation
),
897 _sfFadeThreshold (source
._sfFadeThreshold
),
898 _sfSprite (source
._sfSprite
),
899 _sfRMode (source
._sfRMode
)
904 /*-------------------------- destructors ----------------------------------*/
906 PointChunkBase::~PointChunkBase(void)
911 GetFieldHandlePtr
PointChunkBase::getHandleSize (void) const
913 SFReal32::GetHandlePtr
returnValue(
914 new SFReal32::GetHandle(
916 this->getType().getFieldDesc(SizeFieldId
),
917 const_cast<PointChunkBase
*>(this)));
922 EditFieldHandlePtr
PointChunkBase::editHandleSize (void)
924 SFReal32::EditHandlePtr
returnValue(
925 new SFReal32::EditHandle(
927 this->getType().getFieldDesc(SizeFieldId
),
931 editSField(SizeFieldMask
);
936 GetFieldHandlePtr
PointChunkBase::getHandleSmooth (void) const
938 SFBool::GetHandlePtr
returnValue(
939 new SFBool::GetHandle(
941 this->getType().getFieldDesc(SmoothFieldId
),
942 const_cast<PointChunkBase
*>(this)));
947 EditFieldHandlePtr
PointChunkBase::editHandleSmooth (void)
949 SFBool::EditHandlePtr
returnValue(
950 new SFBool::EditHandle(
952 this->getType().getFieldDesc(SmoothFieldId
),
956 editSField(SmoothFieldMask
);
961 GetFieldHandlePtr
PointChunkBase::getHandleMinSize (void) const
963 SFReal32::GetHandlePtr
returnValue(
964 new SFReal32::GetHandle(
966 this->getType().getFieldDesc(MinSizeFieldId
),
967 const_cast<PointChunkBase
*>(this)));
972 EditFieldHandlePtr
PointChunkBase::editHandleMinSize (void)
974 SFReal32::EditHandlePtr
returnValue(
975 new SFReal32::EditHandle(
977 this->getType().getFieldDesc(MinSizeFieldId
),
981 editSField(MinSizeFieldMask
);
986 GetFieldHandlePtr
PointChunkBase::getHandleMaxSize (void) const
988 SFReal32::GetHandlePtr
returnValue(
989 new SFReal32::GetHandle(
991 this->getType().getFieldDesc(MaxSizeFieldId
),
992 const_cast<PointChunkBase
*>(this)));
997 EditFieldHandlePtr
PointChunkBase::editHandleMaxSize (void)
999 SFReal32::EditHandlePtr
returnValue(
1000 new SFReal32::EditHandle(
1002 this->getType().getFieldDesc(MaxSizeFieldId
),
1006 editSField(MaxSizeFieldMask
);
1011 GetFieldHandlePtr
PointChunkBase::getHandleConstantAttenuation (void) const
1013 SFReal32::GetHandlePtr
returnValue(
1014 new SFReal32::GetHandle(
1015 &_sfConstantAttenuation
,
1016 this->getType().getFieldDesc(ConstantAttenuationFieldId
),
1017 const_cast<PointChunkBase
*>(this)));
1022 EditFieldHandlePtr
PointChunkBase::editHandleConstantAttenuation(void)
1024 SFReal32::EditHandlePtr
returnValue(
1025 new SFReal32::EditHandle(
1026 &_sfConstantAttenuation
,
1027 this->getType().getFieldDesc(ConstantAttenuationFieldId
),
1031 editSField(ConstantAttenuationFieldMask
);
1036 GetFieldHandlePtr
PointChunkBase::getHandleLinearAttenuation (void) const
1038 SFReal32::GetHandlePtr
returnValue(
1039 new SFReal32::GetHandle(
1040 &_sfLinearAttenuation
,
1041 this->getType().getFieldDesc(LinearAttenuationFieldId
),
1042 const_cast<PointChunkBase
*>(this)));
1047 EditFieldHandlePtr
PointChunkBase::editHandleLinearAttenuation(void)
1049 SFReal32::EditHandlePtr
returnValue(
1050 new SFReal32::EditHandle(
1051 &_sfLinearAttenuation
,
1052 this->getType().getFieldDesc(LinearAttenuationFieldId
),
1056 editSField(LinearAttenuationFieldMask
);
1061 GetFieldHandlePtr
PointChunkBase::getHandleQuadraticAttenuation (void) const
1063 SFReal32::GetHandlePtr
returnValue(
1064 new SFReal32::GetHandle(
1065 &_sfQuadraticAttenuation
,
1066 this->getType().getFieldDesc(QuadraticAttenuationFieldId
),
1067 const_cast<PointChunkBase
*>(this)));
1072 EditFieldHandlePtr
PointChunkBase::editHandleQuadraticAttenuation(void)
1074 SFReal32::EditHandlePtr
returnValue(
1075 new SFReal32::EditHandle(
1076 &_sfQuadraticAttenuation
,
1077 this->getType().getFieldDesc(QuadraticAttenuationFieldId
),
1081 editSField(QuadraticAttenuationFieldMask
);
1086 GetFieldHandlePtr
PointChunkBase::getHandleFadeThreshold (void) const
1088 SFReal32::GetHandlePtr
returnValue(
1089 new SFReal32::GetHandle(
1091 this->getType().getFieldDesc(FadeThresholdFieldId
),
1092 const_cast<PointChunkBase
*>(this)));
1097 EditFieldHandlePtr
PointChunkBase::editHandleFadeThreshold (void)
1099 SFReal32::EditHandlePtr
returnValue(
1100 new SFReal32::EditHandle(
1102 this->getType().getFieldDesc(FadeThresholdFieldId
),
1106 editSField(FadeThresholdFieldMask
);
1111 GetFieldHandlePtr
PointChunkBase::getHandleSprite (void) const
1113 SFBool::GetHandlePtr
returnValue(
1114 new SFBool::GetHandle(
1116 this->getType().getFieldDesc(SpriteFieldId
),
1117 const_cast<PointChunkBase
*>(this)));
1122 EditFieldHandlePtr
PointChunkBase::editHandleSprite (void)
1124 SFBool::EditHandlePtr
returnValue(
1125 new SFBool::EditHandle(
1127 this->getType().getFieldDesc(SpriteFieldId
),
1131 editSField(SpriteFieldMask
);
1136 GetFieldHandlePtr
PointChunkBase::getHandleRMode (void) const
1138 SFGLenum::GetHandlePtr
returnValue(
1139 new SFGLenum::GetHandle(
1141 this->getType().getFieldDesc(RModeFieldId
),
1142 const_cast<PointChunkBase
*>(this)));
1147 EditFieldHandlePtr
PointChunkBase::editHandleRMode (void)
1149 SFGLenum::EditHandlePtr
returnValue(
1150 new SFGLenum::EditHandle(
1152 this->getType().getFieldDesc(RModeFieldId
),
1156 editSField(RModeFieldMask
);
1162 #ifdef OSG_MT_CPTR_ASPECT
1163 void PointChunkBase::execSyncV( FieldContainer
&oFrom
,
1164 ConstFieldMaskArg whichField
,
1165 AspectOffsetStore
&oOffsets
,
1166 ConstFieldMaskArg syncMode
,
1167 const UInt32 uiSyncInfo
)
1169 PointChunk
*pThis
= static_cast<PointChunk
*>(this);
1171 pThis
->execSync(static_cast<PointChunk
*>(&oFrom
),
1180 #ifdef OSG_MT_CPTR_ASPECT
1181 FieldContainer
*PointChunkBase::createAspectCopy(
1182 const FieldContainer
*pRefAspect
) const
1184 PointChunk
*returnValue
;
1186 newAspectCopy(returnValue
,
1187 dynamic_cast<const PointChunk
*>(pRefAspect
),
1188 dynamic_cast<const PointChunk
*>(this));
1194 void PointChunkBase::resolveLinks(void)
1196 Inherited::resolveLinks();