Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::SHLParameterChunkBase Class Reference

SHLParameterChunk Base Class.

#include <OSGSHLParameterChunkBase.h>

Inheritance diagram for osg::SHLParameterChunkBase:

osg::ShaderParameterChunk osg::ShaderParameterChunkBase osg::StateChunk osg::StateChunkBase osg::Attachment osg::FieldContainer osg::SHLParameterChunk List of all members.

Chunk Class Access

*UInt32 getClassId (void) const
virtual const StateChunkClassgetClass (void) 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)
virtual bool isTransparent (void) const

Public Types

typedef SHLParameterChunkPtr Ptr
enum  { SHLChunkFieldId = Inherited::NextFieldId, NextFieldId = SHLChunkFieldId + 1 }

Public Member Functions

Field Get
*MFShaderParameterPtrgetMFParameters (void)
 Get the ShaderParameterChunk::_mfParameters field.
ShaderParameterPtrgetParameters (const UInt32 index)
 Get the value of the index element the ShaderParameterChunk::_mfParameters field.
MFShaderParameterPtrgetParameters (void)
 Get the ShaderParameterChunk::_mfParameters field.
const MFShaderParameterPtrgetParameters (void) const
 Get the ShaderParameterChunk::_mfParameters field.
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFSHLChunkPtrgetSFSHLChunk (void)
 Get the SHLParameterChunk::_sfSHLChunk field.
SHLChunkPtrgetSHLChunk (void)
 Get the value of the SHLParameterChunk::_sfSHLChunk field.
const SHLChunkPtrgetSHLChunk (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
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) 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
*MFShaderParameterPtrgetMFParameters (void)
 Get the ShaderParameterChunk::_mfParameters field.
ShaderParameterPtrgetParameters (const UInt32 index)
 Get the value of the index element the ShaderParameterChunk::_mfParameters field.
MFShaderParameterPtrgetParameters (void)
 Get the ShaderParameterChunk::_mfParameters field.
const MFShaderParameterPtrgetParameters (void) const
 Get the ShaderParameterChunk::_mfParameters field.

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (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 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
SHLParameterChunkBase (void)
 SHLParameterChunkBase (const SHLParameterChunkBase &source)
Destructors
*virtual ~SHLParameterChunkBase (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)

Protected Attributes

Fields
*MFShaderParameterPtr _mfParameters
Fields
*SFSHLChunkPtr _sfSHLChunk
Parameter Access
*ShaderParameterAccess_parameter_access
Fields
*MFShaderParameterPtr _mfParameters

Private Types

typedef ShaderParameterChunk Inherited

Private Member Functions

void operator= (const SHLParameterChunkBase &source)

Static Private Attributes

static FieldDescription_desc []
 SHLParameterChunk description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 81 of file OSGSHLParameterChunkBase.h.


Member Typedef Documentation

typedef ShaderParameterChunk osg::SHLParameterChunkBase::Inherited [private]
 

Reimplemented from osg::ShaderParameterChunk.

Reimplemented in osg::SHLParameterChunk.

Definition at line 85 of file OSGSHLParameterChunkBase.h.

typedef SHLParameterChunkPtr osg::SHLParameterChunkBase::Ptr
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 90 of file OSGSHLParameterChunkBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
SHLChunkFieldId 
NextFieldId 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 92 of file OSGSHLParameterChunkBase.h.

00093     {
00094         SHLChunkFieldId = Inherited::NextFieldId,
00095         NextFieldId     = SHLChunkFieldId + 1
00096     };


Constructor & Destructor Documentation

SHLParameterChunkBase::SHLParameterChunkBase void   )  [protected]
 

Definition at line 164 of file OSGSHLParameterChunkBase.cpp.

00164                                                  :
00165     _sfSHLChunk               (SHLChunkPtr(NullFC)), 
00166     Inherited() 
00167 {
00168 }

SHLParameterChunkBase::SHLParameterChunkBase const SHLParameterChunkBase source  )  [protected]
 

Definition at line 174 of file OSGSHLParameterChunkBase.cpp.

00174                                                                                 :
00175     _sfSHLChunk               (source._sfSHLChunk               ), 
00176     Inherited                 (source)
00177 {
00178 }

SHLParameterChunkBase::~SHLParameterChunkBase void   )  [protected, virtual]
 

Definition at line 182 of file OSGSHLParameterChunkBase.cpp.

00183 {
00184 }


Member Function Documentation

osg::FieldContainerType & osg::SHLParameterChunkBase::getClassType void   )  [inline, static]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 58 of file OSGSHLParameterChunkBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::SHLParameterChunkBase::getClassTypeId void   )  [inline, static]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 65 of file OSGSHLParameterChunkBase.inl.

References _type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & SHLParameterChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 106 of file OSGSHLParameterChunkBase.cpp.

References _type.

00107 {
00108     return _type; 
00109 } 

