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

osg::VertexProgramChunk Class Reference
[OpenGL State Handling]

VertexProgramChunk class. See VertexProgramChunk for a description. More...

#include <OSGVertexProgramChunk.h>

Inheritance diagram for osg::VertexProgramChunk:

osg::VertexProgramChunkBase osg::ProgramChunk osg::ProgramChunkBase osg::StateChunk osg::StateChunkBase osg::Attachment osg::FieldContainer osg::FatBorderChunkBase osg::FatBorderChunk List of all members.

Sync

*void executeSyncImpl (VertexProgramChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)

Public Types

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

Public Member Functions

Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
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

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 VertexProgramChunkPtr create (void)
 create a new instance of the class
static VertexProgramChunkPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

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

Constructors
VertexProgramChunk (void)
 VertexProgramChunk (const VertexProgramChunk &source)
Destructors
*virtual ~VertexProgramChunk (void)

Private Types

typedef VertexProgramChunkBase Inherited

Private Member Functions

void operator= (const VertexProgramChunk &source)
GL
*void handleGL (Window *win, UInt32 id)

Static Private Member Functions

static void initMethod (void)

Static Private Attributes

static StateChunkClass _class
OpenGL Extension Handling
*static UInt32 _arbVertexProgram

Friends

class FieldContainer
class VertexProgramChunkBase

Detailed Description

See VertexProgramChunk for a description. The VertexProgramChunk implements Vertex Programs as specified in the GL_ARB_vertex_program extension. It is just a special version of the osg::ProgramChunk, which contains the whole public interface.

Definition at line 55 of file OSGVertexProgramChunk.h.


Member Typedef Documentation

typedef VertexProgramChunkBase osg::VertexProgramChunk::Inherited [private]
 

Reimplemented from osg::VertexProgramChunkBase.

Reimplemented in osg::FatBorderChunk, and osg::FatBorderChunkBase.

Definition at line 59 of file OSGVertexProgramChunk.h.

typedef VertexProgramChunkPtr osg::VertexProgramChunkBase::Ptr [inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 89 of file OSGVertexProgramChunkBase.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

VertexProgramChunk::VertexProgramChunk void   )  [protected]
 

Definition at line 94 of file OSGVertexProgramChunk.cpp.

References _arbVertexProgram, and osg::Window::registerExtension().

00094                                            :
00095     Inherited()
00096 {
00097     _arbVertexProgram = Window::registerExtension("GL_ARB_vertex_program");
00098 }

VertexProgramChunk::VertexProgramChunk const VertexProgramChunk source  )  [protected]
 

Definition at line 100 of file OSGVertexProgramChunk.cpp.

00100                                                                        :
00101     Inherited(source)
00102 {
00103 }

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

Definition at line 105 of file OSGVertexProgramChunk.cpp.

00106 {
00107 }


Member Function Documentation

const StateChunkClass * VertexProgramChunk::getClass void   )  const [virtual]
 

Reimplemented from osg::ProgramChunk.

Definition at line 138 of file OSGVertexProgramChunk.cpp.

References _class.

00139 {
00140     return &_class;
00141 }

UInt32 osg::VertexProgramChunk::getStaticClassId void   )  [inline, static]
 

Reimplemented from osg::ProgramChunk.

Definition at line 46 of file OSGVertexProgramChunk.inl.

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

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

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

Reimplemented from osg::ProgramChunk.

Definition at line 52 of file OSGVertexProgramChunk.inl.

References _class.

Referenced by getStaticClassId().

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

void VertexProgramChunk::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::ProgramChunk.

Reimplemented in osg::FatBorderChunk.

Definition at line 145 of file OSGVertexProgramChunk.cpp.

References osg::ProgramChunk::changed().

Referenced by osg::FatBorderChunk::changed().

00146 {
00147     Inherited::changed(whichField, origin);
00148 }

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

Reimplemented from osg::ProgramChunk.

Reimplemented in osg::FatBorderChunk.

Definition at line 150 of file OSGVertexProgramChunk.cpp.

References SLOG.

00152 {
00153     SLOG << "Dump VertexProgramChunk NI" << std::endl;
00154 }

