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.

Public Types

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
}
typedef PhongMaterialPtr Ptr
enum  { ChunksFieldId = Inherited::NextFieldId, SlotsFieldId = ChunksFieldId + 1, NextFieldId = SlotsFieldId + 1 }
enum  { SortKeyFieldId = Inherited::NextFieldId, TransparencyModeFieldId = SortKeyFieldId + 1, NextFieldId = TransparencyModeFieldId + 1 }
enum  { AttachmentsFieldId = Inherited::NextFieldId, NextFieldId = AttachmentsFieldId + 1 }
enum  { NextFieldId = 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



SFColor3feditSFAmbient (void)
 Get the PhongMaterial::_sfAmbient field.
const SFColor3fgetSFAmbient (void) const
 Get the PhongMaterial::_sfAmbient field.
SFColor3fgetSFAmbient (void)
 Get the PhongMaterial::_sfAmbient field.
SFColor3feditSFDiffuse (void)
 Get the PhongMaterial::_sfDiffuse field.
const SFColor3fgetSFDiffuse (void) const
 Get the PhongMaterial::_sfDiffuse field.
SFColor3fgetSFDiffuse (void)
 Get the PhongMaterial::_sfDiffuse field.
SFColor3feditSFSpecular (void)
 Get the PhongMaterial::_sfSpecular field.
const SFColor3fgetSFSpecular (void) const
 Get the PhongMaterial::_sfSpecular field.
SFColor3fgetSFSpecular (void)
 Get the PhongMaterial::_sfSpecular field.
SFReal32editSFShininess (void)
 Get the PhongMaterial::_sfShininess field.
const SFReal32getSFShininess (void) const
 Get the PhongMaterial::_sfShininess field.
SFReal32getSFShininess (void)
 Get the PhongMaterial::_sfShininess field.
SFColor3feditSFEmission (void)
 Get the PhongMaterial::_sfEmission field.
const SFColor3fgetSFEmission (void) const
 Get the PhongMaterial::_sfEmission field.
SFColor3fgetSFEmission (void)
 Get the PhongMaterial::_sfEmission field.
SFReal32editSFTransparency (void)
 Get the PhongMaterial::_sfTransparency field.
const SFReal32getSFTransparency (void) const
 Get the PhongMaterial::_sfTransparency field.
SFReal32getSFTransparency (void)
 Get the PhongMaterial::_sfTransparency field.
SFBooleditSFLit (void)
 Get the PhongMaterial::_sfLit field.
const SFBoolgetSFLit (void) const
 Get the PhongMaterial::_sfLit field.
SFBoolgetSFLit (void)
 Get the PhongMaterial::_sfLit field.
SFGLenumeditSFColorMaterial (void)
 Get the PhongMaterial::_sfColorMaterial field.
const SFGLenumgetSFColorMaterial (void) const
 Get the PhongMaterial::_sfColorMaterial field.
SFGLenumgetSFColorMaterial (void)
 Get the PhongMaterial::_sfColorMaterial field.
Color3feditAmbient (void)
 Get the value of the PhongMaterial::_sfAmbient field.
const Color3fgetAmbient (void) const
 Get the value of the PhongMaterial::_sfAmbient field.
Color3fgetAmbient (void)
 Get the value of the PhongMaterial::_sfAmbient field.
Color3feditDiffuse (void)
 Get the value of the PhongMaterial::_sfDiffuse field.
const Color3fgetDiffuse (void) const
 Get the value of the PhongMaterial::_sfDiffuse field.
Color3fgetDiffuse (void)
 Get the value of the PhongMaterial::_sfDiffuse field.
Color3feditSpecular (void)
 Get the value of the PhongMaterial::_sfSpecular field.
const Color3fgetSpecular (void) const
 Get the value of the PhongMaterial::_sfSpecular field.
Color3fgetSpecular (void)
 Get the value of the PhongMaterial::_sfSpecular field.
Real32editShininess (void)
 Get the value of the PhongMaterial::_sfShininess field.
const Real32getShininess (void) const
 Get the value of the PhongMaterial::_sfShininess field.
Real32getShininess (void)
 Get the value of the PhongMaterial::_sfShininess field.
Color3feditEmission (void)
 Get the value of the PhongMaterial::_sfEmission field.
const Color3fgetEmission (void) const
 Get the value of the PhongMaterial::_sfEmission field.
Color3fgetEmission (void)
 Get the value of the PhongMaterial::_sfEmission field.
Real32editTransparency (void)
 Get the value of the PhongMaterial::_sfTransparency field.
const Real32getTransparency (void) const
 Get the value of the PhongMaterial::_sfTransparency field.
Real32getTransparency (void)
 Get the value of the PhongMaterial::_sfTransparency field.
bool & editLit (void)
 Get the value of the PhongMaterial::_sfLit field.
const bool & getLit (void) const
 Get the value of the PhongMaterial::_sfLit field.
bool & getLit (void)
 Get the value of the PhongMaterial::_sfLit field.
GLenum & editColorMaterial (void)
 Get the value of the PhongMaterial::_sfColorMaterial field.
const GLenum & getColorMaterial (void) const
 Get the value of the PhongMaterial::_sfColorMaterial field.
GLenum & getColorMaterial (void)
 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)
void clearChunks (void)
virtual bool operator== (const Material &other) const
Comparison



virtual bool operator== (const Material &other) const
virtual bool operator< (const Material &other) const
virtual bool operator!= (const Material &other) const
Field Get



MFStateChunkPtreditMFChunks (void)
 Get the ChunkMaterial::_mfChunks field.
const MFStateChunkPtrgetMFChunks (void) const
 Get the ChunkMaterial::_mfChunks field.
MFStateChunkPtrgetMFChunks (void)
 Get the ChunkMaterial::_mfChunks field.
MFInt32editMFSlots (void)
 Get the ChunkMaterial::_mfSlots field.
const MFInt32getMFSlots (void) const
 Get the ChunkMaterial::_mfSlots field.
MFInt32getMFSlots (void)
 Get the ChunkMaterial::_mfSlots field.
StateChunkPtreditChunks (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfChunks field.
const StateChunkPtrgetChunks (const UInt32 index) const
 Get the value of the index element the ChunkMaterial::_mfChunks 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.
Int32editSlots (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfSlots field.
const Int32getSlots (const UInt32 index) const
 Get the value of the index element the ChunkMaterial::_mfSlots 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



SFInt32editSFSortKey (void)
 Get the Material::_sfSortKey field.
const SFInt32getSFSortKey (void) const
 Get the Material::_sfSortKey field.
SFInt32getSFSortKey (void)
 Get the Material::_sfSortKey field.
SFInt32editSFTransparencyMode (void)
 Get the Material::_sfTransparencyMode field.
const SFInt32getSFTransparencyMode (void) const
 Get the Material::_sfTransparencyMode field.
SFInt32getSFTransparencyMode (void)
 Get the Material::_sfTransparencyMode field.
Int32editSortKey (void)
 Get the value of the Material::_sfSortKey field.
const Int32getSortKey (void) const
 Get the value of the Material::_sfSortKey field.
Int32getSortKey (void)
 Get the value of the Material::_sfSortKey field.
Int32editTransparencyMode (void)
 Get the value of the Material::_sfTransparencyMode field.
const Int32getTransparencyMode (void) const
 Get the value of the Material::_sfTransparencyMode field.
Int32getTransparencyMode (void)
 Get the value of the Material::_sfTransparencyMode field.
Field Set



void setSortKey (const Int32 &value)
 Set the value of the Material::_sfSortKey field.
void setTransparencyMode (const Int32 &value)
 Set the value of the Material::_sfTransparencyMode field.
Handle Attachments



void addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
void subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
AttachmentPtr findAttachment (UInt32 groupId, UInt16 binding=0)
AttachmentPtr findAttachment (const FieldContainerType &type, UInt16 binding=0)



SFAttachmentMapgetSFAttachments (void)
Get Instance Type Information



UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const



FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)

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)
Get Class Type Information



static UInt16 getClassGroupId (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 osg::BitVector TransparencyModeFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
Constants



static const Int32 NoStateSorting = 0x7fffffff
static const Int32 TransparencyAutoDetection = 0
static const Int32 TransparencyForceTransparent = 1
static const Int32 TransparencyForceOpaque = 2
CoredNodePtr helper



static const bool isNodeCore = false

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



virtual void executeSync (FieldContainer &other, const BitVector &whichField)=0
Destructor



void addChunks (StatePtr state)
Pointer



AttachmentContainerPtr getPtr (void)
MT Edit



template<class FieldTypeT >
void beginEditX (const BitVector &whichField, FieldTypeT &field)
template<class FieldTypeT >
void endEditX (const BitVector &whichField, FieldTypeT &field)
MT Construction



void onCreate (const FieldContainer *source=NULL)
void onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL)
MT Destruction



virtual void onDestroy (void)

Static Protected Member Functions

Create Fieldcontainer



template<class ObjectPtrT >
static void newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP)
template<class ObjectPtrT >
static void newPtr (ObjectPtrT &result)

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
SFInt32 _sfTransparencyMode
Fields



SFAttachmentMap _attachmentMap
Member



UInt32 _shares

Private Types

typedef PhongMaterialBase Inherited

Private Member Functions

void prepareLocalChunks (void)
void createFragmentProgram (void)
void operator= (const PhongMaterial &source)
 prohibit default functions (move to 'public' if needed)

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

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



virtual StatePtr getState (UInt32 index=0)
virtual bool isMultiPass (void) const
virtual UInt32 getNPasses (void) const
virtual Int32 getRealSortKey (void) const
typedef TypedFunctor1Base
< Action::ResultE, PtrCallArg
< DrawActionBase > > 
DrawFunctor

Detailed Description

Definition at line 59 of file OSGPhongMaterial.h.


