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

osg::FragmentProgramChunkBase Class Reference

FragmentProgramChunk Base Class.

#include <OSGFragmentProgramChunkBase.h>

Inheritance diagram for osg::FragmentProgramChunkBase:

osg::ProgramChunk osg::ProgramChunkBase osg::StateChunk osg::StateChunkBase osg::Attachment osg::FieldContainer osg::FragmentProgramChunk List of all members.

Public Types

typedef FragmentProgramChunkPtr Ptr
enum  {
  ProgramFieldId = Inherited::NextFieldId, ParamValuesFieldId = ProgramFieldId + 1, ParamNamesFieldId = ParamValuesFieldId + 1, GLIdFieldId = ParamNamesFieldId + 1,
  NextFieldId = GLIdFieldId + 1
}

Public Member Functions

ProgamChunk Commands
*bool read (const char *file)
bool read (std::istream &stream)
bool addParameter (const char *name, Int16 index)
bool addParameter (const char *name, Int16 index, const Vec4f &value)
const Vec4fgetParameter (Int16 index)
const Vec4fgetParameter (const char *name)
const Vec4fgetParameter (const std::string &name)
bool setParameter (Int16 index, const Vec4f &value)
bool setParameter (const char *name, const Vec4f &value)
bool setParameter (const std::string &name, const Vec4f &value)
Int16 findParameter (const char *name)
Int16 findParameter (const std::string &name)
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)
virtual bool isTransparent (void) const
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
Field Get
*SFStringgetSFProgram (void)
 Get the ProgramChunk::_sfProgram field.
MFVec4fgetMFParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
MFStringgetMFParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
std::string & getProgram (void)
 Get the value of the ProgramChunk::_sfProgram field.
const std::string & getProgram (void) const
 Get the value of the ProgramChunk::_sfProgram field.