const FieldContainerType & SHLParameterChunkBase::getType void   )  const [virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 111 of file OSGSHLParameterChunkBase.cpp.

References _type.

00112 {
00113     return _type;
00114 } 

UInt32 SHLParameterChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 126 of file OSGSHLParameterChunkBase.cpp.

00127 { 
00128     return sizeof(SHLParameterChunk); 
00129 }

SFSHLChunkPtr * osg::SHLParameterChunkBase::getSFSHLChunk void   )  [inline]
 

Definition at line 101 of file OSGSHLParameterChunkBase.inl.

References _sfSHLChunk.

00102 {
00103     return &_sfSHLChunk;
00104 }

SHLChunkPtr & osg::SHLParameterChunkBase::getSHLChunk void   )  [inline]
 

Definition at line 109 of file OSGSHLParameterChunkBase.inl.

References _sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::SHLParameterChunk::updateParameters().

00110 {
00111     return _sfSHLChunk.getValue();
00112 }

const SHLChunkPtr & osg::SHLParameterChunkBase::getSHLChunk void   )  const [inline]
 

Definition at line 116 of file OSGSHLParameterChunkBase.inl.

References _sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00117 {
00118     return _sfSHLChunk.getValue();
00119 }

void osg::SHLParameterChunkBase::setSHLChunk const SHLChunkPtr value  )  [inline]
 

Definition at line 123 of file OSGSHLParameterChunkBase.inl.

References _sfSHLChunk, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00124 {
00125     _sfSHLChunk.setValue(value);
00126 }

UInt32 SHLParameterChunkBase::getBinSize const BitVector whichField  )  [virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 188 of file OSGSHLParameterChunkBase.cpp.

References _sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::ShaderParameterChunkBase::getBinSize(), osg::FieldBits::NoField, and 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 }

void SHLParameterChunkBase::copyToBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 201 of file OSGSHLParameterChunkBase.cpp.

References _sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::ShaderParameterChunkBase::copyToBin(), osg::FieldBits::NoField, and SHLChunkFieldMask.

00203 {
00204     Inherited::copyToBin(pMem, whichField);
00205 
00206     if(FieldBits::NoField != (SHLChunkFieldMask & whichField))
00207     {
00208         _sfSHLChunk.copyToBin(pMem);
00209     }
00210 
00211 
00212 }

void SHLParameterChunkBase::copyFromBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 214 of file OSGSHLParameterChunkBase.cpp.

References _sfSHLChunk, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::ShaderParameterChunkBase::copyFromBin(), osg::FieldBits::NoField, and SHLChunkFieldMask.

00216 {
00217     Inherited::copyFromBin(pMem, whichField);
00218 
00219     if(FieldBits::NoField != (SHLChunkFieldMask & whichField))
00220     {
00221         _sfSHLChunk.copyFromBin(pMem);
00222     }
00223 
00224 
00225 }

SHLParameterChunkPtr osg::SHLParameterChunkBase::create void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 72 of file OSGSHLParameterChunkBase.inl.

References osg::AttachmentPtr::dcast(), getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and 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 }

SHLParameterChunkPtr osg::SHLParameterChunkBase::createEmpty void   )  [inline, static]
 

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 }

FieldContainerPtr SHLParameterChunkBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::Attachment.

Definition at line 117 of file OSGSHLParameterChunkBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00118 { 
00119     SHLParameterChunkPtr returnValue; 
00120 
00121     newPtr(returnValue, dynamic_cast<const SHLParameterChunk *>(this)); 
00122 
00123     return returnValue; 
00124 }

void SHLParameterChunkBase::executeSyncImpl SHLParameterChunkBase pOther,
const BitVector whichField
[protected]
 

Definition at line 228 of file OSGSHLParameterChunkBase.cpp.

References _sfSHLChunk, osg::ShaderParameterChunkBase::executeSyncImpl(), osg::FieldBits::NoField, SHLChunkFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by executeSync().

00230 {
00231 
00232     Inherited::executeSyncImpl(pOther, whichField);
00233 
00234     if(FieldBits::NoField != (SHLChunkFieldMask & whichField))
00235         _sfSHLChunk.syncWith(pOther->_sfSHLChunk);
00236 
00237 
00238 }

void SHLParameterChunkBase::executeSync FieldContainer other,
const BitVector whichField
[protected, virtual]
 

Reimplemented from osg::ShaderParameterChunkBase.

Definition at line 133 of file OSGSHLParameterChunkBase.cpp.

References executeSyncImpl().

00135 {
00136     this->executeSyncImpl((SHLParameterChunkBase *) &other, whichField);
00137 }

void osg::SHLParameterChunkBase::operator= const SHLParameterChunkBase source  )  [private]
 

void ShaderParameterChunk::changed BitVector  whichField,
UInt32  origin
[virtual, inherited]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::ShaderChunk, osg::SHLChunk, and osg::SHLParameterChunk.