Member Typedef Documentation

Reimplemented from osg::PhongMaterialBase.

Definition at line 63 of file OSGPhongMaterial.h.

Reimplemented from osg::ChunkMaterialBase.

Definition at line 97 of file OSGPhongMaterialBase.h.

Definition at line 107 of file OSGMaterial.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
AmbientFieldId 
DiffuseFieldId 
SpecularFieldId 
ShininessFieldId 
EmissionFieldId 
TransparencyFieldId 
LitFieldId 
ColorMaterialFieldId 
NextFieldId 

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     };

anonymous enum [inherited]
Enumerator:
ChunksFieldId 
SlotsFieldId 
NextFieldId 

Definition at line 93 of file OSGChunkMaterialBase.h.

00094     {
00095         ChunksFieldId = Inherited::NextFieldId,
00096         SlotsFieldId  = ChunksFieldId + 1,
00097         NextFieldId   = SlotsFieldId  + 1
00098     };

anonymous enum [inherited]
Enumerator:
SortKeyFieldId 
TransparencyModeFieldId 
NextFieldId 

Definition at line 93 of file OSGMaterialBase.h.

00094     {
00095         SortKeyFieldId          = Inherited::NextFieldId,
00096         TransparencyModeFieldId = SortKeyFieldId          + 1,
00097         NextFieldId             = TransparencyModeFieldId + 1
00098     };

anonymous enum [inherited]
Enumerator:
AttachmentsFieldId 
NextFieldId 

Definition at line 78 of file OSGAttachmentContainerImpl.h.

anonymous enum [inherited]
Enumerator:
NextFieldId 

Definition at line 73 of file OSGFieldContainerImpl.h.

00073 { NextFieldId = 1 };


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 279 of file OSGPhongMaterial.cpp.

References osg::ChunkMaterial::changed().

00280 {
00281     Inherited::changed(whichField, origin);
00282 }

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

Reimplemented from osg::ChunkMaterial.

Definition at line 284 of file OSGPhongMaterial.cpp.

References SLOG.

00286 {
00287     SLOG << "Dump PhongMaterial NI" << std::endl;
00288 }

StatePtr PhongMaterial::makeState ( void   )  [virtual]

Reimplemented from osg::ChunkMaterial.

Definition at line 290 of file OSGPhongMaterial.cpp.

References _blendChunk, _fpChunk, _materialChunk, osg::ChunkMaterialBase::_mfChunks, _vpChunk, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::PhongMaterialBase::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().

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

void PhongMaterial::rebuildState ( void   )  [virtual]

Reimplemented from osg::ChunkMaterial.

Definition at line 347 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::PhongMaterialBase::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().

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

bool PhongMaterial::isTransparent ( void   )  const [virtual]

Reimplemented from osg::ChunkMaterial.

Definition at line 409 of file OSGPhongMaterial.cpp.

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

Referenced by makeState(), and rebuildState().

00410 {
00411     return ((getTransparency() > Eps) || (Inherited::isTransparent()));
00412 }

ChunkMaterialPtr PhongMaterial::createChunkMaterial ( void   )  [static]

Definition at line 414 of file OSGPhongMaterial.cpp.

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

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

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::PhongMaterialBase::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     // calling hasCommonExtension() here is not a good idea as this works
00234     // only for a initialized window, I added a check to hasCommonExtension()
00235     // so this won't crash anymore.
00236     if(Window::hasCommonExtension(_arbFragmentProgram))
00237     {
00238         _vpChunk = VertexProgramChunk::create();
00239         addRefCP(_vpChunk);
00240         beginEditCP(_vpChunk);
00241             _vpChunk->setProgram(_phong_vp_prg);
00242         endEditCP(_vpChunk);
00243         
00244         _fpChunk = FragmentProgramChunk::create();
00245         addRefCP(_fpChunk);
00246         createFragmentProgram();
00247     }
00248 }

void PhongMaterial::createFragmentProgram ( void   )  [private]

Definition at line 250 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().

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

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]

