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

osg::PhongMaterial Class Reference

PhongMaterial class. See PageKernelPhongMaterial for a description.

#include <OSGPhongMaterial.h>

Inheritance diagram for osg::PhongMaterial:

osg::PhongMaterialBase osg::ChunkMaterial osg::ChunkMaterialBase osg::Material osg::MaterialBase osg::AttachmentContainer osg::FieldContainer List of all members.

Output

*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
virtual StatePtr makeState (void)
virtual void rebuildState (void)
virtual bool isTransparent (void) const
static ChunkMaterialPtr createChunkMaterial (void)

Rendering

StatePtr getState (void)
*typedef TypedFunctor1Base<
Action::ResultE, PtrCallArg<
DrawActionBase > > 
DrawFunctor

Public Types

typedef PhongMaterialPtr Ptr
enum  {
  AmbientFieldId = Inherited::NextFieldId, DiffuseFieldId = AmbientFieldId + 1, SpecularFieldId = DiffuseFieldId + 1, ShininessFieldId = SpecularFieldId + 1,
  EmissionFieldId = ShininessFieldId + 1, TransparencyFieldId = EmissionFieldId + 1, LitFieldId = TransparencyFieldId + 1, ColorMaterialFieldId = LitFieldId + 1,
  NextFieldId = ColorMaterialFieldId + 1
}

Public Member Functions

Sync
*virtual void changed (BitVector whichField, UInt32 origin)
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFColor3fgetSFAmbient (void)
 Get the PhongMaterial::_sfAmbient field.
SFColor3fgetSFDiffuse (void)
 Get the PhongMaterial::_sfDiffuse field.
SFColor3fgetSFSpecular (void)
 Get the PhongMaterial::_sfSpecular field.
SFReal32getSFShininess (void)
 Get the PhongMaterial::_sfShininess field.
SFColor3fgetSFEmission (void)
 Get the PhongMaterial::_sfEmission field.
SFReal32getSFTransparency (void)
 Get the PhongMaterial::_sfTransparency field.
SFBoolgetSFLit (void)
 Get the PhongMaterial::_sfLit field.
SFGLenumgetSFColorMaterial (void)
 Get the PhongMaterial::_sfColorMaterial field.
Color3fgetAmbient (void)
 Get the value of the PhongMaterial::_sfAmbient field.
const Color3fgetAmbient (void) const
 Get the value of the PhongMaterial::_sfAmbient field.
Color3fgetDiffuse (void)
 Get the value of the PhongMaterial::_sfDiffuse field.
const Color3fgetDiffuse (void) const
 Get the value of the PhongMaterial::_sfDiffuse field.
Color3fgetSpecular (void)
 Get the value of the PhongMaterial::_sfSpecular field.
const Color3fgetSpecular (void) const
 Get the value of the PhongMaterial::_sfSpecular field.
Real32getShininess (void)
 Get the value of the PhongMaterial::_sfShininess field.
const Real32getShininess (void) const
 Get the value of the PhongMaterial::_sfShininess field.
Color3fgetEmission (void)
 Get the value of the PhongMaterial::_sfEmission field.
const Color3fgetEmission (void) const
 Get the value of the PhongMaterial::_sfEmission field.
Real32getTransparency (void)
 Get the value of the PhongMaterial::_sfTransparency field.
const Real32getTransparency (void) const
 Get the value of the PhongMaterial::_sfTransparency field.
bool & getLit (void)
 Get the value of the PhongMaterial::_sfLit field.
const bool & getLit (void) const
 Get the value of the PhongMaterial::_sfLit field.
GLenumgetColorMaterial (void)
 Get the value of the PhongMaterial::_sfColorMaterial field.
const GLenumgetColorMaterial (void) const
 Get the value of the PhongMaterial::_sfColorMaterial field.
Field Set
*void setAmbient (const Color3f &value)
 Set the value of the PhongMaterial::_sfAmbient field.
