#include <OSGSHLParameterChunk.h>
Inheritance diagram for osg::SHLParameterChunk:

Public Types | |
| typedef SHLParameterChunkPtr | Ptr |
| enum | { SHLChunkFieldId = Inherited::NextFieldId, NextFieldId = SHLChunkFieldId + 1 } |
Public Member Functions | |
| 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 | |
| *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 | |
| *SFSHLChunkPtr * | getSFSHLChunk (void) |
| Get the SHLParameterChunk::_sfSHLChunk field. | |
| SHLChunkPtr & | getSHLChunk (void) |
| Get the value of the SHLParameterChunk::_sfSHLChunk field. | |
| const SHLChunkPtr & | getSHLChunk (void) const |
| Get the value of the SHLParameterChunk::_sfSHLChunk field. | |
Field Set | |
| *void | setSHLChunk (const SHLChunkPtr &value) |
| Set the value of the SHLParameterChunk::_sfSHLChunk 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 |
ShaderParameterChunk Access | |
| *bool | setUniformParameter (const char *name, bool value) |
| bool | setUniformParameter (const char *name, Int32 value) |
| bool | setUniformParameter (const char *name, Real32 value) |
| bool | setUniformParameter (const char *name, const Vec2f &value) |
| bool | setUniformParameter (const char *name, const Vec3f &value) |
| bool | setUniformParameter (const char *name, const Vec4f &value) |
| bool | setUniformParameter (const char *name, const Matrix &value) |
| bool | getUniformParameter (const char *name, bool &value) |
| bool | getUniformParameter (const char *name, Int32 &value) |
| bool | getUniformParameter (const char *name, Real32 &value) |
| bool | getUniformParameter (const char *name, Vec2f &value) |
| bool | getUniformParameter (const char *name, Vec3f &value) |
| bool | getUniformParameter (const char *name, Vec4f &value) |
| bool | getUniformParameter (const char *name, Matrix &value) |
| bool | subUniformParameter (const char *name) |
Field Get | |
| *MFShaderParameterPtr * | getMFParameters (void) |
| Get the ShaderParameterChunk::_mfParameters field. | |
| ShaderParameterPtr & | getParameters (const UInt32 index) |
| Get the value of the index element the ShaderParameterChunk::_mfParameters field. | |
| MFShaderParameterPtr & | getParameters (void) |
| Get the ShaderParameterChunk::_mfParameters field. | |
| const MFShaderParameterPtr & | getParameters (void) const |
| Get the ShaderParameterChunk::_mfParameters field. | |
Chunk Class Access | |
| *UInt32 | getClassId (void) const |
State | |
| virtual bool | isTransparent (void) const |
Parents | |
| *MFFieldContainerPtr & | getParents (void) |
| const MFFieldContainerPtr & | getParents (void) const |
| MFFieldContainerPtr * | getMFParents (void) |
| void | addParent (FieldContainerPtr parent) |
| void | subParent (FieldContainerPtr parent) |
| Int32 | findParent (FieldContainerPtr parent) |
Parents | |
| *SFBool & | getInternal (void) |
| const SFBool & | getInternal (void) const |
| SFBool * | getSFInternal (void) |
| void | setInternal (bool bVal) |
Static Public Member Functions | |
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 SHLParameterChunkPtr | create (void) |
| create a new instance of the class | |
| static SHLParameterChunkPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Static Chunk Class Access | |
| *static UInt32 | getStaticClassId (void) |
| static const StateChunkClass * | getStaticClass (void) |
Static Public Attributes | |
| static const osg::BitVector | SHLChunkFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | ParametersFieldMask |
| static const BitVector | InternalFieldMask = (1 << Attachment::InternalFieldId) |
| static const BitVector | ParentsFieldMask = (1 << Attachment::ParentsFieldId) |
| static const BitVector | NextFieldMask |
Protected Member Functions | |
| void | onCreate (const ShaderParameterChunk *source=NULL) |
| void | onDestroy (void) |
Constructors | |
| * | SHLParameterChunk (void) |
| SHLParameterChunk (const SHLParameterChunk &source) | |
Destructors | |
| *virtual | ~SHLParameterChunk (void) |
Sync | |
| *void | executeSyncImpl (SHLParameterChunkBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Sync | |
| *void | executeSyncImpl (ShaderParameterChunkBase *pOther, const BitVector &whichField) |
Sync | |
| *void | executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField) |
Sync | |
| void | executeSyncImpl (Attachment *pOther, const BitVector &whichField) |
Protected Attributes | |
Fields | |
| *SFSHLChunkPtr | _sfSHLChunk |
Parameter Access | |
| *ShaderParameterAccess * | _parameter_access |
Fields | |
| *MFShaderParameterPtr | _mfParameters |
Fields | |
| *SFBool | _sfInternal |
| MFFieldContainerPtr | _parents |
Private Types | |
| typedef SHLParameterChunkBase | Inherited |
Private Member Functions | |
| void | operator= (const SHLParameterChunk &source) |
| void | updateProgram (Window *win) |
| void | updateParameters (Window *win) |
Static Private Member Functions | |
| static void | initMethod (void) |
Static Private Attributes | |
| static StateChunkClass | _class |
OpenGL Extension Handling | |
| *static UInt32 | _shl_extension |
Friends | |
| class | FieldContainer |
| class | SHLParameterChunkBase |
Definition at line 59 of file OSGSHLParameterChunk.h.
|
|
Reimplemented from osg::SHLParameterChunkBase. Definition at line 63 of file OSGSHLParameterChunk.h. |
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 90 of file OSGSHLParameterChunkBase.h. |
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 92 of file OSGSHLParameterChunkBase.h. 00093 { 00094 SHLChunkFieldId = Inherited::NextFieldId, 00095 NextFieldId = SHLChunkFieldId + 1 00096 };
|
|
|
Definition at line 91 of file OSGSHLParameterChunk.cpp. 00091 : 00092 Inherited() 00093 { 00094 }
|
|
|
Definition at line 96 of file OSGSHLParameterChunk.cpp. References _shl_extension, and osg::Window::registerExtension(). 00096 : 00097 Inherited(source) 00098 { 00099 _shl_extension = Window::registerExtension("GL_ARB_shading_language_100"); 00100 }
|
|
|
Definition at line 102 of file OSGSHLParameterChunk.cpp.
|
|
|
Reimplemented from osg::StateChunk. Definition at line 106 of file OSGSHLParameterChunk.cpp. References _class. 00107 { 00108 return &_class; 00109 }
|
|
||||||||||||
|
Reimplemented from osg::ShaderParameterChunk. Definition at line 113 of file OSGSHLParameterChunk.cpp. References osg::ShaderParameterChunk::changed(). 00114 { 00115 Inherited::changed(whichField, origin); 00116 }
|
|
||||||||||||
|
Reimplemented from osg::ShaderParameterChunk. Definition at line 118 of file OSGSHLParameterChunk.cpp. References SLOG. 00120 { 00121 SLOG << "Dump SHLParameterChunk NI" << std::endl; 00122 }
|
|
||||||||||||
|
Activate the chunk, i.e. set the OpenGl state covered by the chunk which is different from the default state to the given state. Reimplemented from osg::StateChunk. Definition at line 126 of file OSGSHLParameterChunk.cpp. References _shl_extension, FWARNING, osg::DrawActionBase::getWindow(), osg::Window::hasExtension(), and updateParameters(). 00127 { 00128 if(!action->getWindow()->hasExtension(_shl_extension)) 00129 { 00130 FWARNING(("OpenGL Shading Language is not supported, couldn't find extension 'GL_ARB_shading_language_100'!\n")); 00131 return; 00132 } 00133 updateParameters(action->getWindow()); 00134 }
|
|
||||||||||||||||
|
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 136 of file OSGSHLParameterChunk.cpp. References _shl_extension, FWARNING, osg::DrawActionBase::getWindow(), osg::Window::hasExtension(), and updateParameters(). 00138 { 00139 if(!action->getWindow()->hasExtension(_shl_extension)) 00140 { 00141 FWARNING(("OpenGL Shading Language is not supported, couldn't find extension 'GL_ARB_shading_language_100'!\n")); 00142 return; 00143 } 00144 00145 SHLParameterChunk *old = dynamic_cast<SHLParameterChunk *>(old_chunk); 00146 00147 if(old == NULL) 00148 { 00149 FWARNING(( "SHLParameterChunk::changeFrom: caught non-SHLParameterChunk!\n")); 00150 return; 00151 } 00152 00153 // SHLParameterChunk didn't change so do nothing. 00154 if(old == this) 00155 return; 00156 00157 updateParameters(action->getWindow()); 00158 }
|
|
||||||||||||
|
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 161 of file OSGSHLParameterChunk.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 167 of file OSGSHLParameterChunk.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 172 of file OSGSHLParameterChunk.cpp.
|
|
|
Compare two chunks. In most cases not implemented yet, will return false. Reimplemented from osg::StateChunk. Definition at line 177 of file OSGSHLParameterChunk.cpp. References osg::ShaderParameterChunkBase::getParameters(), and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00178 { 00179 SHLParameterChunk const *tother = dynamic_cast<SHLParameterChunk const*>(&other); 00180 00181 if(!tother) 00182 return false; 00183 00184 if(getParameters().size() != tother->getParameters().size()) 00185 return false; 00186 00187 return true; 00188 }
|
|
|
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 190 of file OSGSHLParameterChunk.cpp.
|
|
|
Reimplemented from osg::ShaderParameterChunk. Definition at line 76 of file OSGSHLParameterChunk.cpp.
|
|
|
|
|
|
|
|
|
Definition at line 46 of file OSGSHLParameterChunk.inl. References FWARNING, osg::ShaderParameterChunkBase::getParameters(), osg::SHLParameterChunkBase::getSHLChunk(), and osg::NullFC. Referenced by activate(), and changeFrom(). 00047 { 00048 SHLChunkPtr shl = getSHLChunk(); 00049 00050 if(shl == NullFC) 00051 { 00052 FWARNING(("SHLParameterChunk: SHLChunk == NullFC, call setSHLChunk()\n")); 00053 return; 00054 } 00055 00056 shl->updateParameters(win, getParameters(), true, true, true); 00057 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 58 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_type. Referenced by osg::SHLParameterChunkBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 65 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 106 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_type. 00107 { 00108 return _type; 00109 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 111 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_type. 00112 { 00113 return _type; 00114 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 126 of file OSGSHLParameterChunkBase.cpp. 00127 { 00128 return sizeof(SHLParameterChunk); 00129 }
|
|
|
Definition at line 101 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_sfSHLChunk. 00102 { 00103 return &_sfSHLChunk; 00104 }
|
|
|
Definition at line 109 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by updateParameters(). 00110 { 00111 return _sfSHLChunk.getValue(); 00112 }
|
|
|
Definition at line 116 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00117 { 00118 return _sfSHLChunk.getValue(); 00119 }
|
|
|
Definition at line 123 of file OSGSHLParameterChunkBase.inl. References osg::SHLParameterChunkBase::_sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00124 { 00125 _sfSHLChunk.setValue(value); 00126 }
|
|
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 188 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::ShaderParameterChunkBase::getBinSize(), osg::FieldBits::NoField, and osg::SHLParameterChunkBase::SHLChunkFieldMask. 00189 { 00190 UInt32 returnValue = Inherited::getBinSize(whichField); 00191 00192 if(FieldBits::NoField != (SHLChunkFieldMask & whichField)) 00193 { 00194 returnValue += _sfSHLChunk.getBinSize(); 00195 } 00196 00197 00198 return returnValue; 00199 }
|
|
||||||||||||
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 201 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::ShaderParameterChunkBase::copyToBin(), osg::FieldBits::NoField, and osg::SHLParameterChunkBase::SHLChunkFieldMask. 00203 { 00204 Inherited::copyToBin(pMem, whichField); 00205 00206 if(FieldBits::NoField != (SHLChunkFieldMask & whichField)) 00207 { 00208 _sfSHLChunk.copyToBin(pMem); 00209 } 00210 00211 00212 }
|
|
||||||||||||
|
Reimplemented from osg::ShaderParameterChunkBase. Definition at line 214 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::ShaderParameterChunkBase::copyFromBin(), osg::FieldBits::NoField, and osg::SHLParameterChunkBase::SHLChunkFieldMask. 00216 { 00217 Inherited::copyFromBin(pMem, whichField); 00218 00219 if(FieldBits::NoField != (SHLChunkFieldMask & whichField)) 00220 { 00221 _sfSHLChunk.copyFromBin(pMem); 00222 } 00223 00224 00225 }
|
|
|
Reimplemented from osg::Attachment. Definition at line 72 of file OSGSHLParameterChunkBase.inl. References osg::AttachmentPtr::dcast(), osg::SHLParameterChunkBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::SHLParameterChunkBase::shallowCopy(). 00073 { 00074 SHLParameterChunkPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = SHLParameterChunkPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
Reimplemented from osg::Attachment. Definition at line 87 of file OSGSHLParameterChunkBase.inl. References osg::FieldContainer::newPtr(). 00088 { 00089 SHLParameterChunkPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
|
|
|
Reimplemented from osg::Attachment. Definition at line 117 of file OSGSHLParameterChunkBase.cpp. References osg::FieldContainer::newPtr(). Referenced by osg::SHLParameterChunkBase::create(). 00118 { 00119 SHLParameterChunkPtr returnValue; 00120 00121 newPtr(returnValue, dynamic_cast<const SHLParameterChunk *>(this)); 00122 00123 return returnValue; 00124 }
|
|
||||||||||||
|
Definition at line 228 of file OSGSHLParameterChunkBase.cpp. References osg::SHLParameterChunkBase::_sfSHLChunk, osg::ShaderParameterChunkBase::executeSyncImpl(), osg::FieldBits::NoField, osg::SHLParameterChunkBase::SHLChunkFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::SHLParameterChunkBase::executeSync(). 00230 { 00231 00232 Inherited::executeSyncImpl(pOther, whichField); 00233 00234 if(FieldBits::NoField != (SHLChunkFieldMask & whichField)) 00235 _sfSHLChunk.syncWith(pOther->_sfSHLChunk); 00236 00237 00238 }
|
|
||||||||||||
|
Definition at line 220 of file OSGShaderParameterChunkBase.cpp. References osg::ShaderParameterChunkBase::_mfParameters, osg::StateChunkBase::executeSyncImpl(), osg::FieldBits::NoField, osg::ShaderParameterChunkBase::ParametersFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::ShaderParameterChunkBase::executeSync(), osg::SHLParameterChunkBase::executeSyncImpl(), and osg::ShaderChunkBase::executeSyncImpl(). 00222 { 00223 00224 Inherited::executeSyncImpl(pOther, whichField); 00225 00226 if(FieldBits::NoField != (ParametersFieldMask & whichField)) 00227 _mfParameters.syncWith(pOther->_mfParameters); 00228 00229 00230 }
|
|
||||||||||||
|
||||||||||||
|
||||||||||||