Reimplemented from osg::PhongMaterialBase.

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 & osg::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 & osg::PhongMaterialBase::getType ( void   )  const [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 189 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_type.

00190 {
00191     return _type;
00192 } 

UInt32 osg::PhongMaterialBase::getContainerSize ( void   )  const [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 204 of file OSGPhongMaterialBase.cpp.

00205 { 
00206     return sizeof(PhongMaterial); 
00207 }

SFColor3f * osg::PhongMaterialBase::editSFAmbient ( void   )  [inline, inherited]

Definition at line 108 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfAmbient.

00109 {
00110     return &_sfAmbient;
00111 }

const SFColor3f * osg::PhongMaterialBase::getSFAmbient ( void   )  const [inline, inherited]

Definition at line 101 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfAmbient.

00102 {
00103     return &_sfAmbient;
00104 }

SFColor3f * osg::PhongMaterialBase::getSFAmbient ( void   )  [inline, inherited]

Definition at line 116 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfAmbient.

00117 {
00118     return &_sfAmbient;
00119 }

SFColor3f * osg::PhongMaterialBase::editSFDiffuse ( void   )  [inline, inherited]

Definition at line 131 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfDiffuse.

00132 {
00133     return &_sfDiffuse;
00134 }

const SFColor3f * osg::PhongMaterialBase::getSFDiffuse ( void   )  const [inline, inherited]

Definition at line 124 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfDiffuse.

00125 {
00126     return &_sfDiffuse;
00127 }

SFColor3f * osg::PhongMaterialBase::getSFDiffuse ( void   )  [inline, inherited]

Definition at line 139 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfDiffuse.

00140 {
00141     return &_sfDiffuse;
00142 }

SFColor3f * osg::PhongMaterialBase::editSFSpecular ( void   )  [inline, inherited]

Definition at line 154 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfSpecular.

00155 {
00156     return &_sfSpecular;
00157 }

const SFColor3f * osg::PhongMaterialBase::getSFSpecular ( void   )  const [inline, inherited]

Definition at line 147 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfSpecular.

00148 {
00149     return &_sfSpecular;
00150 }

SFColor3f * osg::PhongMaterialBase::getSFSpecular ( void   )  [inline, inherited]

Definition at line 162 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfSpecular.

00163 {
00164     return &_sfSpecular;
00165 }

SFReal32 * osg::PhongMaterialBase::editSFShininess ( void   )  [inline, inherited]

Definition at line 177 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfShininess.

00178 {
00179     return &_sfShininess;
00180 }

const SFReal32 * osg::PhongMaterialBase::getSFShininess ( void   )  const [inline, inherited]

Definition at line 170 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfShininess.

00171 {
00172     return &_sfShininess;
00173 }

SFReal32 * osg::PhongMaterialBase::getSFShininess ( void   )  [inline, inherited]

Definition at line 185 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfShininess.

00186 {
00187     return &_sfShininess;
00188 }

SFColor3f * osg::PhongMaterialBase::editSFEmission ( void   )  [inline, inherited]

Definition at line 200 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfEmission.

00201 {
00202     return &_sfEmission;
00203 }

const SFColor3f * osg::PhongMaterialBase::getSFEmission ( void   )  const [inline, inherited]

Definition at line 193 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfEmission.

00194 {
00195     return &_sfEmission;
00196 }

SFColor3f * osg::PhongMaterialBase::getSFEmission ( void   )  [inline, inherited]

Definition at line 208 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfEmission.

00209 {
00210     return &_sfEmission;
00211 }

SFReal32 * osg::PhongMaterialBase::editSFTransparency ( void   )  [inline, inherited]

Definition at line 223 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfTransparency.

00224 {
00225     return &_sfTransparency;
00226 }

const SFReal32 * osg::PhongMaterialBase::getSFTransparency ( void   )  const [inline, inherited]

Definition at line 216 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfTransparency.

00217 {
00218     return &_sfTransparency;
00219 }

SFReal32 * osg::PhongMaterialBase::getSFTransparency ( void   )  [inline, inherited]

Definition at line 231 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfTransparency.

00232 {
00233     return &_sfTransparency;
00234 }

SFBool * osg::PhongMaterialBase::editSFLit ( void   )  [inline, inherited]

Definition at line 246 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfLit.

00247 {
00248     return &_sfLit;
00249 }

const SFBool * osg::PhongMaterialBase::getSFLit ( void   )  const [inline, inherited]

Definition at line 239 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfLit.

00240 {
00241     return &_sfLit;
00242 }

SFBool * osg::PhongMaterialBase::getSFLit ( void   )  [inline, inherited]

Definition at line 254 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfLit.

00255 {
00256     return &_sfLit;
00257 }

SFGLenum * osg::PhongMaterialBase::editSFColorMaterial ( void   )  [inline, inherited]

Definition at line 269 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfColorMaterial.

00270 {
00271     return &_sfColorMaterial;
00272 }

const SFGLenum * osg::PhongMaterialBase::getSFColorMaterial ( void   )  const [inline, inherited]

Definition at line 262 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfColorMaterial.

00263 {
00264     return &_sfColorMaterial;
00265 }

SFGLenum * osg::PhongMaterialBase::getSFColorMaterial ( void   )  [inline, inherited]

Definition at line 277 of file OSGPhongMaterialBase.inl.

References osg::PhongMaterialBase::_sfColorMaterial.

00278 {
00279     return &_sfColorMaterial;
00280 }

Color3f & osg::PhongMaterialBase::editAmbient ( void   )  [inline, inherited]

Definition at line 286 of file OSGPhongMaterialBase.inl.

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

00287 {
00288     return _sfAmbient.getValue();
00289 }

const Color3f & osg::PhongMaterialBase::getAmbient ( void   )  const [inline, inherited]

Definition at line 293 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00294 {
00295     return _sfAmbient.getValue();
00296 }

Color3f & osg::PhongMaterialBase::getAmbient ( void   )  [inline, inherited]

Definition at line 301 of file OSGPhongMaterialBase.inl.

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

00302 {
00303     return _sfAmbient.getValue();
00304 }

Color3f & osg::PhongMaterialBase::editDiffuse ( void   )  [inline, inherited]

Definition at line 316 of file OSGPhongMaterialBase.inl.

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

00317 {
00318     return _sfDiffuse.getValue();
00319 }

const Color3f & osg::PhongMaterialBase::getDiffuse ( void   )  const [inline, inherited]

Definition at line 323 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00324 {
00325     return _sfDiffuse.getValue();
00326 }

Color3f & osg::PhongMaterialBase::getDiffuse ( void   )  [inline, inherited]

Definition at line 331 of file OSGPhongMaterialBase.inl.

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

00332 {
00333     return _sfDiffuse.getValue();
00334 }

Color3f & osg::PhongMaterialBase::editSpecular ( void   )  [inline, inherited]

Definition at line 346 of file OSGPhongMaterialBase.inl.

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

00347 {
00348     return _sfSpecular.getValue();
00349 }

const Color3f & osg::PhongMaterialBase::getSpecular ( void   )  const [inline, inherited]

Definition at line 353 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00354 {
00355     return _sfSpecular.getValue();
00356 }

Color3f & osg::PhongMaterialBase::getSpecular ( void   )  [inline, inherited]

Definition at line 361 of file OSGPhongMaterialBase.inl.

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

00362 {
00363     return _sfSpecular.getValue();
00364 }

Real32 & osg::PhongMaterialBase::editShininess ( void   )  [inline, inherited]

Definition at line 376 of file OSGPhongMaterialBase.inl.

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

00377 {
00378     return _sfShininess.getValue();
00379 }

const Real32 & osg::PhongMaterialBase::getShininess ( void   )  const [inline, inherited]

Definition at line 383 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00384 {
00385     return _sfShininess.getValue();
00386 }

Real32 & osg::PhongMaterialBase::getShininess ( void   )  [inline, inherited]

Definition at line 391 of file OSGPhongMaterialBase.inl.

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

00392 {
00393     return _sfShininess.getValue();
00394 }

Color3f & osg::PhongMaterialBase::editEmission ( void   )  [inline, inherited]

Definition at line 406 of file OSGPhongMaterialBase.inl.

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

00407 {
00408     return _sfEmission.getValue();
00409 }

const Color3f & osg::PhongMaterialBase::getEmission ( void   )  const [inline, inherited]

Definition at line 413 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00414 {
00415     return _sfEmission.getValue();
00416 }

Color3f & osg::PhongMaterialBase::getEmission ( void   )  [inline, inherited]

Definition at line 421 of file OSGPhongMaterialBase.inl.

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

00422 {
00423     return _sfEmission.getValue();
00424 }

Real32 & osg::PhongMaterialBase::editTransparency ( void   )  [inline, inherited]

Definition at line 436 of file OSGPhongMaterialBase.inl.

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

00437 {
00438     return _sfTransparency.getValue();
00439 }

const Real32 & osg::PhongMaterialBase::getTransparency ( void   )  const [inline, inherited]

Definition at line 443 of file OSGPhongMaterialBase.inl.

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

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

00444 {
00445     return _sfTransparency.getValue();
00446 }

Real32 & osg::PhongMaterialBase::getTransparency ( void   )  [inline, inherited]

Definition at line 451 of file OSGPhongMaterialBase.inl.

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

00452 {
00453     return _sfTransparency.getValue();
00454 }

bool & osg::PhongMaterialBase::editLit ( void   )  [inline, inherited]

Definition at line 466 of file OSGPhongMaterialBase.inl.

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

00467 {
00468     return _sfLit.getValue();
00469 }

const bool & osg::PhongMaterialBase::getLit ( void   )  const [inline, inherited]

Definition at line 473 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00474 {
00475     return _sfLit.getValue();
00476 }

bool & osg::PhongMaterialBase::getLit ( void   )  [inline, inherited]

Definition at line 481 of file OSGPhongMaterialBase.inl.

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

00482 {
00483     return _sfLit.getValue();
00484 }

GLenum & osg::PhongMaterialBase::editColorMaterial ( void   )  [inline, inherited]

Definition at line 496 of file OSGPhongMaterialBase.inl.

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

00497 {
00498     return _sfColorMaterial.getValue();
00499 }

const GLenum & osg::PhongMaterialBase::getColorMaterial ( void   )  const [inline, inherited]

Definition at line 503 of file OSGPhongMaterialBase.inl.

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

Referenced by makeState(), and rebuildState().

00504 {
00505     return _sfColorMaterial.getValue();
00506 }

GLenum & osg::PhongMaterialBase::getColorMaterial ( void   )  [inline, inherited]

Definition at line 511 of file OSGPhongMaterialBase.inl.

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

00512 {
00513     return _sfColorMaterial.getValue();
00514 }

void osg::PhongMaterialBase::setAmbient ( const Color3f value  )  [inline, inherited]
void osg::PhongMaterialBase::setDiffuse ( const Color3f value  )  [inline, inherited]
void osg::PhongMaterialBase::setSpecular ( const Color3f value  )  [inline, inherited]
void osg::PhongMaterialBase::setShininess ( const Real32 value  )  [inline, inherited]
void osg::PhongMaterialBase::setEmission ( const Color3f value  )  [inline, inherited]
void osg::PhongMaterialBase::setTransparency ( const Real32 value  )  [inline, inherited]
void osg::PhongMaterialBase::setLit ( const bool &  value  )  [inline, inherited]

Definition at line 489 of file OSGPhongMaterialBase.inl.

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

00490 {
00491     _sfLit.setValue(value);
00492 }

void osg::PhongMaterialBase::setColorMaterial ( const GLenum &  value  )  [inline, inherited]
UInt32 osg::PhongMaterialBase::getBinSize ( const BitVector whichField  )  [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 281 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_sfAmbient, osg::PhongMaterialBase::_sfColorMaterial, osg::PhongMaterialBase::_sfDiffuse, osg::PhongMaterialBase::_sfEmission, osg::PhongMaterialBase::_sfLit, osg::PhongMaterialBase::_sfShininess, osg::PhongMaterialBase::_sfSpecular, osg::PhongMaterialBase::_sfTransparency, osg::PhongMaterialBase::AmbientFieldMask, osg::PhongMaterialBase::ColorMaterialFieldMask, osg::PhongMaterialBase::DiffuseFieldMask, osg::PhongMaterialBase::EmissionFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::ChunkMaterialBase::getBinSize(), osg::PhongMaterialBase::LitFieldMask, osg::FieldBits::NoField, osg::PhongMaterialBase::ShininessFieldMask, osg::PhongMaterialBase::SpecularFieldMask, and osg::PhongMaterialBase::TransparencyFieldMask.

00282 {
00283     UInt32 returnValue = Inherited::getBinSize(whichField);
00284 
00285     if(FieldBits::NoField != (AmbientFieldMask & whichField))
00286     {
00287         returnValue += _sfAmbient.getBinSize();
00288     }
00289 
00290     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
00291     {
00292         returnValue += _sfDiffuse.getBinSize();
00293     }
00294 
00295     if(FieldBits::NoField != (SpecularFieldMask & whichField))
00296     {
00297         returnValue += _sfSpecular.getBinSize();
00298     }
00299 
00300     if(FieldBits::NoField != (ShininessFieldMask & whichField))
00301     {
00302         returnValue += _sfShininess.getBinSize();
00303     }
00304 
00305     if(FieldBits::NoField != (EmissionFieldMask & whichField))
00306     {
00307         returnValue += _sfEmission.getBinSize();
00308     }
00309 
00310     if(FieldBits::NoField != (TransparencyFieldMask & whichField))
00311     {
00312         returnValue += _sfTransparency.getBinSize();
00313     }
00314 
00315     if(FieldBits::NoField != (LitFieldMask & whichField))
00316     {
00317         returnValue += _sfLit.getBinSize();
00318     }
00319 
00320     if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
00321     {
00322         returnValue += _sfColorMaterial.getBinSize();
00323     }
00324 
00325 
00326     return returnValue;
00327 }

void osg::PhongMaterialBase::copyToBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 329 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_sfAmbient, osg::PhongMaterialBase::_sfColorMaterial, osg::PhongMaterialBase::_sfDiffuse, osg::PhongMaterialBase::_sfEmission, osg::PhongMaterialBase::_sfLit, osg::PhongMaterialBase::_sfShininess, osg::PhongMaterialBase::_sfSpecular, osg::PhongMaterialBase::_sfTransparency, osg::PhongMaterialBase::AmbientFieldMask, osg::PhongMaterialBase::ColorMaterialFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::ChunkMaterialBase::copyToBin(), osg::PhongMaterialBase::DiffuseFieldMask, osg::PhongMaterialBase::EmissionFieldMask, osg::PhongMaterialBase::LitFieldMask, osg::FieldBits::NoField, osg::PhongMaterialBase::ShininessFieldMask, osg::PhongMaterialBase::SpecularFieldMask, and osg::PhongMaterialBase::TransparencyFieldMask.

00331 {
00332     Inherited::copyToBin(pMem, whichField);
00333 
00334     if(FieldBits::NoField != (AmbientFieldMask & whichField))
00335     {
00336         _sfAmbient.copyToBin(pMem);
00337     }
00338 
00339     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
00340     {
00341         _sfDiffuse.copyToBin(pMem);
00342     }
00343 
00344     if(FieldBits::NoField != (SpecularFieldMask & whichField))
00345     {
00346         _sfSpecular.copyToBin(pMem);
00347     }
00348 
00349     if(FieldBits::NoField != (ShininessFieldMask & whichField))
00350     {
00351         _sfShininess.copyToBin(pMem);
00352     }
00353 
00354     if(FieldBits::NoField != (EmissionFieldMask & whichField))
00355     {
00356         _sfEmission.copyToBin(pMem);
00357     }
00358 
00359     if(FieldBits::NoField != (TransparencyFieldMask & whichField))
00360     {
00361         _sfTransparency.copyToBin(pMem);
00362     }
00363 
00364     if(FieldBits::NoField != (LitFieldMask & whichField))
00365     {
00366         _sfLit.copyToBin(pMem);
00367     }
00368 
00369     if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
00370     {
00371         _sfColorMaterial.copyToBin(pMem);
00372     }
00373 
00374 
00375 }

void osg::PhongMaterialBase::copyFromBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 377 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_sfAmbient, osg::PhongMaterialBase::_sfColorMaterial, osg::PhongMaterialBase::_sfDiffuse, osg::PhongMaterialBase::_sfEmission, osg::PhongMaterialBase::_sfLit, osg::PhongMaterialBase::_sfShininess, osg::PhongMaterialBase::_sfSpecular, osg::PhongMaterialBase::_sfTransparency, osg::PhongMaterialBase::AmbientFieldMask, osg::PhongMaterialBase::ColorMaterialFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::ChunkMaterialBase::copyFromBin(), osg::PhongMaterialBase::DiffuseFieldMask, osg::PhongMaterialBase::EmissionFieldMask, osg::PhongMaterialBase::LitFieldMask, osg::FieldBits::NoField, osg::PhongMaterialBase::ShininessFieldMask, osg::PhongMaterialBase::SpecularFieldMask, and osg::PhongMaterialBase::TransparencyFieldMask.

00379 {
00380     Inherited::copyFromBin(pMem, whichField);
00381 
00382     if(FieldBits::NoField != (AmbientFieldMask & whichField))
00383     {
00384         _sfAmbient.copyFromBin(pMem);
00385     }
00386 
00387     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
00388     {
00389         _sfDiffuse.copyFromBin(pMem);
00390     }
00391 
00392     if(FieldBits::NoField != (SpecularFieldMask & whichField))
00393     {
00394         _sfSpecular.copyFromBin(pMem);
00395     }
00396 
00397     if(FieldBits::NoField != (ShininessFieldMask & whichField))
00398     {
00399         _sfShininess.copyFromBin(pMem);
00400     }
00401 
00402     if(FieldBits::NoField != (EmissionFieldMask & whichField))
00403     {
00404         _sfEmission.copyFromBin(pMem);
00405     }
00406 
00407     if(FieldBits::NoField != (TransparencyFieldMask & whichField))
00408     {
00409         _sfTransparency.copyFromBin(pMem);
00410     }
00411 
00412     if(FieldBits::NoField != (LitFieldMask & whichField))
00413     {
00414         _sfLit.copyFromBin(pMem);
00415     }
00416 
00417     if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
00418     {
00419         _sfColorMaterial.copyFromBin(pMem);
00420     }
00421 
00422 
00423 }

PhongMaterialPtr osg::PhongMaterialBase::create ( void   )  [inline, static, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 72 of file OSGPhongMaterialBase.inl.

References osg::AttachmentContainerPtr::dcast(), osg::PhongMaterialBase::getClassType(), osg::NullFC, and osg::PhongMaterialBase::shallowCopy().

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

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

PhongMaterialPtr osg::PhongMaterialBase::createEmpty ( void   )  [inline, static, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 87 of file OSGPhongMaterialBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr osg::PhongMaterialBase::shallowCopy ( void   )  const [virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 195 of file OSGPhongMaterialBase.cpp.

References osg::FieldContainer::newPtr().

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

00196 { 
00197     PhongMaterialPtr returnValue; 
00198 
00199     newPtr(returnValue, dynamic_cast<const PhongMaterial *>(this)); 
00200 
00201     return returnValue; 
00202 }

void osg::PhongMaterialBase::executeSyncImpl ( PhongMaterialBase pOther,
const BitVector whichField 
) [protected, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 426 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::_sfAmbient, osg::PhongMaterialBase::_sfColorMaterial, osg::PhongMaterialBase::_sfDiffuse, osg::PhongMaterialBase::_sfEmission, osg::PhongMaterialBase::_sfLit, osg::PhongMaterialBase::_sfShininess, osg::PhongMaterialBase::_sfSpecular, osg::PhongMaterialBase::_sfTransparency, osg::PhongMaterialBase::AmbientFieldMask, osg::PhongMaterialBase::ColorMaterialFieldMask, osg::PhongMaterialBase::DiffuseFieldMask, osg::PhongMaterialBase::EmissionFieldMask, osg::ChunkMaterialBase::executeSyncImpl(), osg::PhongMaterialBase::LitFieldMask, osg::FieldBits::NoField, osg::PhongMaterialBase::ShininessFieldMask, osg::PhongMaterialBase::SpecularFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::PhongMaterialBase::TransparencyFieldMask.

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

00428 {
00429 
00430     Inherited::executeSyncImpl(pOther, whichField);
00431 
00432     if(FieldBits::NoField != (AmbientFieldMask & whichField))
00433         _sfAmbient.syncWith(pOther->_sfAmbient);
00434 
00435     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
00436         _sfDiffuse.syncWith(pOther->_sfDiffuse);
00437 
00438     if(FieldBits::NoField != (SpecularFieldMask & whichField))
00439         _sfSpecular.syncWith(pOther->_sfSpecular);
00440 
00441     if(FieldBits::NoField != (ShininessFieldMask & whichField))
00442         _sfShininess.syncWith(pOther->_sfShininess);
00443 
00444     if(FieldBits::NoField != (EmissionFieldMask & whichField))
00445         _sfEmission.syncWith(pOther->_sfEmission);
00446 
00447     if(FieldBits::NoField != (TransparencyFieldMask & whichField))
00448         _sfTransparency.syncWith(pOther->_sfTransparency);
00449 
00450     if(FieldBits::NoField != (LitFieldMask & whichField))
00451         _sfLit.syncWith(pOther->_sfLit);
00452 
00453     if(FieldBits::NoField != (ColorMaterialFieldMask & whichField))
00454         _sfColorMaterial.syncWith(pOther->_sfColorMaterial);
00455 
00456 
00457 }

void osg::PhongMaterialBase::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, virtual, inherited]

Reimplemented from osg::ChunkMaterialBase.

Definition at line 211 of file OSGPhongMaterialBase.cpp.

References osg::PhongMaterialBase::executeSyncImpl().

00213 {
00214     this->executeSyncImpl(static_cast<PhongMaterialBase *>(&other),
00215                           whichField);
00216 }

virtual void osg::FieldContainer::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, pure virtual, inherited]
static const char* osg::ChunkMaterial::getClassname ( void   )  [inline, static, inherited]

Reimplemented from osg::Material.

Reimplemented in osg::SimpleMaterial.

Definition at line 64 of file OSGChunkMaterial.h.

00064 { return "ChunkMaterial"; };

void ChunkMaterial::draw ( DrawFunctor func,
DrawActionBase action 
) [virtual, inherited]

Draw the function behind the functor with this material. The functored function should be very careful changing OpenGL state, better just use glBegin(), glEnd() and the standard stuff in between.

Implements osg::Material.

Definition at line 285 of file OSGChunkMaterial.cpp.

References osg::addRefCP(), osg::TypedFunctor1Base< RetT, CallArgT, SizeTraitsT >::call(), osg::ChunkMaterial::makeState(), and osg::subRefCP().

00286 {
00287     StatePtr state = makeState();
00288 
00289     addRefCP(state);
00290 
00291     state->activate(action);
00292 
00293     func.call(action);
00294 
00295     state->deactivate(action);
00296 
00297     subRefCP(state); // kill it
00298 }

void ChunkMaterial::draw ( Geometry geo,
DrawActionBase action 
) [virtual, inherited]

Draw the geometry with this material.

Implements osg::Material.

Definition at line 265 of file OSGChunkMaterial.cpp.

References osg::addRefCP(), osg::Geometry::drawPrimitives(), osg::ChunkMaterial::makeState(), and osg::subRefCP().

00266 {
00267     StatePtr state = makeState();
00268 
00269     addRefCP(state);
00270 
00271     state->activate(action);
00272 
00273     geo->drawPrimitives(action);
00274 
00275     state->deactivate(action);
00276 
00277     subRefCP(state); // kill it
00278 }

bool ChunkMaterial::addChunk ( StateChunkPtr  chunk,
Int32  slot = State::AutoSlotReplace 
) [inherited]

Add the given chunk to the material. It is possible to specify which slot this chunk should be associated with. See StateChunkClass for a general description of the slots concept. The default slot is State::AutoSlotReplace.

Definition at line 140 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::ChunkMaterialBase::_mfSlots, osg::addRefCP(), osg::State::AutoSlotReplace, osg::MField< FieldTypeT, fieldNameSpace >::push_back(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00141 {
00142     if(slot != State::AutoSlotReplace)
00143     {
00144         while(_mfSlots.size() < _mfChunks.size())
00145             _mfSlots.push_back(State::AutoSlotReplace);
00146     }
00147     
00148     _mfChunks.push_back(chunk);
00149     
00150     if(slot != State::AutoSlotReplace)
00151         _mfSlots.push_back(slot);
00152         
00153     addRefCP(chunk);
00154 
00155     return true;
00156 }

bool ChunkMaterial::subChunk ( StateChunkPtr  chunk,
Int32  slot = State::AutoSlotReplace 
) [inherited]

Remove the given chunk from the material. If the slot is not State::AutoSlotReplace, only the given slot will be searched and removed if found. Returns true if the chunk couldn't be found.

Definition at line 162 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::ChunkMaterialBase::_mfSlots, osg::State::AutoSlotReplace, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::subRefCP(), and SWARNING.

00163 {
00164     UInt32 i;
00165     
00166     for(i = 0; i < _mfChunks.size(); ++i)
00167     {
00168         if(_mfChunks[i] == chunk &&
00169            ((i < _mfSlots.size() && _mfSlots[i] == slot) ||
00170             slot == State::AutoSlotReplace))
00171         {
00172             subRefCP(chunk);
00173             _mfChunks.erase(_mfChunks.begin() + i);
00174             if(i < _mfSlots.size())
00175                 _mfSlots.erase(_mfSlots.begin() + i);
00176             return false;
00177         }
00178     }
00179 
00180     SWARNING << "ChunkMaterial::subChunk(" << this << ") has no chunk "
00181              << chunk << " with slot " << slot << std::endl;
00182              
00183     return true;
00184 }

Int32 ChunkMaterial::find ( StateChunkPtr  chunk  )  [inherited]

Search the list of chunks for the given chunk. Returns its index, -1 if the chunk is not used in the material.

Definition at line 190 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00191 {
00192     UInt32 i;
00193     
00194     for(i = 0; i < _mfChunks.size(); ++i)
00195     {
00196         if(_mfChunks[i] == chunk)
00197             return i;
00198     }
00199              
00200     return -1;
00201 }

StateChunkPtr ChunkMaterial::find ( const FieldContainerType type,
Int32  slot = State::AutoSlotReplace 
) [inherited]

Search the list of chunks for a chunk of the given type and the given slot. If slot is State::AutoSlotReplace, all slots are searched and the first found chunk is returned. For searching a specific chunk with a AutoSlotReplace slot, the slot parameter is interpreted as a index.

Definition at line 210 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::State::AutoSlotReplace, osg::ChunkMaterialBase::getMFSlots(), osg::ChunkMaterialBase::getSlots(), osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00212 {
00213     UInt32 index = 0;
00214     for(UInt32 i = 0; i < _mfChunks.size(); ++i)
00215     {
00216         StateChunkPtr p = _mfChunks[i];
00217         Int32 s = State::AutoSlotReplace;
00218 
00219         if(i < getMFSlots()->size())
00220             s = getSlots(i);
00221 
00222         if(s == State::AutoSlotReplace)
00223             s = index;
00224 
00225         if(p->getType() == type)
00226         {           
00227             if(slot == State::AutoSlotReplace || slot == s)
00228                 return (p);
00229             ++index;
00230         }
00231     }
00232     return NullFC;
00233 }

void ChunkMaterial::clearChunks ( void   )  [inherited]

Add the given chunk to the material. It is possible to specify which slot this chunk should be associated with. See StateChunkClass for a general description of the slots concept. The default slot is State::AutoSlotReplace.

Definition at line 235 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::clear(), osg::MField< FieldTypeT, fieldNameSpace >::end(), and osg::subRefCP().

Referenced by osg::ChunkMaterial::~ChunkMaterial().

00236 {
00237     MFStateChunkPtr::iterator matIt  = _mfChunks.begin();
00238     MFStateChunkPtr::iterator matEnd = _mfChunks.end ();
00239     
00240     while(matIt != matEnd)
00241     {
00242         subRefCP(*matIt);
00243         ++matIt;
00244     }
00245     _mfChunks.clear();
00246 }

bool ChunkMaterial::operator== ( const Material other  )  const [virtual, inherited]

Add the given chunk to the material. It is possible to specify which slot this chunk should be associated with. See StateChunkClass for a general description of the slots concept. The default slot is State::AutoSlotReplace.

Definition at line 248 of file OSGChunkMaterial.cpp.

00249 {
00250     const Material& thisBase = *this;
00251     if (!(thisBase == other))
00252         return false;
00253 
00254     const ChunkMaterial* othercm = dynamic_cast<const ChunkMaterial*>(&other);
00255     if (!othercm)
00256         return false;
00257 
00258     // ?
00259     return false;
00260 }

bool Material::operator== ( const Material other  )  const [virtual, inherited]

Definition at line 207 of file OSGMaterial.cpp.

References osg::Material::_pState.

00208 {
00209     return _pState == other._pState;
00210 }

void ChunkMaterial::addChunks ( StatePtr  state  )  [protected, inherited]

Add chunks to the given state. Needed for ordering in the drived materials.

Definition at line 304 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::ChunkMaterialBase::_mfSlots, osg::State::AutoSlotReplace, and osg::MField< FieldTypeT, fieldNameSpace >::size().

Referenced by osg::SimpleMaterial::makeState(), osg::ChunkMaterial::makeState(), osg::SimpleMaterial::rebuildState(), and osg::ChunkMaterial::rebuildState().

00305 {
00306     UInt32 i;
00307     
00308     for(i = 0; i < _mfChunks.size(); ++i)
00309         state->addChunk(_mfChunks[i], 
00310                         (i < _mfSlots.size()) ? _mfSlots[i]
00311                                                 : State::AutoSlotReplace);
00312 }

MFStateChunkPtr * osg::ChunkMaterialBase::editMFChunks ( void   )  [inline, inherited]

Definition at line 108 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00109 {
00110     return &_mfChunks;
00111 }

const MFStateChunkPtr * osg::ChunkMaterialBase::getMFChunks ( void   )  const [inline, inherited]

Definition at line 101 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00102 {
00103     return &_mfChunks;
00104 }

MFStateChunkPtr * osg::ChunkMaterialBase::getMFChunks ( void   )  [inline, inherited]

Definition at line 116 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00117 {
00118     return &_mfChunks;
00119 }

MFInt32 * osg::ChunkMaterialBase::editMFSlots ( void   )  [inline, inherited]

Definition at line 131 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00132 {
00133     return &_mfSlots;
00134 }

const MFInt32 * osg::ChunkMaterialBase::getMFSlots ( void   )  const [inline, inherited]

Definition at line 124 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

Referenced by osg::ChunkMaterial::find().

00125 {
00126     return &_mfSlots;
00127 }

MFInt32 * osg::ChunkMaterialBase::getMFSlots ( void   )  [inline, inherited]

Definition at line 139 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00140 {
00141     return &_mfSlots;
00142 }

StateChunkPtr & osg::ChunkMaterialBase::editChunks ( const UInt32  index  )  [inline, inherited]

Definition at line 149 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00150 {
00151     return _mfChunks[index];
00152 }

const StateChunkPtr & osg::ChunkMaterialBase::getChunks ( const UInt32  index  )  const [inline, inherited]

Definition at line 156 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00157 {
00158     return _mfChunks[index];
00159 }

StateChunkPtr & osg::ChunkMaterialBase::getChunks ( const UInt32  index  )  [inline, inherited]

Definition at line 164 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00165 {
00166     return _mfChunks[index];
00167 }

MFStateChunkPtr & osg::ChunkMaterialBase::getChunks ( void   )  [inline, inherited]

Definition at line 171 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00172 {
00173     return _mfChunks;
00174 }

const MFStateChunkPtr & osg::ChunkMaterialBase::getChunks ( void   )  const [inline, inherited]

Definition at line 178 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfChunks.

00179 {
00180     return _mfChunks;
00181 }

Int32 & osg::ChunkMaterialBase::editSlots ( const UInt32  index  )  [inline, inherited]

Definition at line 187 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00188 {
00189     return _mfSlots[index];
00190 }

const Int32 & osg::ChunkMaterialBase::getSlots ( const UInt32  index  )  const [inline, inherited]

Definition at line 194 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00195 {
00196     return _mfSlots[index];
00197 }

Int32 & osg::ChunkMaterialBase::getSlots ( const UInt32  index  )  [inline, inherited]

Definition at line 202 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00203 {
00204     return _mfSlots[index];
00205 }

MFInt32 & osg::ChunkMaterialBase::getSlots ( void   )  [inline, inherited]

Definition at line 209 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

Referenced by osg::ChunkMaterial::find().

00210 {
00211     return _mfSlots;
00212 }

const MFInt32 & osg::ChunkMaterialBase::getSlots ( void   )  const [inline, inherited]

Definition at line 216 of file OSGChunkMaterialBase.inl.

References osg::ChunkMaterialBase::_mfSlots.

00217 {
00218     return _mfSlots;
00219 }

StatePtr Material::getState ( UInt32  index = 0  )  [virtual, inherited]

Reimplemented in osg::MultiPassMaterial, and osg::SwitchMaterial.

Definition at line 164 of file OSGMaterial.cpp.

References osg::Material::_pState.

Referenced by osg::RenderAction::getMaterialStates().

00165 {
00166     return _pState;
00167 }

bool Material::isMultiPass ( void   )  const [virtual, inherited]

Reimplemented in osg::MultiPassMaterial, and osg::SwitchMaterial.

Definition at line 169 of file OSGMaterial.cpp.

Referenced by osg::RenderAction::dropFunctor(), osg::RenderAction::dropGeometry(), and osg::RenderAction::getMaterialStates().

00170 {
00171     return false;
00172 }

UInt32 Material::getNPasses ( void   )  const [virtual, inherited]

Reimplemented in osg::MultiPassMaterial, and osg::SwitchMaterial.

Definition at line 174 of file OSGMaterial.cpp.

Referenced by osg::RenderAction::getMaterialStates().

00175 {
00176     return 1;
00177 }

Int32 Material::getRealSortKey ( void   )  const [virtual, inherited]
bool Material::operator< ( const Material other  )  const [virtual, inherited]

Definition at line 202 of file OSGMaterial.cpp.

00203 {
00204     return this < &other;
00205 }

bool Material::operator!= ( const Material other  )  const [virtual, inherited]

Definition at line 212 of file OSGMaterial.cpp.

00213 {
00214     return ! (*this == other);
00215 }

SFInt32 * osg::MaterialBase::editSFSortKey ( void   )  [inline, inherited]

Definition at line 82 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfSortKey.

00083 {
00084     return &_sfSortKey;
00085 }

const SFInt32 * osg::MaterialBase::getSFSortKey ( void   )  const [inline, inherited]

Definition at line 75 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfSortKey.

00076 {
00077     return &_sfSortKey;
00078 }

SFInt32 * osg::MaterialBase::getSFSortKey ( void   )  [inline, inherited]

Definition at line 90 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfSortKey.

00091 {
00092     return &_sfSortKey;
00093 }

SFInt32 * osg::MaterialBase::editSFTransparencyMode ( void   )  [inline, inherited]

Definition at line 105 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfTransparencyMode.

00106 {
00107     return &_sfTransparencyMode;
00108 }

const SFInt32 * osg::MaterialBase::getSFTransparencyMode ( void   )  const [inline, inherited]

Definition at line 98 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfTransparencyMode.

00099 {
00100     return &_sfTransparencyMode;
00101 }

SFInt32 * osg::MaterialBase::getSFTransparencyMode ( void   )  [inline, inherited]

Definition at line 113 of file OSGMaterialBase.inl.

References osg::MaterialBase::_sfTransparencyMode.

00114 {
00115     return &_sfTransparencyMode;
00116 }

Int32 & osg::MaterialBase::editSortKey ( void   )  [inline, inherited]

Definition at line 122 of file OSGMaterialBase.inl.

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

00123 {
00124     return _sfSortKey.getValue();
00125 }

const Int32 & osg::MaterialBase::getSortKey ( void   )  const [inline, inherited]

Definition at line 129 of file OSGMaterialBase.inl.

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

00130 {
00131     return _sfSortKey.getValue();
00132 }

Int32 & osg::MaterialBase::getSortKey ( void   )  [inline, inherited]

Definition at line 137 of file OSGMaterialBase.inl.

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

00138 {
00139     return _sfSortKey.getValue();
00140 }

Int32 & osg::MaterialBase::editTransparencyMode ( void   )  [inline, inherited]

Definition at line 152 of file OSGMaterialBase.inl.

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

00153 {
00154     return _sfTransparencyMode.getValue();
00155 }

const Int32 & osg::MaterialBase::getTransparencyMode ( void   )  const [inline, inherited]
Int32 & osg::MaterialBase::getTransparencyMode ( void   )  [inline, inherited]

Definition at line 167 of file OSGMaterialBase.inl.

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

00168 {
00169     return _sfTransparencyMode.getValue();
00170 }

void osg::MaterialBase::setSortKey ( const Int32 value  )  [inline, inherited]

Definition at line 145 of file OSGMaterialBase.inl.

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

00146 {
00147     _sfSortKey.setValue(value);
00148 }

void osg::MaterialBase::setTransparencyMode ( const Int32 value  )  [inline, inherited]
void AttachmentContainer::addAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 84 of file OSGAttachmentContainer.cpp.

References osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, and osg::subRefCP().

Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::Node::onCreate(), and osg::Image::setAttachmentField().

00086 {
00087     UInt32 key;
00088 
00089     if(fieldContainerP == NullFC)
00090         return;
00091 
00092     key = (UInt32 (fieldContainerP->getGroupId()) << 16) | binding;
00093 
00094     addRefCP(fieldContainerP);
00095 
00096     beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00097     {
00098         fieldContainerP->addParent(getPtr());
00099     }
00100     endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00101 
00102     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00103 
00104     if(fcI != _attachmentMap.getValue().end())
00105     {
00106         beginEditCP((*fcI).second, Attachment::ParentsFieldMask);
00107         {
00108             (*fcI).second->subParent(getPtr());
00109         }
00110         endEditCP  ((*fcI).second, Attachment::ParentsFieldMask);
00111 
00112         subRefCP((*fcI).second);
00113 
00114         (*fcI).second = fieldContainerP;
00115     }
00116     else
00117     {
00118         _attachmentMap.getValue()[key] = fieldContainerP;
00119     }
00120 }

void AttachmentContainer::subAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 122 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::beginEditCP(), osg::endEditCP(), osg::AttachmentContainer::getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, and osg::subRefCP().

00124 {
00125     UInt32 key;
00126 
00127     AttachmentMap::iterator fcI;
00128 
00129     if(fieldContainerP == NullFC)
00130         return;
00131 
00132     key = (UInt32(fieldContainerP->getGroupId()) << 16) | binding;
00133 
00134     fcI = _attachmentMap.getValue().find(key);
00135 
00136     if(fcI != _attachmentMap.getValue().end())
00137     {
00138         beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00139         {
00140             (*fcI).second->subParent(getPtr());
00141         }
00142         endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00143 
00144         subRefCP((*fcI).second);
00145 
00146         _attachmentMap.getValue().erase(fcI);
00147     }
00148 }

AttachmentPtr AttachmentContainer::findAttachment ( UInt32  groupId,
UInt16  binding = 0 
) [inherited]

Definition at line 150 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::NullFC.

Referenced by osg::Image::findAttachmentField(), and osg::Image::setAttachmentField().

00152 {
00153     UInt32 key = (UInt32(groupId) << 16) | binding;
00154 
00155     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00156 
00157     if(fcI == _attachmentMap.getValue().end())
00158     {
00159         return NullFC;
00160     }
00161     else
00162     {
00163         return (*fcI).second;
00164     }
00165 }

AttachmentPtr osg::AttachmentContainer::findAttachment ( const FieldContainerType type,
UInt16  binding = 0 
) [inline, inherited]

Definition at line 57 of file OSGAttachmentContainerImpl.inl.

00060 {
00061     return findAttachment(type.getGroupId(), binding);
00062 }

SFAttachmentMap * AttachmentContainer::getSFAttachments ( void   )  [inherited]

Field Access

Definition at line 170 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap.

00171 {
00172     return &_attachmentMap;
00173 }

AttachmentContainerPtr AttachmentContainer::getPtr ( void   )  [protected, inherited]
UInt16 osg::FieldContainer::getClassGroupId ( void   )  [inline, static, inherited]

Definition at line 71 of file OSGFieldContainerImpl.inl.

References osg::FieldContainer::_type, and osg::FieldContainerType::getGroupId().

00072 {
00073     return _type.getGroupId();
00074 }

UInt32 osg::FieldContainer::getTypeId ( void   )  const [inline, inherited]

Definition at line 77 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getId(), and osg::FieldContainer::getType().

Referenced by osg::TextureChunk::changeFrom(), and osg::CubeTextureChunk::changeFrom().

00078 {
00079     return getType().getId();
00080 }

UInt16 osg::FieldContainer::getGroupId ( void   )  const [inline, inherited]

Definition at line 83 of file OSGFieldContainerImpl.inl.

References osg::FieldContainerType::getGroupId(), and osg::FieldContainer::getType().

Referenced by osg::Image::setAttachmentField().

00084 {
00085     return getType().getGroupId();
00086 }

const Char8 * osg::FieldContainer::getTypeName ( void   )  const [inline, inherited]

Definition at line 89 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getCName(), and osg::FieldContainer::getType().

00090 {
00091     return getType().getCName();
00092 }

Field * osg::FieldContainer::getField ( UInt32  fieldId  )  [inline, inherited]

Generic Field Access

Definition at line 95 of file OSGFieldContainerImpl.inl.

References osg::FieldDescription::getField(), osg::FieldContainerType::getFieldDescription(), and osg::FieldContainer::getType().

Referenced by osg::QFCItem::expand(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().

00096 {
00097     const FieldDescription *desc = getType().getFieldDescription(fieldId);
00098 
00099     return desc ? desc->getField(*this) : NULL;
00100 }

Field * osg::FieldContainer::getField ( const Char8 fieldName  )  [inline, inherited]

Generic Field Access

Definition at line 103 of file OSGFieldContainerImpl.inl.

References osg::FieldContainerType::findFieldDescription(), osg::FieldDescription::getField(), and osg::FieldContainer::getType().

00104 {
00105     const FieldDescription *desc =getType().findFieldDescription(fieldName);
00106 
00107     return desc ? desc->getField(*this) : NULL;
00108 }

template<class ObjectPtrT >
void osg::FieldContainer::newPtr ( ObjectPtrT &  result,
const typename ObjectPtrT::StoredObjectType *  prototypeP 
) [inline, static, protected, inherited]

Definition at line 138 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

Referenced by osg::XWindowBase::createEmpty(), osg::WIN32WindowBase::createEmpty(), osg::ViewportBase::createEmpty(), osg::VertexProgramChunkBase::createEmpty(), osg::TwoSidedLightingChunkBase::createEmpty(), osg::TransformChunkBase::createEmpty(), osg::TransformBase::createEmpty(), osg::TileCameraDecoratorBase::createEmpty(), osg::TextureTransformChunkBase::createEmpty(), osg::TextureGrabForegroundBase::createEmpty(), osg::TextureGrabBackgroundBase::createEmpty(), osg::TextureChunkBase::createEmpty(), osg::TextureBackgroundBase::createEmpty(), osg::TexGenChunkBase::createEmpty(), osg::SwitchMaterialBase::createEmpty(), osg::SwitchBase::createEmpty(), osg::SurfaceBase::createEmpty(), osg::StringAttributeMapBase::createEmpty(), osg::StereoBufferViewportBase::createEmpty(), osg::StencilChunkBase::createEmpty(), osg::StateSortingGroupBase::createEmpty(), osg::StateBase::createEmpty(), osg::SpotLightBase::createEmpty(), osg::SortFirstWindowBase::createEmpty(), osg::SolidBackgroundBase::createEmpty(), osg::SlicesBase::createEmpty(), osg::SkyBackgroundBase::createEmpty(), osg::SimpleTexturedMaterialBase::createEmpty(), osg::SimpleStatisticsForegroundBase::createEmpty(), osg::SimpleMaterialBase::createEmpty(), osg::SHLParameterChunkBase::createEmpty(), osg::SHLChunkBase::createEmpty(), osg::ShearedStereoCameraDecoratorBase::createEmpty(), osg::ShaderParameterVec4fBase::createEmpty(), osg::ShaderParameterVec3fBase::createEmpty(), osg::ShaderParameterVec2fBase::createEmpty(), osg::ShaderParameterStringBase::createEmpty(), osg::ShaderParameterRealBase::createEmpty(), osg::ShaderParameterMVec4fBase::createEmpty(), osg::ShaderParameterMVec3fBase::createEmpty(), osg::ShaderParameterMVec2fBase::createEmpty(), osg::ShaderParameterMRealBase::createEmpty(), osg::ShaderParameterMMatrixBase::createEmpty(), osg::ShaderParameterMIntBase::createEmpty(), osg::ShaderParameterMatrixBase::createEmpty(), osg::ShaderParameterIntBase::createEmpty(), osg::ShaderParameterBoolBase::createEmpty(), osg::ShadeModelChunkBase::createEmpty(), osg::ScreenGroupBase::createEmpty(), osg::SClipPlaneChunkBase::createEmpty(), osg::ResolutionDisplayFilterBase::createEmpty(), osg::RenderOptionsBase::createEmpty(), osg::RegisterCombinersChunkBase::createEmpty(), osg::QTWindowBase::createEmpty(), osg::ProxyGroupBase::createEmpty(), osg::ProjectionCameraDecoratorBase::createEmpty(), osg::PolygonForegroundBase::createEmpty(), osg::PolygonChunkBase::createEmpty(), osg::PolygonBackgroundBase::createEmpty(), osg::PointLightBase::createEmpty(), osg::PointChunkBase::createEmpty(), osg::PhongMaterialBase::createEmpty(), osg::PerspectiveCameraBase::createEmpty(), osg::PassiveWindowBase::createEmpty(), osg::PassiveViewportBase::createEmpty(), osg::PassiveBackgroundBase::createEmpty(), osg::ParticlesBase::createEmpty(), osg::OrthographicCameraBase::createEmpty(), osg::OffsetCameraDecoratorBase::createEmpty(), osg::OffCenterPerspectiveCameraBase::createEmpty(), osg::MultiSwitchBase::createEmpty(), osg::MultiPassMaterialBase::createEmpty(), osg::MultiDisplayWindowBase::createEmpty(), osg::MatrixCameraDecoratorBase::createEmpty(), osg::MatrixCameraBase::createEmpty(), osg::MaterialPoolBase::createEmpty(), osg::MaterialGroupBase::createEmpty(), osg::MaterialChunkBase::createEmpty(), osg::LogicOpChunkBase::createEmpty(), osg::LineChunkBase::createEmpty(), osg::LightModelChunkBase::createEmpty(), osg::LightEnvBase::createEmpty(), osg::LightChunkBase::createEmpty(), osg::InverseTransformBase::createEmpty(), osg::InlineBase::createEmpty(), osg::ImageForegroundBase::createEmpty(), osg::ImageBase::createEmpty(), osg::ImageBackgroundBase::createEmpty(), osg::GroupBase::createEmpty(), osg::GraphicStatisticsForegroundBase::createEmpty(), osg::GradientBackgroundBase::createEmpty(), osg::GrabForegroundBase::createEmpty(), osg::GLUTWindowBase::createEmpty(), osg::GeometryBase::createEmpty(), osg::FresnelMaterialBase::createEmpty(), osg::FragmentProgramChunkBase::createEmpty(), osg::FogChunkBase::createEmpty(), osg::FogBase::createEmpty(), osg::FileGrabForegroundBase::createEmpty(), osg::FCPtrAttributeMapBase::createEmpty(), osg::FBOViewportBase::createEmpty(), osg::FatBorderChunkBase::createEmpty(), osg::DVRVolumeTextureBase::createEmpty(), osg::DVRVolumeBase::createEmpty(), osg::DVRSimpleShaderBase::createEmpty(), osg::DVRSimpleLUTShaderBase::createEmpty(), osg::DVRMtexLUTShaderBase::createEmpty(), osg::DVRLookupTableBase::createEmpty(), osg::DVRIsoSurfaceBase::createEmpty(), osg::DVRIsoShaderBase::createEmpty(), osg::DVRGeometryBase::createEmpty(), osg::DVRClipObjectsBase::createEmpty(), osg::DVRClipGeometryBase::createEmpty(), osg::DVRAppearanceBase::createEmpty(), osg::DistortionDisplayFilterBase::createEmpty(), osg::DistanceLODBase::createEmpty(), osg::DisplayFilterForegroundBase::createEmpty(), osg::DisplayCalibrationBase::createEmpty(), osg::DirectionalLightBase::createEmpty(), osg::DepthClearBackgroundBase::createEmpty(), osg::DepthChunkBase::createEmpty(), osg::CubeTextureChunkBase::createEmpty(), osg::ComponentTransformBase::createEmpty(), osg::ColorMaskChunkBase::createEmpty(), osg::ColorDisplayFilterBase::createEmpty(), osg::ColorBufferViewportBase::createEmpty(), osg::ClusterWindowBase::createEmpty(), osg::ClipPlaneChunkBase::createEmpty(), osg::ClipPlaneBase::createEmpty(), osg::ChunkMaterialBase::createEmpty(), osg::BlendChunkBase::createEmpty(), osg::BillboardBase::createEmpty(), osg::XWindowBase::shallowCopy(), osg::WIN32WindowBase::shallowCopy(), osg::ViewportBase::shallowCopy(), osg::VertexProgramChunkBase::shallowCopy(), osg::TwoSidedLightingChunkBase::shallowCopy(), osg::TransformChunkBase::shallowCopy(), osg::TransformBase::shallowCopy(), osg::TileCameraDecoratorBase::shallowCopy(), osg::TextureTransformChunkBase::shallowCopy(), osg::TextureGrabForegroundBase::shallowCopy(), osg::TextureGrabBackgroundBase::shallowCopy(), osg::TextureChunkBase::shallowCopy(), osg::TextureBackgroundBase::shallowCopy(), osg::TexGenChunkBase::shallowCopy(), osg::SwitchMaterialBase::shallowCopy(), osg::SwitchBase::shallowCopy(), osg::SurfaceBase::shallowCopy(), osg::StringAttributeMapBase::shallowCopy(), osg::StereoBufferViewportBase::shallowCopy(), osg::StencilChunkBase::shallowCopy(), osg::StateSortingGroupBase::shallowCopy(), osg::StateBase::shallowCopy(), osg::SpotLightBase::shallowCopy(), osg::SortFirstWindowBase::shallowCopy(), osg::SolidBackgroundBase::shallowCopy(), osg::SlicesBase::shallowCopy(), osg::SkyBackgroundBase::shallowCopy(), osg::SimpleTexturedMaterialBase::shallowCopy(), osg::SimpleStatisticsForegroundBase::shallowCopy(), osg::SimpleMaterialBase::shallowCopy(), osg::SHLParameterChunkBase::shallowCopy(), osg::SHLChunkBase::shallowCopy(), osg::ShearedStereoCameraDecoratorBase::shallowCopy(), osg::ShaderParameterVec4fBase::shallowCopy(), osg::ShaderParameterVec3fBase::shallowCopy(), osg::ShaderParameterVec2fBase::shallowCopy(), osg::ShaderParameterStringBase::shallowCopy(), osg::ShaderParameterRealBase::shallowCopy(), osg::ShaderParameterMVec4fBase::shallowCopy(), osg::ShaderParameterMVec3fBase::shallowCopy(), osg::ShaderParameterMVec2fBase::shallowCopy(), osg::ShaderParameterMRealBase::shallowCopy(), osg::ShaderParameterMMatrixBase::shallowCopy(), osg::ShaderParameterMIntBase::shallowCopy(), osg::ShaderParameterMatrixBase::shallowCopy(), osg::ShaderParameterIntBase::shallowCopy(), osg::ShaderParameterBoolBase::shallowCopy(), osg::ShadeModelChunkBase::shallowCopy(), osg::ScreenGroupBase::shallowCopy(), osg::SClipPlaneChunkBase::shallowCopy(), osg::ResolutionDisplayFilterBase::shallowCopy(), osg::RenderOptionsBase::shallowCopy(), osg::RegisterCombinersChunkBase::shallowCopy(), osg::QTWindowBase::shallowCopy(), osg::ProxyGroupBase::shallowCopy(), osg::ProjectionCameraDecoratorBase::shallowCopy(), osg::PolygonForegroundBase::shallowCopy(), osg::PolygonChunkBase::shallowCopy(), osg::PolygonBackgroundBase::shallowCopy(), osg::PointLightBase::shallowCopy(), osg::PointChunkBase::shallowCopy(), osg::PhongMaterialBase::shallowCopy(), osg::PerspectiveCameraBase::shallowCopy(), osg::PassiveWindowBase::shallowCopy(), osg::PassiveViewportBase::shallowCopy(), osg::PassiveBackgroundBase::shallowCopy(), osg::ParticlesBase::shallowCopy(), osg::OrthographicCameraBase::shallowCopy(), osg::OffsetCameraDecoratorBase::shallowCopy(), osg::OffCenterPerspectiveCameraBase::shallowCopy(), osg::MultiSwitchBase::shallowCopy(), osg::MultiPassMaterialBase::shallowCopy(), osg::MultiDisplayWindowBase::shallowCopy(), osg::MatrixCameraDecoratorBase::shallowCopy(), osg::MatrixCameraBase::shallowCopy(), osg::MaterialPoolBase::shallowCopy(), osg::MaterialGroupBase::shallowCopy(), osg::MaterialChunkBase::shallowCopy(), osg::LogicOpChunkBase::shallowCopy(), osg::LineChunkBase::shallowCopy(), osg::LightModelChunkBase::shallowCopy(), osg::LightEnvBase::shallowCopy(), osg::LightChunkBase::shallowCopy(), osg::InverseTransformBase::shallowCopy(), osg::InlineBase::shallowCopy(), osg::ImageForegroundBase::shallowCopy(), osg::ImageBase::shallowCopy(), osg::ImageBackgroundBase::shallowCopy(), osg::GroupBase::shallowCopy(), osg::GraphicStatisticsForegroundBase::shallowCopy(), osg::GradientBackgroundBase::shallowCopy(), osg::GrabForegroundBase::shallowCopy(), osg::GLUTWindowBase::shallowCopy(), osg::GeometryBase::shallowCopy(), osg::FresnelMaterialBase::shallowCopy(), osg::FragmentProgramChunkBase::shallowCopy(), osg::FogChunkBase::shallowCopy(), osg::FogBase::shallowCopy(), osg::FileGrabForegroundBase::shallowCopy(), osg::FCPtrAttributeMapBase::shallowCopy(), osg::FBOViewportBase::shallowCopy(), osg::FatBorderChunkBase::shallowCopy(), osg::DVRVolumeTextureBase::shallowCopy(), osg::DVRVolumeBase::shallowCopy(), osg::DVRSimpleShaderBase::shallowCopy(), osg::DVRSimpleLUTShaderBase::shallowCopy(), osg::DVRMtexLUTShaderBase::shallowCopy(), osg::DVRLookupTableBase::shallowCopy(), osg::DVRIsoSurfaceBase::shallowCopy(), osg::DVRIsoShaderBase::shallowCopy(), osg::DVRGeometryBase::shallowCopy(), osg::DVRClipObjectsBase::shallowCopy(), osg::DVRClipGeometryBase::shallowCopy(), osg::DVRAppearanceBase::shallowCopy(), osg::DistortionDisplayFilterBase::shallowCopy(), osg::DistanceLODBase::shallowCopy(), osg::DisplayFilterForegroundBase::shallowCopy(), osg::DisplayCalibrationBase::shallowCopy(), osg::DirectionalLightBase::shallowCopy(), osg::DepthClearBackgroundBase::shallowCopy(), osg::DepthChunkBase::shallowCopy(), osg::CubeTextureChunkBase::shallowCopy(), osg::ComponentTransformBase::shallowCopy(), osg::ColorMaskChunkBase::shallowCopy(), osg::ColorDisplayFilterBase::shallowCopy(), osg::ColorBufferViewportBase::shallowCopy(), osg::ClusterWindowBase::shallowCopy(), osg::ClipPlaneChunkBase::shallowCopy(), osg::ClipPlaneBase::shallowCopy(), osg::ChunkMaterialBase::shallowCopy(), osg::BlendChunkBase::shallowCopy(), and osg::BillboardBase::shallowCopy().

00141 {
00142     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00143     
00144     UInt8 *pTmp;
00145     
00146     result._containerSize = sizeof(ObjectType);
00147     
00148     pTmp        = 
00149         static_cast<UInt8 *>(operator new(
00150             sizeof(Int32)      + // ReferenceCount
00151             sizeof(UInt32)     + // ContainerId
00152             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00153     
00154     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00155     
00156     pTmp += sizeof(Int32);
00157     
00158     result._storeP = (pTmp + sizeof(UInt32));
00159 
00160 #ifdef OSG_DEBUG_FCPTR
00161     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00162 #endif
00163 
00164     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00165         FieldContainerFactory::the()->registerFieldContainer(result);
00166 
00167 #ifdef OSG_INVALID_PTR_CHECK
00168     result._id = *(reinterpret_cast<UInt32 *>(pTmp));
00169 #endif
00170 
00171     Thread::getCurrentChangeList()->addCreated(
00172         *(reinterpret_cast<UInt32 *>(pTmp)));
00173     
00174     pTmp += sizeof(UInt32);
00175     
00176     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00177 
00178     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00179     {
00180         pTmp = 
00181             reinterpret_cast<UInt8 *>(new (pTmp) ObjectType(*prototypeP));
00182         
00183         pTmp += sizeof(ObjectType);
00184     }
00185     
00186     result->onCreate(prototypeP);
00187 
00188     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00189     {
00190         aObject[i].onCreateAspect(aObject, prototypeP);
00191     }
00192 
00193 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00194 
00195     fprintf(stderr, "GV_MEM_FC_DBG : (%u) cc (%p|%u)\n", 
00196             Thread::getAspect(),
00197             result._storeP,
00198 //            ObjectType::getClassType().getCName(),
00199             ObjectType::getClassType().getId());
00200 #endif
00201 
00202 #ifdef OSG_DEBUG_TYPED_FCPTR
00203     result.updateTypedStore();
00204 #endif
00205 }

template<class ObjectPtrT >
void osg::FieldContainer::newPtr ( ObjectPtrT &  result  )  [inline, static, protected, inherited]

Definition at line 208 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

00209 {
00210     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00211     
00212     UInt8 *pTmp;
00213     
00214     result._containerSize = sizeof(ObjectType);
00215     
00216     pTmp        =             
00217         static_cast<UInt8 *>(operator new(
00218             sizeof(Int32)      + // ReferenceCount
00219             sizeof(UInt32)     + // ContainerId
00220             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00221     
00222     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00223     
00224     pTmp  += sizeof(Int32);
00225     
00226     result._storeP = (pTmp + sizeof(UInt32));
00227     
00228 #ifdef OSG_DEBUG_FCPTR
00229     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00230 #endif
00231 
00232     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00233         FieldContainerFactory::the()->registerFieldContainer(result);
00234 
00235 #ifdef OSG_INVALID_PTR_CHECK
00236     result._id = *(reinterpret_cast<UInt32 *>(pTmp));
00237 #endif
00238 
00239     Thread::getCurrentChangeList()->addCreated(
00240         *(reinterpret_cast<UInt32 *>(pTmp)));
00241     
00242     pTmp += sizeof(UInt32);
00243     
00244     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00245 
00246     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00247     {
00248         pTmp = reinterpret_cast<UInt8 *>(new (pTmp) ObjectType());
00249         
00250         pTmp += sizeof(ObjectType);
00251     }
00252     
00253     result->onCreate();
00254     
00255     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00256     {
00257         aObject[i].onCreateAspect(aObject);
00258     }
00259 
00260 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00261     fprintf(stderr, "GV_MEM_FC_DBG : (%u) c (%p|%u)\n", 
00262             Thread::getAspect(),
00263             result._storeP,
00264 //            ObjectType::getClassType().getCName(),
00265             ObjectType::getClassType().getId());
00266 #endif
00267     
00268 #ifdef OSG_DEBUG_TYPED_FCPTR
00269     result.updateTypedStore();
00270 #endif
00271 }

template<class FieldTypeT >
void osg::FieldContainer::beginEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 293 of file OSGFieldContainerImpl.inl.

00294 {
00295 //    fieldR.beginEdit();
00296 }

template<class FieldTypeT >
void osg::FieldContainer::endEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 299 of file OSGFieldContainerImpl.inl.

References osg::endEditCP().

00300 {
00301     FieldContainerPtr tmpPtr(this);
00302     endEditCP(tmpPtr, whichField);
00303 }

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

Reimplemented in osg::Window.

Definition at line 331 of file OSGFieldContainerImpl.inl.

00333 {
00334 }

void FieldContainer::onDestroy ( void   )  [protected, virtual, inherited]

Friends And Related Function Documentation

friend class FieldContainer [friend]

Reimplemented from osg::PhongMaterialBase.

Definition at line 117 of file OSGPhongMaterial.h.

friend class PhongMaterialBase [friend]

Definition at line 118 of file OSGPhongMaterial.h.


Member Data Documentation

Definition at line 122 of file OSGPhongMaterial.h.

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

Definition at line 124 of file OSGPhongMaterial.h.

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

Definition at line 125 of file OSGPhongMaterial.h.

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

Definition at line 126 of file OSGPhongMaterial.h.

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

Initial value:
 
    (Inherited::MTInfluenceMask) | 
    (static_cast<BitVector>(0x0) << Inherited::NextFieldId)

Reimplemented from osg::ChunkMaterialBase.

Definition at line 122 of file OSGPhongMaterialBase.h.

bool osg::PhongMaterialBase::_sfLit [protected, inherited]
GLenum osg::PhongMaterialBase::_sfColorMaterial [protected, inherited]
Int32 osg::ChunkMaterialBase::_mfSlots [protected, inherited]
const Int32 Material::NoStateSorting = 0x7fffffff [static, inherited]
const Int32 Material::TransparencyAutoDetection = 0 [static, inherited]
const Int32 Material::TransparencyForceTransparent = 1 [static, inherited]
const Int32 Material::TransparencyForceOpaque = 2 [static, inherited]

Definition at line 81 of file OSGMaterial.h.

StatePtr osg::Material::_pState [protected, inherited]
Int32 osg::MaterialBase::_sfSortKey [protected, inherited]
const BitVector osg::FieldContainer::NextFieldMask [static, inherited]
Initial value:
 
                    (TypeTraits<BitVector>::One << NextFieldId)

Definition at line 75 of file OSGFieldContainerImpl.h.

const bool osg::FieldContainer::isNodeCore = false [static, inherited]

Reimplemented in osg::NodeCore.

Definition at line 181 of file OSGFieldContainerImpl.h.

UInt32 osg::FieldContainer::_shares [protected, inherited]

Definition at line 199 of file OSGFieldContainerImpl.h.


The documentation for this class was generated from the following files:

Generated on 8 Feb 2010 for OpenSG by  doxygen 1.6.1