Definition at line 129 of file OSGShaderParameterChunk.cpp.

References osg::StateChunk::changed().

Referenced by osg::SHLParameterChunk::changed(), and osg::ShaderChunk::changed().

00130 {
00131     Inherited::changed(whichField, origin);
00132 }

void ShaderParameterChunk::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual, inherited]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::ShaderChunk, osg::SHLChunk, and osg::SHLParameterChunk.

Definition at line 134 of file OSGShaderParameterChunk.cpp.

References SLOG.

00136 {
00137     SLOG << "Dump ShaderParameterChunk NI" << std::endl;
00138 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
bool  value
[inherited]
 

Definition at line 145 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

Referenced by osg::SHLChunk::addParameterCallback().

00146 {
00147     return _parameter_access->setParameter<ShaderParameterBool>(name, value);
00148 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
Int32  value
[inherited]
 

Definition at line 150 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00151 {
00152     return _parameter_access->setParameter<ShaderParameterInt>(name, value);
00153 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
Real32  value
[inherited]
 

Definition at line 155 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00156 {
00157     return _parameter_access->setParameter<ShaderParameterReal>(name, value);
00158 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
const Vec2f value
[inherited]
 

Definition at line 160 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00161 {
00162     return _parameter_access->setParameter<ShaderParameterVec2f>(name, value);
00163 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
const Vec3f value
[inherited]
 

Definition at line 165 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00166 {
00167     return _parameter_access->setParameter<ShaderParameterVec3f>(name, value);
00168 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
const Vec4f value
[inherited]
 

Definition at line 170 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00171 {
00172     return _parameter_access->setParameter<ShaderParameterVec4f>(name, value);
00173 }

bool ShaderParameterChunk::setUniformParameter const char *  name,
const Matrix value
[inherited]
 

Definition at line 175 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::setParameter().

00176 {
00177     return _parameter_access->setParameter<ShaderParameterMatrix>(name, value);
00178 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
bool &  value
[inherited]
 

Definition at line 182 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00183 {
00184     return _parameter_access->getParameter<ShaderParameterBool>(name, value);
00185 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Int32 value
[inherited]
 

Definition at line 187 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00188 {
00189     return _parameter_access->getParameter<ShaderParameterInt>(name, value);
00190 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Real32 value
[inherited]
 

Definition at line 192 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00193 {
00194     return _parameter_access->getParameter<ShaderParameterReal>(name, value);
00195 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Vec2f value
[inherited]
 

Definition at line 197 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00198 {
00199     return _parameter_access->getParameter<ShaderParameterVec2f>(name, value);
00200 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Vec3f value
[inherited]
 

Definition at line 202 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00203 {
00204     return _parameter_access->getParameter<ShaderParameterVec3f>(name, value);
00205 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Vec4f value
[inherited]
 

Definition at line 207 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00208 {
00209     return _parameter_access->getParameter<ShaderParameterVec4f>(name, value);
00210 }

bool ShaderParameterChunk::getUniformParameter const char *  name,
Matrix value
[inherited]
 

Definition at line 212 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::getParameter().

00213 {
00214     return _parameter_access->getParameter<ShaderParameterMatrix>(name, value);
00215 }

bool ShaderParameterChunk::subUniformParameter const char *  name  )  [inherited]
 

Definition at line 217 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::ShaderParameterAccess::subParameter().

00218 {
00219     return _parameter_access->subParameter(name);
00220 }

void ShaderParameterChunk::onCreate const ShaderParameterChunk source = NULL  )  [protected, inherited]
 

Definition at line 108 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, osg::ShaderParameterChunkBase::getParameters(), osg::GlobalSystemState, osg::FieldContainer::onCreate(), and osg::Startup.

Referenced by osg::SHLChunk::onCreate().

00109 {
00110     Inherited::onCreate(source);
00111 
00112     // ignore prototypes.
00113     if(GlobalSystemState == Startup)
00114         return;
00115 
00116     _parameter_access = new ShaderParameterAccess(getParameters());
00117 }

void osg::FieldContainer::onCreate const FieldContainer source = NULL  )  [inline, protected, inherited]
 

Definition at line 318 of file OSGFieldContainerImpl.inl.

Referenced by osg::ShaderParameterChunk::onCreate().

00319 {
00320 }

void ShaderParameterChunk::onDestroy void   )  [protected, virtual, inherited]
 

Reimplemented from osg::Attachment.

Reimplemented in osg::SHLChunk.

Definition at line 119 of file OSGShaderParameterChunk.cpp.

References osg::ShaderParameterChunk::_parameter_access, and osg::Attachment::onDestroy().

Referenced by osg::SHLChunk::onDestroy().

00120 {
00121     Inherited::onDestroy();
00122 
00123     if(_parameter_access != NULL)
00124         delete _parameter_access;
00125 }