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 StencilChunk!
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" // StencilFunc default header
65 #include "OSGGL.h" // StencilOpFail default header
66 #include "OSGGL.h" // StencilOpZFail default header
67 #include "OSGGL.h" // StencilOpZPass default header
70 #include "OSGStencilChunkBase.h"
71 #include "OSGStencilChunk.h"
73 #include <boost/bind.hpp>
77 /***************************************************************************\
79 \***************************************************************************/
81 /*! \class OSG::StencilChunk
82 The stencil chunk handles OpenGL stencil tests by wrapping glStencilFunc()
86 /***************************************************************************\
87 * Field Documentation *
88 \***************************************************************************/
90 /*! \var GLenum StencilChunkBase::_sfStencilFunc
91 The stencilFunc defines how fragments which do not fulfill a certain
92 condition are handled.
93 See glStencilFunc() for details. GL_NONE is used to disable stencil.
96 /*! \var Int32 StencilChunkBase::_sfStencilValue
97 The stencilFunc defines how fragments which do not fulfill a certain
98 condition are handled.
99 See glStencilFunc() for details. GL_NONE is used to disable stencil.
102 /*! \var UInt32 StencilChunkBase::_sfStencilMask
103 The stencilFunc defines how fragments which do not fulfill a certain
104 condition are handled.
105 See glStencilFunc() for details. GL_NONE is used to disable stencil.
108 /*! \var GLenum StencilChunkBase::_sfStencilOpFail
109 The stencilFunc defines how fragments which do not fulfill a certain
110 condition are handled.
111 See glStencilFunc() for details. GL_NONE is used to disable stencil.
114 /*! \var GLenum StencilChunkBase::_sfStencilOpZFail
115 The stencilFunc defines how fragments which do not fulfill a certain
116 condition are handled.
117 See glStencilFunc() for details. GL_NONE is used to disable stencil.
120 /*! \var GLenum StencilChunkBase::_sfStencilOpZPass
121 The stencilFunc defines how fragments which do not fulfill a certain
122 condition are handled.
123 See glStencilFunc() for details. GL_NONE is used to disable stencil.
126 /*! \var Int32 StencilChunkBase::_sfClearBuffer
127 Clear buffer on activate(1) or deactivate(2).
130 /*! \var UInt32 StencilChunkBase::_sfBitMask
131 Controls writing of individual bits in stencil planes, with 0 means write
132 protected and 1 write enabled.
136 /***************************************************************************\
137 * FieldType/FieldTrait Instantiation *
138 \***************************************************************************/
140 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
141 PointerType FieldTraits
<StencilChunk
*, nsOSG
>::_type(
144 StencilChunk::getClassType(),
148 OSG_FIELDTRAITS_GETTYPE_NS(StencilChunk
*, nsOSG
)
150 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
154 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
158 /***************************************************************************\
159 * Field Description *
160 \***************************************************************************/
162 void StencilChunkBase::classDescInserter(TypeObject
&oType
)
164 FieldDescriptionBase
*pDesc
= NULL
;
167 pDesc
= new SFGLenum::Description(
168 SFGLenum::getClassType(),
170 "The stencilFunc defines how fragments which do not fulfill a certain\n"
171 "condition are handled. \n"
172 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
173 StencilFuncFieldId
, StencilFuncFieldMask
,
175 (Field::SFDefaultFlags
| Field::FStdAccess
),
176 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilFunc
),
177 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilFunc
));
179 oType
.addInitialDesc(pDesc
);
181 pDesc
= new SFInt32::Description(
182 SFInt32::getClassType(),
184 "The stencilFunc defines how fragments which do not fulfill a certain\n"
185 "condition are handled. \n"
186 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
187 StencilValueFieldId
, StencilValueFieldMask
,
189 (Field::SFDefaultFlags
| Field::FStdAccess
),
190 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilValue
),
191 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilValue
));
193 oType
.addInitialDesc(pDesc
);
195 pDesc
= new SFUInt32::Description(
196 SFUInt32::getClassType(),
198 "The stencilFunc defines how fragments which do not fulfill a certain\n"
199 "condition are handled. \n"
200 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
201 StencilMaskFieldId
, StencilMaskFieldMask
,
203 (Field::SFDefaultFlags
| Field::FStdAccess
),
204 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilMask
),
205 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilMask
));
207 oType
.addInitialDesc(pDesc
);
209 pDesc
= new SFGLenum::Description(
210 SFGLenum::getClassType(),
212 "The stencilFunc defines how fragments which do not fulfill a certain\n"
213 "condition are handled. \n"
214 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
215 StencilOpFailFieldId
, StencilOpFailFieldMask
,
217 (Field::SFDefaultFlags
| Field::FStdAccess
),
218 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilOpFail
),
219 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilOpFail
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new SFGLenum::Description(
224 SFGLenum::getClassType(),
226 "The stencilFunc defines how fragments which do not fulfill a certain\n"
227 "condition are handled. \n"
228 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
229 StencilOpZFailFieldId
, StencilOpZFailFieldMask
,
231 (Field::SFDefaultFlags
| Field::FStdAccess
),
232 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilOpZFail
),
233 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilOpZFail
));
235 oType
.addInitialDesc(pDesc
);
237 pDesc
= new SFGLenum::Description(
238 SFGLenum::getClassType(),
240 "The stencilFunc defines how fragments which do not fulfill a certain\n"
241 "condition are handled. \n"
242 "See glStencilFunc() for details. GL_NONE is used to disable stencil.\n",
243 StencilOpZPassFieldId
, StencilOpZPassFieldMask
,
245 (Field::SFDefaultFlags
| Field::FStdAccess
),
246 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleStencilOpZPass
),
247 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleStencilOpZPass
));
249 oType
.addInitialDesc(pDesc
);
251 pDesc
= new SFInt32::Description(
252 SFInt32::getClassType(),
254 "Clear buffer on activate(1) or deactivate(2).\n",
255 ClearBufferFieldId
, ClearBufferFieldMask
,
257 (Field::SFDefaultFlags
| Field::FStdAccess
),
258 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleClearBuffer
),
259 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleClearBuffer
));
261 oType
.addInitialDesc(pDesc
);
263 pDesc
= new SFUInt32::Description(
264 SFUInt32::getClassType(),
266 "Controls writing of individual bits in stencil planes, with 0 means write\n"
267 "protected and 1 write enabled.\n",
268 BitMaskFieldId
, BitMaskFieldMask
,
270 (Field::SFDefaultFlags
| Field::FStdAccess
),
271 static_cast<FieldEditMethodSig
>(&StencilChunk::editHandleBitMask
),
272 static_cast<FieldGetMethodSig
>(&StencilChunk::getHandleBitMask
));
274 oType
.addInitialDesc(pDesc
);
278 StencilChunkBase::TypeObject
StencilChunkBase::_type(
279 StencilChunkBase::getClassname(),
280 Inherited::getClassname(),
283 reinterpret_cast<PrototypeCreateF
>(&StencilChunkBase::createEmptyLocal
),
284 reinterpret_cast<InitContainerF
>(&StencilChunk::initMethod
),
285 reinterpret_cast<ExitContainerF
>(&StencilChunk::exitMethod
),
286 reinterpret_cast<InitalInsertDescFunc
>(
287 reinterpret_cast<void *>(&StencilChunk::classDescInserter
)),
290 "<?xml version=\"1.0\"?>\n"
293 " name=\"StencilChunk\"\n"
294 " parent=\"StateChunk\"\n"
295 " library=\"State\"\n"
296 " pointerfieldtypes=\"both\"\n"
297 " structure=\"concrete\"\n"
298 " systemcomponent=\"true\"\n"
299 " parentsystemcomponent=\"true\"\n"
300 " decoratable=\"false\"\n"
301 " useLocalIncludes=\"false\"\n"
302 " docGroupBase=\"GrpStateOpenGL\"\n"
304 " The stencil chunk handles OpenGL stencil tests by wrapping glStencilFunc()\n"
305 " and glStencilOp(). \n"
307 "\t name=\"stencilFunc\"\n"
308 "\t type=\"GLenum\"\n"
309 "\t cardinality=\"single\"\n"
310 "\t visibility=\"external\"\n"
311 "\t defaultValue=\"GL_NONE\"\n"
312 "\t defaultHeader=\"OSGGL.h\"\n"
313 "\t access=\"public\"\n"
315 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
316 "\tcondition are handled. \n"
317 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
320 "\t name=\"stencilValue\"\n"
321 "\t type=\"Int32\"\n"
322 "\t cardinality=\"single\"\n"
323 "\t visibility=\"external\"\n"
324 "\t defaultValue=\"0\"\n"
325 "\t access=\"public\"\n"
327 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
328 "\tcondition are handled. \n"
329 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
332 "\t name=\"stencilMask\"\n"
333 "\t type=\"UInt32\"\n"
334 "\t cardinality=\"single\"\n"
335 "\t visibility=\"external\"\n"
336 "\t defaultValue=\"0x1\"\n"
337 "\t access=\"public\"\n"
339 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
340 "\tcondition are handled. \n"
341 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
344 "\t name=\"stencilOpFail\"\n"
345 "\t type=\"GLenum\"\n"
346 "\t cardinality=\"single\"\n"
347 "\t visibility=\"external\"\n"
348 "\t defaultValue=\"GL_KEEP\"\n"
349 "\t defaultHeader=\"OSGGL.h\"\n"
350 "\t access=\"public\"\n"
352 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
353 "\tcondition are handled. \n"
354 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
357 "\t name=\"stencilOpZFail\"\n"
358 "\t type=\"GLenum\"\n"
359 "\t cardinality=\"single\"\n"
360 "\t visibility=\"external\"\n"
361 "\t defaultValue=\"GL_KEEP\"\n"
362 "\t defaultHeader=\"OSGGL.h\"\n"
363 "\t access=\"public\"\n"
365 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
366 "\tcondition are handled. \n"
367 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
370 "\t name=\"stencilOpZPass\"\n"
371 "\t type=\"GLenum\"\n"
372 "\t cardinality=\"single\"\n"
373 "\t visibility=\"external\"\n"
374 "\t defaultValue=\"GL_KEEP\"\n"
375 "\t defaultHeader=\"OSGGL.h\"\n"
376 "\t access=\"public\"\n"
378 "\tThe stencilFunc defines how fragments which do not fulfill a certain\n"
379 "\tcondition are handled. \n"
380 " See glStencilFunc() for details. GL_NONE is used to disable stencil.\n"
383 "\t name=\"clearBuffer\"\n"
384 "\t type=\"Int32\"\n"
385 "\t cardinality=\"single\"\n"
386 "\t visibility=\"external\"\n"
387 "\t defaultValue=\"0\"\n"
388 "\t access=\"public\"\n"
390 "\tClear buffer on activate(1) or deactivate(2).\n"
393 "\t name=\"bitMask\"\n"
394 "\t type=\"UInt32\"\n"
395 "\t cardinality=\"single\"\n"
396 "\t visibility=\"external\"\n"
397 "\t defaultValue=\"0xFFFFFFFF\"\n"
398 "\t access=\"public\"\n"
400 "\tControls writing of individual bits in stencil planes, with 0 means write\n"
401 "\tprotected and 1 write enabled.\n"
403 "</FieldContainer>\n",
404 "The stencil chunk handles OpenGL stencil tests by wrapping glStencilFunc()\n"
405 "and glStencilOp(). \n"
408 /*------------------------------ get -----------------------------------*/
410 FieldContainerType
&StencilChunkBase::getType(void)
415 const FieldContainerType
&StencilChunkBase::getType(void) const
420 UInt32
StencilChunkBase::getContainerSize(void) const
422 return sizeof(StencilChunk
);
425 /*------------------------- decorator get ------------------------------*/
428 SFGLenum
*StencilChunkBase::editSFStencilFunc(void)
430 editSField(StencilFuncFieldMask
);
432 return &_sfStencilFunc
;
435 const SFGLenum
*StencilChunkBase::getSFStencilFunc(void) const
437 return &_sfStencilFunc
;
441 SFInt32
*StencilChunkBase::editSFStencilValue(void)
443 editSField(StencilValueFieldMask
);
445 return &_sfStencilValue
;
448 const SFInt32
*StencilChunkBase::getSFStencilValue(void) const
450 return &_sfStencilValue
;
454 SFUInt32
*StencilChunkBase::editSFStencilMask(void)
456 editSField(StencilMaskFieldMask
);
458 return &_sfStencilMask
;
461 const SFUInt32
*StencilChunkBase::getSFStencilMask(void) const
463 return &_sfStencilMask
;
467 SFGLenum
*StencilChunkBase::editSFStencilOpFail(void)
469 editSField(StencilOpFailFieldMask
);
471 return &_sfStencilOpFail
;
474 const SFGLenum
*StencilChunkBase::getSFStencilOpFail(void) const
476 return &_sfStencilOpFail
;
480 SFGLenum
*StencilChunkBase::editSFStencilOpZFail(void)
482 editSField(StencilOpZFailFieldMask
);
484 return &_sfStencilOpZFail
;
487 const SFGLenum
*StencilChunkBase::getSFStencilOpZFail(void) const
489 return &_sfStencilOpZFail
;
493 SFGLenum
*StencilChunkBase::editSFStencilOpZPass(void)
495 editSField(StencilOpZPassFieldMask
);
497 return &_sfStencilOpZPass
;
500 const SFGLenum
*StencilChunkBase::getSFStencilOpZPass(void) const
502 return &_sfStencilOpZPass
;
506 SFInt32
*StencilChunkBase::editSFClearBuffer(void)
508 editSField(ClearBufferFieldMask
);
510 return &_sfClearBuffer
;
513 const SFInt32
*StencilChunkBase::getSFClearBuffer(void) const
515 return &_sfClearBuffer
;
519 SFUInt32
*StencilChunkBase::editSFBitMask(void)
521 editSField(BitMaskFieldMask
);
526 const SFUInt32
*StencilChunkBase::getSFBitMask(void) const
536 /*------------------------------ access -----------------------------------*/
538 SizeT
StencilChunkBase::getBinSize(ConstFieldMaskArg whichField
)
540 SizeT returnValue
= Inherited::getBinSize(whichField
);
542 if(FieldBits::NoField
!= (StencilFuncFieldMask
& whichField
))
544 returnValue
+= _sfStencilFunc
.getBinSize();
546 if(FieldBits::NoField
!= (StencilValueFieldMask
& whichField
))
548 returnValue
+= _sfStencilValue
.getBinSize();
550 if(FieldBits::NoField
!= (StencilMaskFieldMask
& whichField
))
552 returnValue
+= _sfStencilMask
.getBinSize();
554 if(FieldBits::NoField
!= (StencilOpFailFieldMask
& whichField
))
556 returnValue
+= _sfStencilOpFail
.getBinSize();
558 if(FieldBits::NoField
!= (StencilOpZFailFieldMask
& whichField
))
560 returnValue
+= _sfStencilOpZFail
.getBinSize();
562 if(FieldBits::NoField
!= (StencilOpZPassFieldMask
& whichField
))
564 returnValue
+= _sfStencilOpZPass
.getBinSize();
566 if(FieldBits::NoField
!= (ClearBufferFieldMask
& whichField
))
568 returnValue
+= _sfClearBuffer
.getBinSize();
570 if(FieldBits::NoField
!= (BitMaskFieldMask
& whichField
))
572 returnValue
+= _sfBitMask
.getBinSize();
578 void StencilChunkBase::copyToBin(BinaryDataHandler
&pMem
,
579 ConstFieldMaskArg whichField
)
581 Inherited::copyToBin(pMem
, whichField
);
583 if(FieldBits::NoField
!= (StencilFuncFieldMask
& whichField
))
585 _sfStencilFunc
.copyToBin(pMem
);
587 if(FieldBits::NoField
!= (StencilValueFieldMask
& whichField
))
589 _sfStencilValue
.copyToBin(pMem
);
591 if(FieldBits::NoField
!= (StencilMaskFieldMask
& whichField
))
593 _sfStencilMask
.copyToBin(pMem
);
595 if(FieldBits::NoField
!= (StencilOpFailFieldMask
& whichField
))
597 _sfStencilOpFail
.copyToBin(pMem
);
599 if(FieldBits::NoField
!= (StencilOpZFailFieldMask
& whichField
))
601 _sfStencilOpZFail
.copyToBin(pMem
);
603 if(FieldBits::NoField
!= (StencilOpZPassFieldMask
& whichField
))
605 _sfStencilOpZPass
.copyToBin(pMem
);
607 if(FieldBits::NoField
!= (ClearBufferFieldMask
& whichField
))
609 _sfClearBuffer
.copyToBin(pMem
);
611 if(FieldBits::NoField
!= (BitMaskFieldMask
& whichField
))
613 _sfBitMask
.copyToBin(pMem
);
617 void StencilChunkBase::copyFromBin(BinaryDataHandler
&pMem
,
618 ConstFieldMaskArg whichField
)
620 Inherited::copyFromBin(pMem
, whichField
);
622 if(FieldBits::NoField
!= (StencilFuncFieldMask
& whichField
))
624 editSField(StencilFuncFieldMask
);
625 _sfStencilFunc
.copyFromBin(pMem
);
627 if(FieldBits::NoField
!= (StencilValueFieldMask
& whichField
))
629 editSField(StencilValueFieldMask
);
630 _sfStencilValue
.copyFromBin(pMem
);
632 if(FieldBits::NoField
!= (StencilMaskFieldMask
& whichField
))
634 editSField(StencilMaskFieldMask
);
635 _sfStencilMask
.copyFromBin(pMem
);
637 if(FieldBits::NoField
!= (StencilOpFailFieldMask
& whichField
))
639 editSField(StencilOpFailFieldMask
);
640 _sfStencilOpFail
.copyFromBin(pMem
);
642 if(FieldBits::NoField
!= (StencilOpZFailFieldMask
& whichField
))
644 editSField(StencilOpZFailFieldMask
);
645 _sfStencilOpZFail
.copyFromBin(pMem
);
647 if(FieldBits::NoField
!= (StencilOpZPassFieldMask
& whichField
))
649 editSField(StencilOpZPassFieldMask
);
650 _sfStencilOpZPass
.copyFromBin(pMem
);
652 if(FieldBits::NoField
!= (ClearBufferFieldMask
& whichField
))
654 editSField(ClearBufferFieldMask
);
655 _sfClearBuffer
.copyFromBin(pMem
);
657 if(FieldBits::NoField
!= (BitMaskFieldMask
& whichField
))
659 editSField(BitMaskFieldMask
);
660 _sfBitMask
.copyFromBin(pMem
);
664 //! create a new instance of the class
665 StencilChunkTransitPtr
StencilChunkBase::createLocal(BitVector bFlags
)
667 StencilChunkTransitPtr fc
;
669 if(getClassType().getPrototype() != NULL
)
671 FieldContainerTransitPtr tmpPtr
=
672 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
674 fc
= dynamic_pointer_cast
<StencilChunk
>(tmpPtr
);
680 //! create a new instance of the class, copy the container flags
681 StencilChunkTransitPtr
StencilChunkBase::createDependent(BitVector bFlags
)
683 StencilChunkTransitPtr fc
;
685 if(getClassType().getPrototype() != NULL
)
687 FieldContainerTransitPtr tmpPtr
=
688 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
690 fc
= dynamic_pointer_cast
<StencilChunk
>(tmpPtr
);
696 //! create a new instance of the class
697 StencilChunkTransitPtr
StencilChunkBase::create(void)
699 StencilChunkTransitPtr fc
;
701 if(getClassType().getPrototype() != NULL
)
703 FieldContainerTransitPtr tmpPtr
=
704 getClassType().getPrototype()-> shallowCopy();
706 fc
= dynamic_pointer_cast
<StencilChunk
>(tmpPtr
);
712 StencilChunk
*StencilChunkBase::createEmptyLocal(BitVector bFlags
)
714 StencilChunk
*returnValue
;
716 newPtr
<StencilChunk
>(returnValue
, bFlags
);
718 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
723 //! create an empty new instance of the class, do not copy the prototype
724 StencilChunk
*StencilChunkBase::createEmpty(void)
726 StencilChunk
*returnValue
;
728 newPtr
<StencilChunk
>(returnValue
, Thread::getCurrentLocalFlags());
730 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
731 ~Thread::getCurrentLocalFlags();
737 FieldContainerTransitPtr
StencilChunkBase::shallowCopyLocal(
738 BitVector bFlags
) const
740 StencilChunk
*tmpPtr
;
742 newPtr(tmpPtr
, dynamic_cast<const StencilChunk
*>(this), bFlags
);
744 FieldContainerTransitPtr
returnValue(tmpPtr
);
746 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
751 FieldContainerTransitPtr
StencilChunkBase::shallowCopyDependent(
752 BitVector bFlags
) const
754 StencilChunk
*tmpPtr
;
756 newPtr(tmpPtr
, dynamic_cast<const StencilChunk
*>(this), ~bFlags
);
758 FieldContainerTransitPtr
returnValue(tmpPtr
);
760 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
765 FieldContainerTransitPtr
StencilChunkBase::shallowCopy(void) const
767 StencilChunk
*tmpPtr
;
770 dynamic_cast<const StencilChunk
*>(this),
771 Thread::getCurrentLocalFlags());
773 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
775 FieldContainerTransitPtr
returnValue(tmpPtr
);
783 /*------------------------- constructors ----------------------------------*/
785 StencilChunkBase::StencilChunkBase(void) :
787 _sfStencilFunc (GLenum(GL_NONE
)),
788 _sfStencilValue (Int32(0)),
789 _sfStencilMask (UInt32(0x1)),
790 _sfStencilOpFail (GLenum(GL_KEEP
)),
791 _sfStencilOpZFail (GLenum(GL_KEEP
)),
792 _sfStencilOpZPass (GLenum(GL_KEEP
)),
793 _sfClearBuffer (Int32(0)),
794 _sfBitMask (UInt32(0xFFFFFFFF))
798 StencilChunkBase::StencilChunkBase(const StencilChunkBase
&source
) :
800 _sfStencilFunc (source
._sfStencilFunc
),
801 _sfStencilValue (source
._sfStencilValue
),
802 _sfStencilMask (source
._sfStencilMask
),
803 _sfStencilOpFail (source
._sfStencilOpFail
),
804 _sfStencilOpZFail (source
._sfStencilOpZFail
),
805 _sfStencilOpZPass (source
._sfStencilOpZPass
),
806 _sfClearBuffer (source
._sfClearBuffer
),
807 _sfBitMask (source
._sfBitMask
)
812 /*-------------------------- destructors ----------------------------------*/
814 StencilChunkBase::~StencilChunkBase(void)
819 GetFieldHandlePtr
StencilChunkBase::getHandleStencilFunc (void) const
821 SFGLenum::GetHandlePtr
returnValue(
822 new SFGLenum::GetHandle(
824 this->getType().getFieldDesc(StencilFuncFieldId
),
825 const_cast<StencilChunkBase
*>(this)));
830 EditFieldHandlePtr
StencilChunkBase::editHandleStencilFunc (void)
832 SFGLenum::EditHandlePtr
returnValue(
833 new SFGLenum::EditHandle(
835 this->getType().getFieldDesc(StencilFuncFieldId
),
839 editSField(StencilFuncFieldMask
);
844 GetFieldHandlePtr
StencilChunkBase::getHandleStencilValue (void) const
846 SFInt32::GetHandlePtr
returnValue(
847 new SFInt32::GetHandle(
849 this->getType().getFieldDesc(StencilValueFieldId
),
850 const_cast<StencilChunkBase
*>(this)));
855 EditFieldHandlePtr
StencilChunkBase::editHandleStencilValue (void)
857 SFInt32::EditHandlePtr
returnValue(
858 new SFInt32::EditHandle(
860 this->getType().getFieldDesc(StencilValueFieldId
),
864 editSField(StencilValueFieldMask
);
869 GetFieldHandlePtr
StencilChunkBase::getHandleStencilMask (void) const
871 SFUInt32::GetHandlePtr
returnValue(
872 new SFUInt32::GetHandle(
874 this->getType().getFieldDesc(StencilMaskFieldId
),
875 const_cast<StencilChunkBase
*>(this)));
880 EditFieldHandlePtr
StencilChunkBase::editHandleStencilMask (void)
882 SFUInt32::EditHandlePtr
returnValue(
883 new SFUInt32::EditHandle(
885 this->getType().getFieldDesc(StencilMaskFieldId
),
889 editSField(StencilMaskFieldMask
);
894 GetFieldHandlePtr
StencilChunkBase::getHandleStencilOpFail (void) const
896 SFGLenum::GetHandlePtr
returnValue(
897 new SFGLenum::GetHandle(
899 this->getType().getFieldDesc(StencilOpFailFieldId
),
900 const_cast<StencilChunkBase
*>(this)));
905 EditFieldHandlePtr
StencilChunkBase::editHandleStencilOpFail (void)
907 SFGLenum::EditHandlePtr
returnValue(
908 new SFGLenum::EditHandle(
910 this->getType().getFieldDesc(StencilOpFailFieldId
),
914 editSField(StencilOpFailFieldMask
);
919 GetFieldHandlePtr
StencilChunkBase::getHandleStencilOpZFail (void) const
921 SFGLenum::GetHandlePtr
returnValue(
922 new SFGLenum::GetHandle(
924 this->getType().getFieldDesc(StencilOpZFailFieldId
),
925 const_cast<StencilChunkBase
*>(this)));
930 EditFieldHandlePtr
StencilChunkBase::editHandleStencilOpZFail (void)
932 SFGLenum::EditHandlePtr
returnValue(
933 new SFGLenum::EditHandle(
935 this->getType().getFieldDesc(StencilOpZFailFieldId
),
939 editSField(StencilOpZFailFieldMask
);
944 GetFieldHandlePtr
StencilChunkBase::getHandleStencilOpZPass (void) const
946 SFGLenum::GetHandlePtr
returnValue(
947 new SFGLenum::GetHandle(
949 this->getType().getFieldDesc(StencilOpZPassFieldId
),
950 const_cast<StencilChunkBase
*>(this)));
955 EditFieldHandlePtr
StencilChunkBase::editHandleStencilOpZPass (void)
957 SFGLenum::EditHandlePtr
returnValue(
958 new SFGLenum::EditHandle(
960 this->getType().getFieldDesc(StencilOpZPassFieldId
),
964 editSField(StencilOpZPassFieldMask
);
969 GetFieldHandlePtr
StencilChunkBase::getHandleClearBuffer (void) const
971 SFInt32::GetHandlePtr
returnValue(
972 new SFInt32::GetHandle(
974 this->getType().getFieldDesc(ClearBufferFieldId
),
975 const_cast<StencilChunkBase
*>(this)));
980 EditFieldHandlePtr
StencilChunkBase::editHandleClearBuffer (void)
982 SFInt32::EditHandlePtr
returnValue(
983 new SFInt32::EditHandle(
985 this->getType().getFieldDesc(ClearBufferFieldId
),
989 editSField(ClearBufferFieldMask
);
994 GetFieldHandlePtr
StencilChunkBase::getHandleBitMask (void) const
996 SFUInt32::GetHandlePtr
returnValue(
997 new SFUInt32::GetHandle(
999 this->getType().getFieldDesc(BitMaskFieldId
),
1000 const_cast<StencilChunkBase
*>(this)));
1005 EditFieldHandlePtr
StencilChunkBase::editHandleBitMask (void)
1007 SFUInt32::EditHandlePtr
returnValue(
1008 new SFUInt32::EditHandle(
1010 this->getType().getFieldDesc(BitMaskFieldId
),
1014 editSField(BitMaskFieldMask
);
1020 #ifdef OSG_MT_CPTR_ASPECT
1021 void StencilChunkBase::execSyncV( FieldContainer
&oFrom
,
1022 ConstFieldMaskArg whichField
,
1023 AspectOffsetStore
&oOffsets
,
1024 ConstFieldMaskArg syncMode
,
1025 const UInt32 uiSyncInfo
)
1027 StencilChunk
*pThis
= static_cast<StencilChunk
*>(this);
1029 pThis
->execSync(static_cast<StencilChunk
*>(&oFrom
),
1038 #ifdef OSG_MT_CPTR_ASPECT
1039 FieldContainer
*StencilChunkBase::createAspectCopy(
1040 const FieldContainer
*pRefAspect
) const
1042 StencilChunk
*returnValue
;
1044 newAspectCopy(returnValue
,
1045 dynamic_cast<const StencilChunk
*>(pRefAspect
),
1046 dynamic_cast<const StencilChunk
*>(this));
1052 void StencilChunkBase::resolveLinks(void)
1054 Inherited::resolveLinks();