void VertexProgramChunk::onCreate const VertexProgramChunk source = NULL  )  [protected]
 

Definition at line 111 of file OSGVertexProgramChunk.cpp.

References osg::beginEditCP(), osg::endEditCP(), osg::ProgramChunkBase::GLIdFieldMask, osg::GlobalSystemState, handleGL(), osg::osgTypedMethodVoidFunctor2ObjCPtrPtr(), osg::Window::registerGLObject(), osg::ProgramChunkBase::setGLId(), and osg::Startup.

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

00112 {
00113     if(GlobalSystemState == Startup)
00114         return;
00115 
00116     // !!! this temporary is needed to work around compiler problems (sgi)
00117     // CHECK CHECK
00118     //  VertexProgramChunkPtr tmpPtr = FieldContainer::getPtr<ProgramChunkPtr>(*this);
00119     VertexProgramChunkPtr tmpPtr(*this);
00120 
00121     beginEditCP(tmpPtr, VertexProgramChunk::GLIdFieldMask);
00122 
00123     setGLId(
00124         Window::registerGLObject(
00125             osgTypedMethodVoidFunctor2ObjCPtrPtr<VertexProgramChunkPtr, 
00126                                                  Window , 
00127                                                  UInt32>(
00128                                                      tmpPtr, 
00129                                                      &VertexProgramChunk::handleGL),
00130             1));
00131 
00132     endEditCP(tmpPtr, VertexProgramChunk::GLIdFieldMask);
00133 }

UInt32 VertexProgramChunk::getExtension void   )  const [protected, virtual]
 

Virtual helper function to let the derived chunks return the extension that they implement. Only if this extension is supproted on the current Window is the porgram called.

Reimplemented from osg::ProgramChunk.

Definition at line 166 of file OSGVertexProgramChunk.cpp.

References _arbVertexProgram.

00167 {
00168     return _arbVertexProgram;
00169 }

GLenum VertexProgramChunk::getTarget void   )  const [protected, virtual]
 

Virtual helper function to let the derived chunks return the target constant that they implement.

Reimplemented from osg::ProgramChunk.

Definition at line 171 of file OSGVertexProgramChunk.cpp.

References GL_VERTEX_PROGRAM_ARB.

00172 {
00173     return GL_VERTEX_PROGRAM_ARB;
00174 }

const char * VertexProgramChunk::getTargetName void   )  const [protected, virtual]
 

Virtual helper function to let the derived chunks return the name of the target constant that they implement, for debugging purposes.

Reimplemented from osg::ProgramChunk.

Definition at line 176 of file OSGVertexProgramChunk.cpp.

00177 {
00178     return "Vertex Program";
00179 }

void VertexProgramChunk::initMethod void   )  [static, private]
 

Reimplemented from osg::ProgramChunk.

Reimplemented in osg::FatBorderChunk.

Definition at line 79 of file OSGVertexProgramChunk.cpp.

00080 {
00081 }

void VertexProgramChunk::handleGL Window win,
UInt32  idstatus
[private]
 

GL object handler create the program and destroy it

Definition at line 161 of file OSGVertexProgramChunk.cpp.

References _arbVertexProgram, GL_VERTEX_PROGRAM_ARB, and osg::ProgramChunk::handleGL().

Referenced by onCreate().

00162 {
00163     Inherited::handleGL(win, idstatus, GL_VERTEX_PROGRAM_ARB, _arbVertexProgram);
00164 }

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

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

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 58 of file OSGVertexProgramChunkBase.inl.

References osg::VertexProgramChunkBase::_type.

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

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::VertexProgramChunkBase::getClassTypeId void   )  [inline, static, inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 65 of file OSGVertexProgramChunkBase.inl.

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

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

FieldContainerType & VertexProgramChunkBase::getType void   )  [virtual, inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 86 of file OSGVertexProgramChunkBase.cpp.

References osg::VertexProgramChunkBase::_type.

00087 {
00088     return _type; 
00089 } 

const FieldContainerType & VertexProgramChunkBase::getType void   )  const [virtual, inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 91 of file OSGVertexProgramChunkBase.cpp.

References osg::VertexProgramChunkBase::_type.

00092 {
00093     return _type;
00094 } 

UInt32 VertexProgramChunkBase::getContainerSize void   )  const [virtual, inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 106 of file OSGVertexProgramChunkBase.cpp.

00107 { 
00108     return sizeof(VertexProgramChunk); 
00109 }

UInt32 VertexProgramChunkBase::getBinSize const BitVector whichField  )  [virtual, inherited]
 

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 166 of file OSGVertexProgramChunkBase.cpp.