void setDiffuse (const Color3f &value)
 Set the value of the PhongMaterial::_sfDiffuse field.
void setSpecular (const Color3f &value)
 Set the value of the PhongMaterial::_sfSpecular field.
void setShininess (const Real32 &value)
 Set the value of the PhongMaterial::_sfShininess field.
void setEmission (const Color3f &value)
 Set the value of the PhongMaterial::_sfEmission field.
void setTransparency (const Real32 &value)
 Set the value of the PhongMaterial::_sfTransparency field.
void setLit (const bool &value)
 Set the value of the PhongMaterial::_sfLit field.
void setColorMaterial (const GLenum &value)
 Set the value of the PhongMaterial::_sfColorMaterial 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
Rendering
*virtual void draw (DrawFunctor &func, DrawActionBase *action)
virtual void draw (Geometry *geo, DrawActionBase *action)
Access
*bool addChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
bool subChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
Int32 find (StateChunkPtr chunk)
StateChunkPtr find (const FieldContainerType &type, Int32 slot=State::AutoSlotReplace)
virtual bool operator== (const Material &other)
Comparison
virtual bool operator== (const Material &other) const
*virtual bool operator< (const Material &other) const
virtual bool operator!= (const Material &other) const
Field Get
*MFStateChunkPtrgetMFChunks (void)
 Get the ChunkMaterial::_mfChunks field.
MFInt32getMFSlots (void)
 Get the ChunkMaterial::_mfSlots field.
