#include <OSGStencilChunk.h>
Inheritance diagram for osg::StencilChunk:

Public Types | |
| typedef StencilChunkPtr | Ptr |
| enum | { StencilFuncFieldId = Inherited::NextFieldId, StencilValueFieldId = StencilFuncFieldId + 1, StencilMaskFieldId = StencilValueFieldId + 1, StencilOpFailFieldId = StencilMaskFieldId + 1, StencilOpZFailFieldId = StencilOpFailFieldId + 1, StencilOpZPassFieldId = StencilOpZFailFieldId + 1, ClearBufferFieldId = StencilOpZPassFieldId + 1, NextFieldId = ClearBufferFieldId + 1 } |
Public Member Functions | |
Chunk Class Access | |
| *virtual const StateChunkClass * | getClass (void) const |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
State Commands | |
| *virtual void | activate (DrawActionBase *action, UInt32 index=0) |
| virtual void | changeFrom (DrawActionBase *action, StateChunk *old, UInt32 index=0) |
| virtual void | deactivate (DrawActionBase *action, UInt32 index=0) |
Comparison | |
| *virtual Real32 | switchCost (StateChunk *chunk) |
| virtual bool | operator< (const StateChunk &other) const |
| virtual bool | operator== (const StateChunk &other) const |
| virtual bool | operator!= (const StateChunk &other) const |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFGLenum * | getSFStencilFunc (void) |
| Get the StencilChunk::_sfStencilFunc field. | |
| SFInt32 * | getSFStencilValue (void) |
| Get the StencilChunk::_sfStencilValue field. | |
| SFUInt32 * | getSFStencilMask (void) |
| Get the StencilChunk::_sfStencilMask field. | |
| SFGLenum * | getSFStencilOpFail (void) |
| Get the StencilChunk::_sfStencilOpFail field. | |
| SFGLenum * | getSFStencilOpZFail (void) |
| Get the StencilChunk::_sfStencilOpZFail field. | |
| SFGLenum * | getSFStencilOpZPass (void) |
| Get the StencilChunk::_sfStencilOpZPass field. | |
| SFInt32 * | getSFClearBuffer (void) |
| Get the StencilChunk::_sfClearBuffer field. | |
| GLenum & | getStencilFunc (void) |
| Get the value of the StencilChunk::_sfStencilFunc field. | |
| const GLenum & | getStencilFunc (void) const |
| Get the value of the StencilChunk::_sfStencilFunc field. | |
| Int32 & | getStencilValue (void) |
| Get the value of the StencilChunk::_sfStencilValue field. | |
| const Int32 & | getStencilValue (void) const |
| Get the value of the StencilChunk::_sfStencilValue field. | |
| UInt32 & | getStencilMask (void) |
| Get the value of the StencilChunk::_sfStencilMask field. | |
| const UInt32 & | getStencilMask (void) const |
| Get the value of the StencilChunk::_sfStencilMask field. | |
| GLenum & | getStencilOpFail (void) |
| Get the value of the StencilChunk::_sfStencilOpFail field. | |
| const GLenum & | getStencilOpFail (void) const |
| Get the value of the StencilChunk::_sfStencilOpFail field. | |
| GLenum & | getStencilOpZFail (void) |
| Get the value of the StencilChunk::_sfStencilOpZFail field. | |
| const GLenum & | getStencilOpZFail (void) const |
| Get the value of the StencilChunk::_sfStencilOpZFail field. | |
| GLenum & | getStencilOpZPass (void) |
| Get the value of the StencilChunk::_sfStencilOpZPass field. | |
| const GLenum & | getStencilOpZPass (void) const |
| Get the value of the StencilChunk::_sfStencilOpZPass field. | |
| Int32 & | getClearBuffer (void) |
| Get the value of the StencilChunk::_sfClearBuffer field. | |
| const Int32 & | getClearBuffer (void) const |
| Get the value of the StencilChunk::_sfClearBuffer field. | |
Field Set | |
| *void | setStencilFunc (const GLenum &value) |
| Set the value of the StencilChunk::_sfStencilFunc field. | |
| void | setStencilValue (const Int32 &value) |
| Set the value of the StencilChunk::_sfStencilValue field. | |
| void | setStencilMask (const UInt32 &value) |
| Set the value of the StencilChunk::_sfStencilMask field. | |
| void | setStencilOpFail (const GLenum &value) |
| Set the value of the StencilChunk::_sfStencilOpFail field. | |
| void | setStencilOpZFail (const GLenum &value) |
| Set the value of the StencilChunk::_sfStencilOpZFail field. | |
| void | setStencilOpZPass (const GLenum &value) |
| Set the value of the StencilChunk::_sfStencilOpZPass field. | |
| void | setClearBuffer (const Int32 &value) |
| Set the value of the StencilChunk::_sfClearBuffer field. | |
Binary Access | |
| *virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Copy | |
| *virtual FieldContainerPtr | shallowCopy (void) const |
Static Public Member Functions | |
Static Chunk Class Access | |
| *static UInt32 | getStaticClassId (void) |
| static const StateChunkClass * | getStaticClass (void) |
Class Get | |
| *static FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| *static StencilChunkPtr | create (void) |
| create a new instance of the class | |
| static StencilChunkPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Public Attributes | |
| static const osg::BitVector | StencilFuncFieldMask |
| static const osg::BitVector | StencilValueFieldMask |
| static const osg::BitVector | StencilMaskFieldMask |
| static const osg::BitVector | StencilOpFailFieldMask |
| static const osg::BitVector | StencilOpZFailFieldMask |
| static const osg::BitVector | StencilOpZPassFieldMask |
| static const osg::BitVector | ClearBufferFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const BitVector | InternalFieldMask = (1 << Attachment::InternalFieldId) |
| static const BitVector | ParentsFieldMask = (1 << Attachment::ParentsFieldId) |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
Constructors | |
| * | StencilChunk (void) |
| StencilChunk (const StencilChunk &source) | |
Destructors | |
| *virtual | ~StencilChunk (void) |
Sync | |
| *void | executeSyncImpl (StencilChunkBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Protected Attributes | |
Fields | |
| *SFGLenum | _sfStencilFunc |
| SFInt32 | _sfStencilValue |
| SFUInt32 | _sfStencilMask |
| SFGLenum | _sfStencilOpFail |
| SFGLenum | _sfStencilOpZFail |
| SFGLenum | _sfStencilOpZPass |
| SFInt32 | _sfClearBuffer |
Private Types | |
| typedef StencilChunkBase | Inherited |
Private Member Functions | |
| void | operator= (const StencilChunk &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
Static Private Attributes | |
| static StateChunkClass | _class |
Friends | |
| class | FieldContainer |
| class | StencilChunkBase |
Definition at line 55 of file OSGStencilChunk.h.
|
|
Reimplemented from osg::StencilChunkBase. Definition at line 59 of file OSGStencilChunk.h. |
|
|
Reimplemented from osg::StateChunkBase. Definition at line 96 of file OSGStencilChunkBase.h. |
|
|
Reimplemented from osg::Attachment. Definition at line 98 of file OSGStencilChunkBase.h. 00099 { 00100 StencilFuncFieldId = Inherited::NextFieldId, 00101 StencilValueFieldId = StencilFuncFieldId + 1, 00102 StencilMaskFieldId = StencilValueFieldId + 1, 00103 StencilOpFailFieldId = StencilMaskFieldId + 1, 00104 StencilOpZFailFieldId = StencilOpFailFieldId + 1, 00105 StencilOpZPassFieldId = StencilOpZFailFieldId + 1, 00106 ClearBufferFieldId = StencilOpZPassFieldId + 1, 00107 NextFieldId = ClearBufferFieldId + 1 00108 };
|
|
|
Definition at line 91 of file OSGStencilChunk.cpp. 00091 : 00092 Inherited() 00093 { 00094 }
|
|
|
Definition at line 96 of file OSGStencilChunk.cpp. 00096 : 00097 Inherited(source) 00098 { 00099 }
|
|
|
Definition at line 101 of file OSGStencilChunk.cpp.
|
|
|
Reimplemented from osg::StateChunk. Definition at line 106 of file OSGStencilChunk.cpp. References _class. 00107 { 00108 return &_class; 00109 }
|
|
|
Reimplemented from osg::StateChunk. Definition at line 49 of file OSGStencilChunk.inl. References osg::StateChunkClass::getId(), and getStaticClass(). 00050 { 00051 return getStaticClass()->getId(); 00052 }
|
|
|
Reimplemented from osg::StateChunk. Definition at line 55 of file OSGStencilChunk.inl. References _class. Referenced by getStaticClassId(). 00056 { 00057 return &StencilChunk::_class; 00058 }
|
|
||||||||||||
|
Reimplemented from osg::StateChunk. Definition at line 111 of file OSGStencilChunk.cpp. References osg::StateChunk::changed(). 00112 { 00113 Inherited::changed(whichField, origin); 00114 }
|
|
||||||||||||
|
Reimplemented from osg::StateChunk. Definition at line 116 of file OSGStencilChunk.cpp. References SLOG. 00118 { 00119 SLOG << "Dump StencilChunk NI" << std::endl; 00120 }
|
|
||||||||||||
|
||||||||||||||||
|
Change from an old chunk of the same type to this chunk. Note that in general no type checking is done, make sure to use this on a legal combination of chunks! Reimplemented from osg::StateChunk. Definition at line 142 of file OSGStencilChunk.cpp. References osg::StencilChunkBase::_sfStencilFunc, osg::StencilChunkBase::_sfStencilMask, osg::StencilChunkBase::_sfStencilOpFail, osg::StencilChunkBase::_sfStencilOpZFail, osg::StencilChunkBase::_sfStencilOpZPass, osg::StencilChunkBase::_sfStencilValue, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00145 { 00146 StencilChunk *old = dynamic_cast<StencilChunk *>(old_chunk); 00147 00148 if (_sfStencilFunc.getValue() != GL_NONE) 00149 { 00150 if ( old->_sfStencilFunc.getValue() != _sfStencilFunc.getValue() || 00151 old->_sfStencilValue.getValue() != _sfStencilValue.getValue() || 00152 old->_sfStencilMask.getValue() != _sfStencilMask.getValue() ) 00153 glStencilFunc( _sfStencilFunc.getValue(), 00154 _sfStencilValue.getValue(), 00155 _sfStencilMask.getValue() ); 00156 00157 if ( old->_sfStencilOpFail.getValue() != _sfStencilOpFail.getValue() || 00158 old->_sfStencilOpZFail.getValue() != _sfStencilOpZFail.getValue() || 00159 old->_sfStencilOpZPass.getValue() != _sfStencilOpZPass.getValue() ) 00160 glStencilOp( _sfStencilOpFail.getValue(), 00161 _sfStencilOpZFail.getValue(), 00162 _sfStencilOpZPass.getValue() ); 00163 00164 if(old->_sfStencilFunc.getValue() == GL_NONE) { 00165 glEnable(GL_STENCIL_TEST); 00166 00167 /* 00168 if (_sfClearBuffer.getValue() == 1) 00169 glClear(GL_STENCIL_BUFFER_BIT); 00170 */ 00171 } 00172 } 00173 else 00174 { 00175 if (old->_sfStencilFunc.getValue() != GL_NONE) 00176 { 00177 /* 00178 if (_sfClearBuffer.getValue() == 2) 00179 glClear(GL_STENCIL_BUFFER_BIT); 00180 */ 00181 00182 glDisable(GL_STENCIL_TEST); 00183 } 00184 } 00185 00186 }
|
|
||||||||||||
|
Deactivate the chunk, i.e. set the OpenGl state covered by the chunk which is different from the default state to the default state. Reimplemented from osg::StateChunk. Definition at line 188 of file OSGStencilChunk.cpp. References osg::StencilChunkBase::_sfClearBuffer, osg::StencilChunkBase::_sfStencilFunc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00189 { 00190 if (_sfStencilFunc.getValue() != GL_NONE) 00191 { 00192 if (_sfClearBuffer.getValue() == 2) 00193 glClear(GL_STENCIL_BUFFER_BIT); 00194 00195 glDisable(GL_STENCIL_TEST); 00196 } 00197 }
|
|
|
Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0. Reimplemented from osg::StateChunk. Definition at line 201 of file OSGStencilChunk.cpp.
|
|
|
Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0. Reimplemented from osg::StateChunk. Definition at line 206 of file OSGStencilChunk.cpp.
|
|
|
Compare two chunks. In most cases not implemented yet, will return false. Reimplemented from osg::StateChunk. Definition at line 211 of file OSGStencilChunk.cpp. References osg::StencilChunkBase::getClearBuffer(), osg::StencilChunkBase::getStencilFunc(), osg::StencilChunkBase::getStencilMask(), osg::StencilChunkBase::getStencilOpFail(), osg::StencilChunkBase::getStencilOpZFail(), osg::StencilChunkBase::getStencilOpZPass(), and osg::StencilChunkBase::getStencilValue(). 00212 { 00213 StencilChunk const *tother = dynamic_cast<StencilChunk const*>(&other); 00214 00215 if (!tother) 00216 return false; 00217 00218 if (tother == this) 00219 return true; 00220 00221 if (getStencilFunc() != tother->getStencilFunc() || 00222 getStencilValue() != tother->getStencilValue() || 00223 getStencilMask() != tother->getStencilMask() || 00224 getStencilOpFail() != tother->getStencilOpFail() || 00225 getStencilOpZFail() != tother->getStencilOpZFail() || 00226 getStencilOpZPass() != tother->getStencilOpZPass() || 00227 getClearBuffer() != tother->getClearBuffer()) 00228 return false; 00229 00230 return true; 00231 }
|
|
|
Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0. Reimplemented from osg::StateChunk. Definition at line 233 of file OSGStencilChunk.cpp.
|
|
|
Reimplemented from osg::StateChunk. Definition at line 75 of file OSGStencilChunk.cpp. References osg::StateChunk::initMethod(). 00076 { 00077 Inherited::initMethod(); 00078 }
|
|
|
|
|
|
Reimplemented from osg::StateChunkBase. Definition at line 58 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_type. Referenced by osg::StencilChunkBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::StateChunkBase. Definition at line 65 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::StateChunkBase. Definition at line 176 of file OSGStencilChunkBase.cpp. References osg::StencilChunkBase::_type. 00177 { 00178 return _type; 00179 }
|
|
|
Reimplemented from osg::StateChunkBase. Definition at line 181 of file OSGStencilChunkBase.cpp. References osg::StencilChunkBase::_type. 00182 { 00183 return _type; 00184 }
|
|
|
Reimplemented from osg::StateChunkBase. Definition at line 196 of file OSGStencilChunkBase.cpp. 00197 { 00198 return sizeof(StencilChunk); 00199 }
|
|
|
Definition at line 101 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilFunc. 00102 { 00103 return &_sfStencilFunc; 00104 }
|
|
|
Definition at line 108 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilValue. 00109 { 00110 return &_sfStencilValue; 00111 }
|
|
|
Definition at line 115 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilMask. 00116 { 00117 return &_sfStencilMask; 00118 }
|
|
|
Definition at line 122 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpFail. 00123 { 00124 return &_sfStencilOpFail; 00125 }
|
|
|
Definition at line 129 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpZFail. 00130 { 00131 return &_sfStencilOpZFail; 00132 }
|
|
|
Definition at line 136 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpZPass. 00137 { 00138 return &_sfStencilOpZPass; 00139 }
|
|
|
Definition at line 143 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfClearBuffer. 00144 { 00145 return &_sfClearBuffer; 00146 }
|
|
|
Definition at line 151 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilFunc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by operator==(). 00152 { 00153 return _sfStencilFunc.getValue(); 00154 }
|
|
|
Definition at line 158 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilFunc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00159 { 00160 return _sfStencilFunc.getValue(); 00161 }
|
|
|
Definition at line 172 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilValue, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by operator==(). 00173 { 00174 return _sfStencilValue.getValue(); 00175 }
|
|
|
Definition at line 179 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilValue, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00180 { 00181 return _sfStencilValue.getValue(); 00182 }
|
|
|
Definition at line 193 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilMask, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by operator==(). 00194 { 00195 return _sfStencilMask.getValue(); 00196 }
|
|
|
Definition at line 200 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilMask, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00201 { 00202 return _sfStencilMask.getValue(); 00203 }
|
|
|
Definition at line 214 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpFail, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by operator==(). 00215 { 00216 return _sfStencilOpFail.getValue(); 00217 }
|
|
|
Definition at line 221 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpFail, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00222 { 00223 return _sfStencilOpFail.getValue(); 00224 }
|
|
|
Definition at line 235 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpZFail, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by operator==(). 00236 { 00237 return _sfStencilOpZFail.getValue(); 00238 }
|
|
|
Definition at line 242 of file OSGStencilChunkBase.inl. References osg::StencilChunkBase::_sfStencilOpZFail, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). |