References osg::ProgramChunkBase::getBinSize().

Referenced by osg::FatBorderChunkBase::getBinSize().

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

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

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 174 of file OSGVertexProgramChunkBase.cpp.

References osg::ProgramChunkBase::copyToBin().

Referenced by osg::FatBorderChunkBase::copyToBin().

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

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

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 182 of file OSGVertexProgramChunkBase.cpp.

References osg::ProgramChunkBase::copyFromBin().

Referenced by osg::FatBorderChunkBase::copyFromBin().

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

VertexProgramChunkPtr osg::VertexProgramChunkBase::create void   )  [inline, static, inherited]
 

Reimplemented from osg::Attachment.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 72 of file OSGVertexProgramChunkBase.inl.

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

Referenced by osg::PhongMaterial::createChunkMaterial(), and osg::PhongMaterial::prepareLocalChunks().

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

VertexProgramChunkPtr osg::VertexProgramChunkBase::createEmpty void   )  [inline, static, inherited]
 

Reimplemented from osg::Attachment.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 87 of file OSGVertexProgramChunkBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr VertexProgramChunkBase::shallowCopy void   )  const [virtual, inherited]
 

Reimplemented from osg::Attachment.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 97 of file OSGVertexProgramChunkBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::VertexProgramChunkBase::create().

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

void VertexProgramChunkBase::executeSyncImpl VertexProgramChunkBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 191 of file OSGVertexProgramChunkBase.cpp.

References osg::ProgramChunkBase::executeSyncImpl().

Referenced by osg::VertexProgramChunkBase::executeSync(), and osg::FatBorderChunkBase::executeSyncImpl().

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

void ProgramChunkBase::executeSyncImpl ProgramChunkBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 305 of file OSGProgramChunkBase.cpp.

References osg::ProgramChunkBase::_mfParamNames, osg::ProgramChunkBase::_mfParamValues, osg::ProgramChunkBase::_sfGLId, osg::ProgramChunkBase::_sfProgram, osg::StateChunkBase::executeSyncImpl(), osg::ProgramChunkBase::GLIdFieldMask, osg::FieldBits::NoField, osg::ProgramChunkBase::ParamNamesFieldMask, osg::ProgramChunkBase::ParamValuesFieldMask, osg::ProgramChunkBase::ProgramFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::ProgramChunkBase::executeSync(), osg::VertexProgramChunkBase::executeSyncImpl(), and osg::FragmentProgramChunkBase::executeSyncImpl().

00307 {
00308 
00309     Inherited::executeSyncImpl(pOther, whichField);
00310 
00311     if(FieldBits::NoField != (ProgramFieldMask & whichField))
00312         _sfProgram.syncWith(pOther->_sfProgram);
00313 
00314     if(FieldBits::NoField != (ParamValuesFieldMask & whichField))
00315         _mfParamValues.syncWith(pOther->_mfParamValues);
00316 
00317     if(FieldBits::NoField != (ParamNamesFieldMask & whichField))
00318         _mfParamNames.syncWith(pOther->_mfParamNames);
00319 
00320     if(FieldBits::NoField != (GLIdFieldMask & whichField))
00321         _sfGLId.syncWith(pOther->_sfGLId);
00322 
00323 
00324 }

void StateChunkBase::executeSyncImpl StateChunkBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 182 of file OSGStateChunkBase.cpp.

References osg::Attachment::executeSyncImpl().