StateChunkPtrgetChunks (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfChunks field.
MFStateChunkPtrgetChunks (void)
 Get the ChunkMaterial::_mfChunks field.
const MFStateChunkPtrgetChunks (void) const
 Get the ChunkMaterial::_mfChunks field.
Int32getSlots (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfSlots field.
MFInt32getSlots (void)
 Get the ChunkMaterial::_mfSlots field.
const MFInt32getSlots (void) const
 Get the ChunkMaterial::_mfSlots field.
Field Get
*SFInt32getSFSortKey (void)
 Get the Material::_sfSortKey field.
Int32getSortKey (void)
 Get the value of the Material::_sfSortKey field.
const Int32getSortKey (void) const
 Get the value of the Material::_sfSortKey field.
Field Set
*void setSortKey (const Int32 &value)
 Set the value of the Material::_sfSortKey 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 PhongMaterialPtr create (void)
 create a new instance of the class
static PhongMaterialPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get
*static const char * getClassname (void)

Static Public Attributes

static const osg::BitVector AmbientFieldMask
static const osg::BitVector DiffuseFieldMask
static const osg::BitVector SpecularFieldMask
static const osg::BitVector ShininessFieldMask
static const osg::BitVector EmissionFieldMask
static const osg::BitVector TransparencyFieldMask
static const osg::BitVector LitFieldMask
static const osg::BitVector ColorMaterialFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector ChunksFieldMask
static const osg::BitVector SlotsFieldMask
static const osg::BitVector SortKeyFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
Constants
*static const Int32 NoStateSorting = 0x7fffffff

Protected Member Functions

Constructors
PhongMaterial (void)
 PhongMaterial (const PhongMaterial &source)
Destructors
*virtual ~PhongMaterial (void)
Sync
*void executeSyncImpl (PhongMaterialBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (ChunkMaterialBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (MaterialBase *pOther, const BitVector &whichField)

Protected Attributes

StatePtr _pState
Fields
*SFColor3f _sfAmbient
SFColor3f _sfDiffuse
SFColor3f _sfSpecular
SFReal32 _sfShininess
SFColor3f _sfEmission
SFReal32 _sfTransparency
SFBool _sfLit
SFGLenum _sfColorMaterial
Fields
*MFStateChunkPtr _mfChunks
MFInt32 _mfSlots
Fields
*SFInt32 _sfSortKey

Private Types

typedef PhongMaterialBase Inherited

Private Member Functions

void prepareLocalChunks (void)
void createFragmentProgram (void)
void operator= (const PhongMaterial &source)

Static Private Member Functions

static void initMethod (void)

Private Attributes

MaterialChunkPtr _materialChunk
BlendChunkPtr _blendChunk
VertexProgramChunkPtr _vpChunk
FragmentProgramChunkPtr _fpChunk

Static Private Attributes

static UInt32 _arbFragmentProgram

Friends

class FieldContainer
class PhongMaterialBase

Detailed Description

Definition at line 59 of file OSGPhongMaterial.h.


Member Typedef Documentation

typedef PhongMaterialBase osg::PhongMaterial::Inherited [private]
 

Reimplemented from osg::PhongMaterialBase.

Definition at line 63 of file OSGPhongMaterial.h.

typedef PhongMaterialPtr osg::PhongMaterialBase::Ptr [inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 97 of file OSGPhongMaterialBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
AmbientFieldId 
DiffuseFieldId 
SpecularFieldId 
ShininessFieldId 
EmissionFieldId 
TransparencyFieldId 
LitFieldId 
ColorMaterialFieldId 
NextFieldId 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 99 of file OSGPhongMaterialBase.h.

00100     {
00101         AmbientFieldId       = Inherited::NextFieldId,
00102         DiffuseFieldId       = AmbientFieldId       + 1,
00103         SpecularFieldId      = DiffuseFieldId       + 1,
00104         ShininessFieldId     = SpecularFieldId      + 1,
00105         EmissionFieldId      = ShininessFieldId     + 1,
00106         TransparencyFieldId  = EmissionFieldId      + 1,
00107         LitFieldId           = TransparencyFieldId  + 1,
00108         ColorMaterialFieldId = LitFieldId           + 1,
00109         NextFieldId          = ColorMaterialFieldId + 1
00110     };


Constructor & Destructor Documentation

PhongMaterial::PhongMaterial void   )  [protected]
 

Definition at line 189 of file OSGPhongMaterial.cpp.

00189                                  :
00190     Inherited(),
00191     _materialChunk(NullFC),
00192     _blendChunk(NullFC),
00193     _vpChunk(NullFC),
00194     _fpChunk(NullFC)
00195 {
00196 }

PhongMaterial::PhongMaterial const PhongMaterial source  )  [protected]
 

Definition at line 198 of file OSGPhongMaterial.cpp.

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

00198                                                         :
00199     Inherited(source),
00200     _materialChunk(source._materialChunk),
00201     _blendChunk(source._blendChunk),
00202     _vpChunk(source._vpChunk),
00203     _fpChunk(source._fpChunk)
00204 {
00205     _arbFragmentProgram = Window::registerExtension("GL_ARB_fragment_program");
00206 }

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

Definition at line 208 of file OSGPhongMaterial.cpp.

References _blendChunk, _fpChunk, _materialChunk, _vpChunk, and osg::subRefCP().

00209 {
00210     subRefCP(_materialChunk);
00211     subRefCP(_blendChunk);
00212     subRefCP(_vpChunk);
00213     subRefCP(_fpChunk);
00214 }


Member Function Documentation

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

Reimplemented from osg::ChunkMaterial.

Definition at line 276 of file OSGPhongMaterial.cpp.

References osg::ChunkMaterial::changed().

00277 {
00278     Inherited::changed(whichField, origin);
00279 }

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

Reimplemented from osg::ChunkMaterial.

Definition at line 281 of file OSGPhongMaterial.cpp.

References SLOG.

00283 {
00284     SLOG << "Dump PhongMaterial NI" << std::endl;
00285 }

StatePtr PhongMaterial::makeState void   )  [virtual]
 

Create a osg::State that represents this Material and return it.

Reimplemented from osg::ChunkMaterial.

Definition at line 287 of file OSGPhongMaterial.cpp.

References _blendChunk, _fpChunk, _materialChunk, osg::ChunkMaterialBase::_mfChunks, _vpChunk, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::StateBase::create(), createFragmentProgram(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::PhongMaterialBase::getAmbient(), osg::PhongMaterialBase::getColorMaterial(), osg::PhongMaterialBase::getDiffuse(), osg::PhongMaterialBase::getEmission(), osg::PhongMaterialBase::getLit(), osg::PhongMaterialBase::getShininess(), osg::PhongMaterialBase::getSpecular(), osg::PhongMaterialBase::getTransparency(), isTransparent(), osg::NullFC, prepareLocalChunks(), and osg::Color4< ValueTypeT >::setValuesRGBA().

00288 {
00289     StatePtr state = State::create();
00290     
00291     prepareLocalChunks();
00292     
00293     Color3f v3;
00294     Color4f v4;
00295     float alpha = 1.f - getTransparency();
00296 
00297     prepareLocalChunks();
00298 
00299     beginEditCP(_materialChunk);
00300          v3 = getAmbient(); 
00301          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00302         _materialChunk->setAmbient(v4);
00303 
00304          v3 = getDiffuse(); 
00305          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00306         _materialChunk->setDiffuse(v4);
00307 
00308          v3 = getSpecular(); 
00309          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00310         _materialChunk->setSpecular(v4);
00311 
00312         _materialChunk->setShininess(getShininess());
00313 
00314          v3 = getEmission(); 
00315          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00316         _materialChunk->setEmission(v4);
00317         
00318         _materialChunk->setLit(getLit());
00319         _materialChunk->setColorMaterial(getColorMaterial());
00320     endEditCP  (_materialChunk);
00321     state->addChunk(_materialChunk);
00322 
00323     if(isTransparent())
00324         state->addChunk(_blendChunk);
00325     
00326     if(_vpChunk != NullFC)
00327         state->addChunk(_vpChunk);
00328     
00329     createFragmentProgram();
00330     
00331     if(_fpChunk != NullFC)
00332         state->addChunk(_fpChunk);
00333     
00334     for(MFStateChunkPtr::iterator i  = _mfChunks.begin();
00335                                   i != _mfChunks.end(); 
00336                                 ++i)
00337     {
00338         state->addChunk(*i);
00339     }
00340 
00341     return state;
00342 }

void PhongMaterial::rebuildState void   )  [virtual]
 

Rebuild the internal State. Just collects the chunks in the State.

Reimplemented from osg::ChunkMaterial.

Definition at line 344 of file OSGPhongMaterial.cpp.

References _blendChunk, _fpChunk, _materialChunk, osg::ChunkMaterialBase::_mfChunks, osg::Material::_pState, _vpChunk, osg::addRefCP(), osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::StateBase::create(), createFragmentProgram(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::PhongMaterialBase::getAmbient(), osg::PhongMaterialBase::getColorMaterial(), osg::PhongMaterialBase::getDiffuse(), osg::PhongMaterialBase::getEmission(), osg::PhongMaterialBase::getLit(), osg::PhongMaterialBase::getShininess(), osg::PhongMaterialBase::getSpecular(), osg::PhongMaterialBase::getTransparency(), isTransparent(), osg::NullFC, prepareLocalChunks(), and osg::Color4< ValueTypeT >::setValuesRGBA().

00345 {
00346     if(_pState != NullFC)
00347     {
00348         _pState->clearChunks();
00349     }
00350     else
00351     {
00352         _pState = State::create();
00353 
00354         addRefCP(_pState);
00355     }
00356 
00357     prepareLocalChunks();
00358 
00359     Color3f v3;
00360     Color4f v4;
00361     float alpha = 1.f - getTransparency();
00362 
00363     beginEditCP(_materialChunk);
00364          v3 = getAmbient(); 
00365          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00366         _materialChunk->setAmbient(v4);
00367 
00368          v3 = getDiffuse(); 
00369          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00370         _materialChunk->setDiffuse(v4);
00371 
00372          v3 = getSpecular(); 
00373          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00374         _materialChunk->setSpecular(v4);
00375 
00376         _materialChunk->setShininess(getShininess());
00377 
00378          v3 = getEmission(); 
00379          v4.setValuesRGBA(v3[0], v3[1], v3[2], alpha);
00380         _materialChunk->setEmission(v4);
00381         
00382         _materialChunk->setLit(getLit());
00383         _materialChunk->setColorMaterial(getColorMaterial());
00384     endEditCP(_materialChunk);
00385     _pState->addChunk(_materialChunk);
00386     
00387     if(isTransparent())
00388         _pState->addChunk(_blendChunk);
00389     
00390     if(_vpChunk != NullFC)
00391         _pState->addChunk(_vpChunk);
00392     
00393     createFragmentProgram();
00394 
00395     if(_fpChunk != NullFC)
00396         _pState->addChunk(_fpChunk);
00397     
00398     for(MFStateChunkPtr::iterator i  = _mfChunks.begin();
00399                                   i != _mfChunks.end(); 
00400                                 ++i)
00401     {
00402         _pState->addChunk(*i);
00403     }
00404 }

bool PhongMaterial::isTransparent void   )  const [virtual]
 

Check if the Material (i.e. any of its chunks) is transparent..

Reimplemented from osg::ChunkMaterial.

Definition at line 406 of file OSGPhongMaterial.cpp.

References osg::Eps, osg::PhongMaterialBase::getTransparency(), and osg::ChunkMaterial::isTransparent().

Referenced by makeState(), and rebuildState().

00407 {
00408     return ((getTransparency() > Eps) || (Inherited::isTransparent()));
00409 }

ChunkMaterialPtr PhongMaterial::createChunkMaterial void   )  [static]
 

Definition at line 411 of file OSGPhongMaterial.cpp.

References _arbFragmentProgram, _phong_fp_begin_prg, _phong_fp_end_prg, _phong_vp_prg, osg::beginEditCP(), osg::ChunkMaterialBase::ChunksFieldMask, osg::FragmentProgramChunkBase::create(), osg::VertexProgramChunkBase::create(), osg::MaterialChunkBase::create(), osg::ChunkMaterialBase::create(), osg::endEditCP(), osg::Window::hasCommonExtension(), and osg::Window::registerExtension().

00412 {
00413     _arbFragmentProgram = Window::registerExtension("GL_ARB_fragment_program");
00414 
00415     ChunkMaterialPtr cmat = ChunkMaterial::create();
00416     
00417     MaterialChunkPtr matc = MaterialChunk::create();
00418     beginEditCP(matc);
00419         matc->setAmbient(Color4f(0.1, 0.1, 0.2, 1.0));
00420         matc->setDiffuse(Color4f(0.2, 0.2, 0.8, 1.0));
00421         matc->setSpecular(Color4f(0.8, 0.8, 0.8, 1.0));
00422         matc->setShininess(100);
00423     endEditCP(matc);
00424     
00425     beginEditCP(cmat, ChunksFieldMask);
00426         cmat->addChunk(matc);
00427     endEditCP(cmat, ChunksFieldMask);
00428     
00429     // phong shading without a fragment shader looks quite black ;-)
00430     // all cards with a fragment shader should also have a vertex shader.
00431     if(Window::hasCommonExtension(_arbFragmentProgram))
00432     {
00433         VertexProgramChunkPtr vpc = VertexProgramChunk::create();
00434         beginEditCP(vpc);
00435             vpc->setProgram(_phong_vp_prg);
00436         endEditCP(vpc);
00437         
00438         FragmentProgramChunkPtr fpc = FragmentProgramChunk::create();
00439         std::string phong_fp_prg = _phong_fp_begin_prg + _phong_fp_end_prg;
00440         beginEditCP(fpc);
00441             fpc->setProgram(phong_fp_prg);
00442         endEditCP(fpc);
00443         
00444         beginEditCP(cmat, ChunksFieldMask);
00445             cmat->addChunk(vpc);
00446             cmat->addChunk(fpc);
00447         endEditCP(cmat, ChunksFieldMask);
00448     }
00449     return cmat;
00450 }

void PhongMaterial::prepareLocalChunks void   )  [private]
 