Vec4fgetParamValues (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamValues field.
MFVec4fgetParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
const MFVec4fgetParamValues (void) const
 Get the ProgramChunk::_mfParamValues field.
std::string & getParamNames (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamNames field.
MFStringgetParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
const MFStringgetParamNames (void) const
 Get the ProgramChunk::_mfParamNames field.
Field Set
*void setProgram (const std::string &value)
 Set the value of the ProgramChunk::_sfProgram field.
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
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
Chunk Class Access
*virtual const StateChunkClassgetClass (void) const
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
ProgamChunk Commands
*bool read (const char *file)
bool read (std::istream &stream)
bool addParameter (const char *name, Int16 index)
bool addParameter (const char *name, Int16 index, const Vec4f &value)
const Vec4fgetParameter (Int16 index)
const Vec4fgetParameter (const char *name)
const Vec4fgetParameter (const std::string &name)
bool setParameter (Int16 index, const Vec4f &value)
bool setParameter (const char *name, const Vec4f &value)
bool setParameter (const std::string &name, const Vec4f &value)
Int16 findParameter (const char *name)
Int16 findParameter (const std::string &name)
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)
virtual bool isTransparent (void) const
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
Field Get
*SFStringgetSFProgram (void)
 Get the ProgramChunk::_sfProgram field.
MFVec4fgetMFParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
MFStringgetMFParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
std::string & getProgram (void)
 Get the value of the ProgramChunk::_sfProgram field.
const std::string & getProgram (void) const
 Get the value of the ProgramChunk::_sfProgram field.
Vec4fgetParamValues (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamValues field.
MFVec4fgetParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
const MFVec4fgetParamValues (void) const
 Get the ProgramChunk::_mfParamValues field.
std::string & getParamNames (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamNames field.
MFStringgetParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
const MFStringgetParamNames (void) const
 Get the ProgramChunk::_mfParamNames field.
Field Set
*void setProgram (const std::string &value)
 Set the value of the ProgramChunk::_sfProgram field.
Chunk Class Access
*virtual const StateChunkClassgetClass (void) const
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
ProgamChunk Commands
*bool read (const char *file)
bool read (std::istream &stream)
bool addParameter (const char *name, Int16 index)
bool addParameter (const char *name, Int16 index, const Vec4f &value)
const Vec4fgetParameter (Int16 index)
const Vec4fgetParameter (const char *name)
const Vec4fgetParameter (const std::string &name)
bool setParameter (Int16 index, const Vec4f &value)
bool setParameter (const char *name, const Vec4f &value)
bool setParameter (const std::string &name, const Vec4f &value)
Int16 findParameter (const char *name)
Int16 findParameter (const std::string &name)
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)
virtual bool isTransparent (void) const
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
Field Get
*SFStringgetSFProgram (void)
 Get the ProgramChunk::_sfProgram field.
MFVec4fgetMFParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
MFStringgetMFParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
std::string & getProgram (void)
 Get the value of the ProgramChunk::_sfProgram field.
const std::string & getProgram (void) const
 Get the value of the ProgramChunk::_sfProgram field.
Vec4fgetParamValues (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamValues field.
MFVec4fgetParamValues (void)
 Get the ProgramChunk::_mfParamValues field.
const MFVec4fgetParamValues (void) const
 Get the ProgramChunk::_mfParamValues field.
std::string & getParamNames (const UInt32 index)
 Get the value of the index element the ProgramChunk::_mfParamNames field.
MFStringgetParamNames (void)
 Get the ProgramChunk::_mfParamNames field.
const MFStringgetParamNames (void) const
 Get the ProgramChunk::_mfParamNames field.
Field Set
*void setProgram (const std::string &value)
 Set the value of the ProgramChunk::_sfProgram 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 FragmentProgramChunkPtr create (void)
 create a new instance of the class
static FragmentProgramChunkPtr 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 StateChunkClassgetStaticClass (void)
Static Chunk Class Access
*static UInt32 getStaticClassId (void)
static const StateChunkClassgetStaticClass (void)

Static Public Attributes

static const osg::BitVector MTInfluenceMask
static const osg::BitVector ProgramFieldMask
static const osg::BitVector ParamValuesFieldMask
static const osg::BitVector ParamNamesFieldMask
static const osg::BitVector GLIdFieldMask
static const BitVector InternalFieldMask = (1 << Attachment::InternalFieldId)
static const BitVector ParentsFieldMask = (1 << Attachment::ParentsFieldId)
static const BitVector NextFieldMask

Protected Member Functions

Init
*void onCreate (const ProgramChunk *source=NULL)
GL
*void handleGL (Window *win, UInt32 id, GLenum target, UInt32 extension)
Sync
*void executeSyncImpl (ProgramChunkBase *pOther, const BitVector &whichField)
Program-Specific Methods
void printCompileError (Window *win, UInt32 idstatus)
Field Get
*SFUInt32getSFGLId (void)
 Get the ProgramChunk::_sfGLId field.
UInt32getGLId (void)
 Get the value of the ProgramChunk::_sfGLId field.
const UInt32getGLId (void) const
 Get the value of the ProgramChunk::_sfGLId field.
Field Set
*void setGLId (const UInt32 &value)
 Set the value of the ProgramChunk::_sfGLId field.
Constructors
FragmentProgramChunkBase (void)
 FragmentProgramChunkBase (const FragmentProgramChunkBase &source)
Destructors
*virtual ~FragmentProgramChunkBase (void)
Sync
*void executeSyncImpl (FragmentProgramChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Init
*void onCreate (const ProgramChunk *source=NULL)
Program-Specific Methods
*virtual UInt32 getExtension (void) const
virtual GLenum getTarget (void) const
virtual const char * getTargetName (void) const
void printCompileError (Window *win, UInt32 idstatus)
GL
*void handleGL (Window *win, UInt32 id, GLenum target, UInt32 extension)
Field Get
*SFUInt32getSFGLId (void)
 Get the ProgramChunk::_sfGLId field.
UInt32getGLId (void)
 Get the value of the ProgramChunk::_sfGLId field.
const UInt32getGLId (void) const
 Get the value of the ProgramChunk::_sfGLId field.
Field Set
*void setGLId (const UInt32 &value)
 Set the value of the ProgramChunk::_sfGLId field.
Sync
*void executeSyncImpl (ProgramChunkBase *pOther, const BitVector &whichField)
Init
*void onCreate (const ProgramChunk *source=NULL)
Program-Specific Methods
*virtual UInt32 getExtension (void) const
virtual GLenum getTarget (void) const
virtual const char * getTargetName (void) const
void printCompileError (Window *win, UInt32 idstatus)
GL
*void handleGL (Window *win, UInt32 id, GLenum target, UInt32 extension)
Field Get
*SFUInt32getSFGLId (void)
 Get the ProgramChunk::_sfGLId field.
UInt32getGLId (void)
 Get the value of the ProgramChunk::_sfGLId field.
const UInt32getGLId (void) const
 Get the value of the ProgramChunk::_sfGLId field.
Field Set
*void setGLId (const UInt32 &value)
 Set the value of the ProgramChunk::_sfGLId field.
Sync
*void executeSyncImpl (ProgramChunkBase *pOther, const BitVector &whichField)

Protected Attributes

Fields
*SFString _sfProgram
MFVec4f _mfParamValues
MFString _mfParamNames
SFUInt32 _sfGLId
Fields
*SFString _sfProgram
MFVec4f _mfParamValues
MFString _mfParamNames
SFUInt32 _sfGLId
Fields
*SFString _sfProgram
MFVec4f _mfParamValues
MFString _mfParamNames
SFUInt32 _sfGLId

Private Types

typedef ProgramChunk Inherited

Private Member Functions

void operator= (const FragmentProgramChunkBase &source)

Static Private Attributes

static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 80 of file OSGFragmentProgramChunkBase.h.


Member Typedef Documentation

typedef ProgramChunk osg::FragmentProgramChunkBase::Inherited [private]
 

Reimplemented from osg::ProgramChunk.

Reimplemented in osg::FragmentProgramChunk.

Definition at line 84 of file OSGFragmentProgramChunkBase.h.

typedef FragmentProgramChunkPtr osg::FragmentProgramChunkBase::Ptr
 

Reimplemented from osg::ProgramChunkBase.

Definition at line 89 of file OSGFragmentProgramChunkBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
ProgramFieldId 
ParamValuesFieldId 
ParamNamesFieldId 
GLIdFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 95 of file OSGProgramChunkBase.h.

00096     {
00097         ProgramFieldId     = Inherited::NextFieldId,
00098         ParamValuesFieldId = ProgramFieldId     + 1,
00099         ParamNamesFieldId  = ParamValuesFieldId + 1,
00100         GLIdFieldId        = ParamNamesFieldId  + 1,
00101         NextFieldId        = GLIdFieldId        + 1
00102     };


Constructor & Destructor Documentation

FragmentProgramChunkBase::FragmentProgramChunkBase void   )  [protected]
 

Definition at line 144 of file OSGFragmentProgramChunkBase.cpp.

00144                                                        :
00145     Inherited() 
00146 {
00147 }

FragmentProgramChunkBase::FragmentProgramChunkBase const FragmentProgramChunkBase source  )  [protected]
 

Definition at line 153 of file OSGFragmentProgramChunkBase.cpp.

00153                                                                                          :
00154     Inherited                 (source)
00155 {
00156 }

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

Definition at line 160 of file OSGFragmentProgramChunkBase.cpp.

00161 {
00162 }


Member Function Documentation

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 58 of file OSGFragmentProgramChunkBase.inl.

References _type.

Referenced by create(), and osg::RemoteAspect::RemoteAspect().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 65 of file OSGFragmentProgramChunkBase.inl.

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

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

FieldContainerType & FragmentProgramChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::ProgramChunkBase.

Definition at line 86 of file OSGFragmentProgramChunkBase.cpp.

References _type.

00087 {
00088     return _type; 
00089 } 

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 91 of file OSGFragmentProgramChunkBase.cpp.

References _type.

00092 {
00093     return _type;
00094 } 

UInt32 FragmentProgramChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::ProgramChunkBase.

Definition at line 106 of file OSGFragmentProgramChunkBase.cpp.

00107 { 
00108     return sizeof(FragmentProgramChunk); 
00109 }

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 166 of file OSGFragmentProgramChunkBase.cpp.

References osg::ProgramChunkBase::getBinSize().

00167 {
00168     UInt32 returnValue = Inherited::getBinSize(whichField);
00169 
00170 
00171     return returnValue;
00172 }

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 174 of file OSGFragmentProgramChunkBase.cpp.

References osg::ProgramChunkBase::copyToBin().

00176 {
00177     Inherited::copyToBin(pMem, whichField);
00178 
00179 
00180 }

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 182 of file OSGFragmentProgramChunkBase.cpp.

References osg::ProgramChunkBase::copyFromBin().

00184 {
00185     Inherited::copyFromBin(pMem, whichField);
00186 
00187 
00188 }

FragmentProgramChunkPtr osg::FragmentProgramChunkBase::create void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 72 of file OSGFragmentProgramChunkBase.inl.

References osg::AttachmentPtr::dcast(), getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and shallowCopy().

Referenced by osg::DVRSimpleLUTShader::activate(), osg::DVRIsoShader::activate_FragmentProgramShading(), osg::PhongMaterial::createChunkMaterial(), osg::DisplayCalibration::createCMViewports(), and osg::PhongMaterial::prepareLocalChunks().

00073 {
00074     FragmentProgramChunkPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = FragmentProgramChunkPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

FragmentProgramChunkPtr osg::FragmentProgramChunkBase::createEmpty void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 87 of file OSGFragmentProgramChunkBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     FragmentProgramChunkPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr FragmentProgramChunkBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::Attachment.

Definition at line 97 of file OSGFragmentProgramChunkBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00098 { 
00099     FragmentProgramChunkPtr returnValue; 
00100 
00101     newPtr(returnValue, dynamic_cast<const FragmentProgramChunk *>(this)); 
00102 
00103     return returnValue; 
00104 }

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

Definition at line 191 of file OSGFragmentProgramChunkBase.cpp.

References osg::ProgramChunkBase::executeSyncImpl().

Referenced by executeSync().

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

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

Reimplemented from osg::ProgramChunkBase.

Definition at line 113 of file OSGFragmentProgramChunkBase.cpp.

References executeSyncImpl().

00115 {
00116     this->executeSyncImpl((FragmentProgramChunkBase *) &other, whichField);
00117 }

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

const StateChunkClass * ProgramChunk::getClass void   )  const [virtual, inherited]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::FragmentProgramChunk, and osg::VertexProgramChunk.

Definition at line 149 of file OSGProgramChunk.cpp.

References osg::ProgramChunk::_class.

00150 {
00151     return &_class;
00152 }

UInt32 osg::ProgramChunk::getStaticClassId void   )  [inline, static, inherited]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::FragmentProgramChunk, and osg::VertexProgramChunk.

Definition at line 46 of file OSGProgramChunk.inl.

References osg::StateChunkClass::getId(), and osg::ProgramChunk::getStaticClass().

00047 {
00048     return getStaticClass()->getId();
00049 }

const StateChunkClass * osg::ProgramChunk::getStaticClass void   )  [inline, static, inherited]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::FragmentProgramChunk, and osg::VertexProgramChunk.

Definition at line 52 of file OSGProgramChunk.inl.

References osg::ProgramChunk::_class.

Referenced by osg::ProgramChunk::getStaticClassId().

00053 {
00054     return &ProgramChunk::_class;
00055 }

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

Reimplemented from osg::StateChunk.

Reimplemented in osg::FatBorderChunk, osg::FragmentProgramChunk, and osg::VertexProgramChunk.

Definition at line 156 of file OSGProgramChunk.cpp.

References