Referenced by osg::StateChunkBase::executeSync(), osg::TwoSidedLightingChunkBase::executeSyncImpl(), osg::TransformChunkBase::executeSyncImpl(), osg::TextureChunkBase::executeSyncImpl(), osg::TexGenChunkBase::executeSyncImpl(), osg::StencilChunkBase::executeSyncImpl(), osg::ShaderParameterChunkBase::executeSyncImpl(), osg::RegisterCombinersChunkBase::executeSyncImpl(), osg::ProgramChunkBase::executeSyncImpl(), osg::PolygonChunkBase::executeSyncImpl(), osg::PointChunkBase::executeSyncImpl(), osg::MaterialChunkBase::executeSyncImpl(), osg::LineChunkBase::executeSyncImpl(), osg::LightChunkBase::executeSyncImpl(), osg::DepthChunkBase::executeSyncImpl(), osg::ColorMaskChunkBase::executeSyncImpl(), osg::ClipPlaneChunkBase::executeSyncImpl(), and osg::BlendChunkBase::executeSyncImpl().

00184 {
00185 
00186     Inherited::executeSyncImpl(pOther, whichField);
00187 
00188 
00189 }

void Attachment::executeSyncImpl Attachment pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 306 of file OSGAttachment.cpp.

References osg::Attachment::_parents, osg::Attachment::_sfInternal, osg::FieldContainer::executeSyncImpl(), osg::Attachment::InternalFieldMask, osg::FieldBits::NoField, osg::Attachment::ParentsFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::Attachment::executeSync(), osg::StateChunkBase::executeSyncImpl(), osg::DVRVolumeTextureBase::executeSyncImpl(), osg::DVRLookupTableBase::executeSyncImpl(), osg::DVRIsoSurfaceBase::executeSyncImpl(), osg::DVRClipObjectsBase::executeSyncImpl(), and osg::SimpleAttachment< AttachmentDescT >::executeSyncImpl().

00308 {
00309     Inherited::executeSyncImpl(pOther, whichField);
00310 
00311     if(FieldBits::NoField != (InternalFieldMask & whichField))
00312     {
00313         _sfInternal.syncWith(pOther->_sfInternal);
00314     }
00315 
00316     if(FieldBits::NoField != (ParentsFieldMask & whichField))
00317     {
00318         _parents.syncWith(pOther->_parents);
00319     }
00320 }

void osg::FieldContainer::executeSyncImpl FieldContainer pOther,
const BitVector whichField
[inline, protected, inherited]
 

Definition at line 333 of file OSGFieldContainerImpl.inl.

Referenced by osg::StateBase::executeSyncImpl(), osg::DVRShaderBase::executeSyncImpl(), osg::DVRClipGeometryBase::executeSyncImpl(), osg::AttachmentContainer::executeSyncImpl(), and osg::Attachment::executeSyncImpl().

00335 {
00336 }

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

Reimplemented from osg::ProgramChunkBase.

Reimplemented in osg::FatBorderChunkBase.

Definition at line 113 of file OSGVertexProgramChunkBase.cpp.

References osg::VertexProgramChunkBase::executeSyncImpl().

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

bool ProgramChunk::read const char *  file  )  [inherited]
 

Read the program string from the given file

Definition at line 183 of file OSGProgramChunk.cpp.

References FWARNING.

00184 {
00185     std::ifstream s(file);
00186     
00187     if(s.good())
00188     {
00189         return read(s);
00190     }
00191     else
00192     {
00193         FWARNING(("ProgramChunk::read: couldn't open '%s' for reading!\n",
00194                     file));
00195         return false;
00196     }
00197 }

bool ProgramChunk::read std::istream &  stream  )  [inherited]
 

Read the program string from the given stream

Definition at line 201 of file OSGProgramChunk.cpp.

References BUFSIZE, FWARNING, and osg::ProgramChunkBase::getProgram().

00202 {
00203 #define BUFSIZE 200
00204     
00205     getProgram().erase();    
00206     char buf[BUFSIZE];
00207 
00208     if(!stream.good())
00209     {
00210         FWARNING(("ProgramChunk::read: stream is not good!\n"));
00211         return false;
00212    
00213     }
00214     
00215     do
00216     {
00217         stream.read(buf, BUFSIZE);
00218         getProgram().append(buf, stream.gcount());
00219     }
00220     while(!stream.eof());
00221     
00222     return true;
00223 }