Definition at line 216 of file OSGPhongMaterial.cpp.

References _arbFragmentProgram, _blendChunk, _fpChunk, _materialChunk, _phong_vp_prg, _vpChunk, osg::addRefCP(), osg::beginEditCP(), osg::FragmentProgramChunkBase::create(), osg::VertexProgramChunkBase::create(), osg::BlendChunkBase::create(), osg::MaterialChunkBase::create(), createFragmentProgram(), osg::endEditCP(), osg::Window::hasCommonExtension(), and osg::NullFC.

Referenced by makeState(), and rebuildState().

00217 {
00218     if(_materialChunk != NullFC)
00219         return;
00220 
00221     _materialChunk = MaterialChunk::create();
00222     addRefCP(_materialChunk);
00223 
00224     _blendChunk = BlendChunk::create();
00225     addRefCP(_blendChunk);
00226     beginEditCP(_blendChunk);
00227         _blendChunk->setSrcFactor (GL_SRC_ALPHA);
00228         _blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
00229     endEditCP  (_blendChunk);
00230     
00231     // phong shading without a fragment shader looks quite black ;-)
00232     // all cards with a fragment shader should also have a vertex shader.
00233     if(Window::hasCommonExtension(_arbFragmentProgram))
00234     {
00235         _vpChunk = VertexProgramChunk::create();
00236         addRefCP(_vpChunk);
00237         beginEditCP(_vpChunk);
00238             _vpChunk->setProgram(_phong_vp_prg);
00239         endEditCP(_vpChunk);
00240         
00241         _fpChunk = FragmentProgramChunk::create();
00242         addRefCP(_fpChunk);
00243         createFragmentProgram();
00244     }
00245 }