bool ProgramChunk::addParameter const char *  name,
Int16  index
[inherited]
 

Add a named parameter

Definition at line 227 of file OSGProgramChunk.cpp.

References osg::ProgramChunkBase::getParamNames(), osg::MField< FieldTypeT, fieldNameSpace >::resize(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

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

00229 {
00230     if(index < 0)
00231         return true;
00232         
00233     if(getParamNames().size() <= UInt16(index))
00234     {
00235         getParamNames().resize(index + 1);
00236     }
00237     getParamNames()[index] = name;
00238     return false;
00239 }

bool osg::ProgramChunk::addParameter const char *  name,
Int16  index,
const Vec4f value
[inline, inherited]
 

Concvenience function to add a new parameter and directly set its value.

Definition at line 63 of file OSGProgramChunk.inl.

References osg::ProgramChunk::addParameter(), and osg::ProgramChunk::setParameter().

00066 {
00067     addParameter(name, index);
00068     return setParameter(index, value);
00069 }

const Vec4f & ProgramChunk::getParameter Int16  index  )  [inherited]
 

Read the program string from the given file

Definition at line 241 of file OSGProgramChunk.cpp.

References osg::ProgramChunkBase::getParamValues(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

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

00242 {
00243     static const Vec4f bad(-1e10,-1e10,-1e10);
00244     
00245     if(index < 0)
00246         return bad;
00247         
00248     if(getParamValues().size() <= UInt16(index))
00249     {
00250         return getParamValues()[index];
00251     }
00252     
00253     return bad;
00254 }

const Vec4f & osg::ProgramChunk::getParameter const char *  name  )  [inline, inherited]
 

Read the program string from the given file

Definition at line 72 of file OSGProgramChunk.inl.

References osg::ProgramChunk::findParameter(), and osg::ProgramChunk::getParameter().

00073 {
00074     return getParameter(findParameter(name));
00075 }

const Vec4f & osg::ProgramChunk::getParameter const std::string &  name  )  [inline, inherited]
 

Read the program string from the given file

Definition at line 78 of file OSGProgramChunk.inl.

References osg::ProgramChunk::findParameter(), and osg::ProgramChunk::getParameter().

00079 {
00080     return getParameter(findParameter(name.c_str()));
00081 }

bool ProgramChunk::setParameter Int16  index,
const Vec4f value
[inherited]
 

Set parameter value, create it if not set yet.

Definition at line 258 of file OSGProgramChunk.cpp.

References osg::ProgramChunkBase::getParamValues(), osg::MField< FieldTypeT, fieldNameSpace >::resize(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by osg::ProgramChunk::addParameter(), and osg::ProgramChunk::setParameter().

00259 {
00260     if(index < 0)
00261         return true;
00262         
00263     if(getParamValues().size() <= UInt16(index))
00264     {
00265         getParamValues().resize(index + 1);
00266     }
00267     getParamValues()[index] = value;
00268     return false;
00269 }

bool osg::ProgramChunk::setParameter const char *  name,
const Vec4f value
[inline, inherited]
 

Read the program string from the given file

Definition at line 84 of file OSGProgramChunk.inl.

References osg::ProgramChunk::findParameter(), and osg::ProgramChunk::setParameter().

00085 {
00086     return setParameter(findParameter(name), value);
00087 }

bool osg::ProgramChunk::setParameter const std::string &  name,
const Vec4f value
[inline, inherited]
 

Read the program string from the given file

Definition at line 90 of file OSGProgramChunk.inl.

References osg::ProgramChunk::findParameter(), and osg::ProgramChunk::setParameter().

00091 {
00092     return setParameter(findParameter(name.c_str()), value);
00093 }

Int16 osg::ProgramChunk::findParameter const char *  name  )  [inline, inherited]
 

Read the program string from the given file

Definition at line 96 of file OSGProgramChunk.inl.

Referenced by osg::ProgramChunk::getParameter(), and osg::ProgramChunk::setParameter().

00097 {
00098     return findParameter(std::st