void PhongMaterial::createFragmentProgram void   )  [private]
 

Definition at line 247 of file OSGPhongMaterial.cpp.

References _fpChunk, osg::ChunkMaterialBase::_mfChunks, _phong_fp_begin_prg, _phong_fp_end_prg, _phong_fp_tex_prg, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::AttachmentPtr::dcast(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), and osg::NullFC.

Referenced by makeState(), prepareLocalChunks(), and rebuildState().

00248 {
00249     if(_fpChunk == NullFC)
00250         return;
00251 
00252     bool has_tex_chunk = false;
00253     for(MFStateChunkPtr::iterator i  = _mfChunks.begin();
00254                                   i != _mfChunks.end(); 
00255                                 ++i)
00256     {
00257         if(TextureChunkPtr::dcast(*i) != NullFC)
00258         {
00259             has_tex_chunk = true;
00260             break;
00261         }
00262     }
00263     
00264     std::string phong_fp_prg;
00265     beginEditCP(_fpChunk);
00266         if(has_tex_chunk)
00267             phong_fp_prg = _phong_fp_begin_prg + _phong_fp_tex_prg + _phong_fp_end_prg;
00268         else
00269             phong_fp_prg = _phong_fp_begin_prg + _phong_fp_end_prg;
00270         _fpChunk->setProgram(phong_fp_prg);
00271     endEditCP(_fpChunk);
00272 }

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

Reimplemented from osg::ChunkMaterial.

Definition at line 174 of file OSGPhongMaterial.cpp.

00175 {
00176 }

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

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

Reimplemented from osg::ChunkMaterialBase.

Definition at line 58 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_type.

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

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::ChunkMaterialBase.

Definition at line 65 of file OSGPhongMaterialBase.inl.

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

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

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

Reimplemented from osg::ChunkMaterialBase.

Definition at line 184 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_type.

00185 {
00186     return _type; 
00187 } 

const FieldContainerType & PhongMaterialBase::getType void