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

osg::MaterialChunkBase Class Reference

MaterialChunk Base Class.

#include <OSGMaterialChunkBase.h>

Inheritance diagram for osg::MaterialChunkBase:

osg::StateChunk osg::StateChunkBase osg::Attachment osg::FieldContainer osg::MaterialChunk List of all members.

Public Types

typedef MaterialChunkPtr Ptr
enum  {
  DiffuseFieldId = Inherited::NextFieldId, AmbientFieldId = DiffuseFieldId + 1, SpecularFieldId = AmbientFieldId + 1, EmissionFieldId = SpecularFieldId + 1,
  ShininessFieldId = EmissionFieldId + 1, LitFieldId = ShininessFieldId + 1, ColorMaterialFieldId = LitFieldId + 1, BackMaterialFieldId = ColorMaterialFieldId + 1,
  BackDiffuseFieldId = BackMaterialFieldId + 1, BackAmbientFieldId = BackDiffuseFieldId + 1, BackSpecularFieldId = BackAmbientFieldId + 1, BackEmissionFieldId = BackSpecularFieldId + 1,
  BackShininessFieldId = BackEmissionFieldId + 1, BackColorMaterialFieldId = BackShininessFieldId + 1, NextFieldId = BackColorMaterialFieldId + 1
}

Public Member Functions

Get Instance Type Information
UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const
Generic Field Access *FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFColor4fgetSFDiffuse (void)
 Get the MaterialChunk::_sfDiffuse field.
SFColor4fgetSFAmbient (void)
 Get the MaterialChunk::_sfAmbient field.
SFColor4fgetSFSpecular (void)
 Get the MaterialChunk::_sfSpecular field.
SFColor4fgetSFEmission (void)
 Get the MaterialChunk::_sfEmission field.
SFReal32getSFShininess (void)
 Get the MaterialChunk::_sfShininess field.
SFBoolgetSFLit (void)
 Get the MaterialChunk::_sfLit field.
SFGLenumgetSFColorMaterial (void)
 Get the MaterialChunk::_sfColorMaterial field.
SFBoolgetSFBackMaterial (void)
 Get the MaterialChunk::_sfBackMaterial field.
SFColor4fgetSFBackDiffuse (void)
 Get the MaterialChunk::_sfBackDiffuse field.
SFColor4fgetSFBackAmbient (void)
 Get the MaterialChunk::_sfBackAmbient field.
SFColor4fgetSFBackSpecular (void)
 Get the MaterialChunk::_sfBackSpecular field.
SFColor4fgetSFBackEmission (void)
 Get the MaterialChunk::_sfBackEmission field.
SFReal32getSFBackShininess (void)
 Get the MaterialChunk::_sfBackShininess field.
SFGLenumgetSFBackColorMaterial (void)
 Get the MaterialChunk::_sfBackColorMaterial field.
Color4fgetDiffuse (void)
 Get the value of the MaterialChunk::_sfDiffuse field.
const Color4fgetDiffuse (void) const
 Get the value of the MaterialChunk::_sfDiffuse field.
Color4fgetAmbient (void)
 Get the value of the MaterialChunk::_sfAmbient field.
const Color4fgetAmbient (void) const
 Get the value of the MaterialChunk::_sfAmbient field.
Color4fgetSpecular (void)
 Get the value of the MaterialChunk::_sfSpecular field.
const Color4fgetSpecular (void) const
 Get the value of the MaterialChunk::_sfSpecular field.
Color4fgetEmission (void)
 Get the value of the MaterialChunk::_sfEmission field.
const Color4fgetEmission (void) const
 Get the value of the MaterialChunk::_sfEmission field.
Real32getShininess (void)
 Get the value of the MaterialChunk::_sfShininess field.
const Real32getShininess (void) const
 Get the value of the MaterialChunk::_sfShininess field.
bool & getLit (void)
 Get the value of the MaterialChunk::_sfLit field.
const bool & getLit (void) const
 Get the value of the MaterialChunk::_sfLit field.
GLenumgetColorMaterial (void)
 Get the value of the MaterialChunk::_sfColorMaterial field.
const GLenumgetColorMaterial (void) const
 Get the value of the MaterialChunk::_sfColorMaterial field.
bool & getBackMaterial (void)
 Get the value of the MaterialChunk::_sfBackMaterial field.
const bool & getBackMaterial (void) const
 Get the value of the MaterialChunk::_sfBackMaterial field.
Color4fgetBackDiffuse (void)
 Get the value of the MaterialChunk::_sfBackDiffuse field.
const Color4fgetBackDiffuse (void) const
 Get the value of the MaterialChunk::_sfBackDiffuse field.
Color4fgetBackAmbient (void)
 Get the value of the MaterialChunk::_sfBackAmbient field.
const Color4fgetBackAmbient (void) const
 Get the value of the MaterialChunk::_sfBackAmbient field.
Color4fgetBackSpecular (void)
 Get the value of the MaterialChunk::_sfBackSpecular field.
const Color4fgetBackSpecular (void) const
 Get the value of the MaterialChunk::_sfBackSpecular field.
Color4fgetBackEmission (void)
 Get the value of the MaterialChunk::_sfBackEmission field.
const Color4fgetBackEmission (void) const
 Get the value of the MaterialChunk::_sfBackEmission field.
Real32getBackShininess (void)
 Get the value of the MaterialChunk::_sfBackShininess field.
const Real32getBackShininess (void) const
 Get the value of the MaterialChunk::_sfBackShininess field.
GLenumgetBackColorMaterial (void)
 Get the value of the MaterialChunk::_sfBackColorMaterial field.
const GLenumgetBackColorMaterial (void) const
 Get the value of the MaterialChunk::_sfBackColorMaterial field.
Field Set
*void setDiffuse (const Color4f &value)
 Set the value of the MaterialChunk::_sfDiffuse field.
void setAmbient (const Color4f &value)
 Set the value of the MaterialChunk::_sfAmbient field.
void setSpecular (const Color4f &value)
 Set the value of the MaterialChunk::_sfSpecular field.
void setEmission (const Color4f &value)
 Set the value of the MaterialChunk::_sfEmission field.
void setShininess (const Real32 &value)
 Set the value of the MaterialChunk::_sfShininess field.
void setLit (const bool &value)
 Set the value of the MaterialChunk::_sfLit field.
void setColorMaterial (const GLenum &value)
 Set the value of the MaterialChunk::_sfColorMaterial field.
void setBackMaterial (const bool &value)
 Set the value of the MaterialChunk::_sfBackMaterial field.
void setBackDiffuse (const Color4f &value)
 Set the value of the MaterialChunk::_sfBackDiffuse field.
void setBackAmbient (const Color4f &value)
 Set the value of the MaterialChunk::_sfBackAmbient field.
void setBackSpecular (const Color4f &value)
 Set the value of the MaterialChunk::_sfBackSpecular field.
void setBackEmission (const Color4f &value)
 Set the value of the MaterialChunk::_sfBackEmission field.
void setBackShininess (const Real32 &value)
 Set the value of the MaterialChunk::_sfBackShininess field.
void setBackColorMaterial (const GLenum &value)
 Set the value of the MaterialChunk::_sfBackColorMaterial 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
Chunk Class Access
*UInt32 getClassId (void) const
virtual const StateChunkClassgetClass (void) const
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
State
*virtual void activate (DrawActionBase *action, UInt32 index=0)
virtual void changeFrom (DrawActionBase *action, StateChunk *old, UInt32 index=0)
virtual void deactivate (DrawActionBase *action, UInt32 index=0)
virtual bool isTransparent (void) const
Comparison
*virtual Real32 switchCost (StateChunk *chunk)
virtual bool operator< (const StateChunk &other) const
virtual bool operator== (const StateChunk &other) const
virtual bool operator!= (const StateChunk &other) const
Parents
*MFFieldContainerPtrgetParents (void)
const MFFieldContainerPtrgetParents (void) const
MFFieldContainerPtrgetMFParents (void)
void addParent (FieldContainerPtr parent)
void subParent (FieldContainerPtr parent)
Int32 findParent (FieldContainerPtr parent)
Parents
*SFBoolgetInternal (void)
const SFBoolgetInternal (void) const
SFBoolgetSFInternal (void)
void setInternal (bool bVal)
Get Instance Type Information
UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const
Generic Field Access *FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)

Static Public Member Functions

Get Class Type Information
static UInt16 getClassGroupId (void)
Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static MaterialChunkPtr create (void)
 create a new instance of the class
static MaterialChunkPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Static Chunk Class Access
*static UInt32 getStaticClassId (void)
static const StateChunkClassgetStaticClass (void)
Get Class Type Information
static UInt16 getClassGroupId (void)

Static Public Attributes

static const osg::BitVector DiffuseFieldMask
static const osg::BitVector AmbientFieldMask
static const osg::BitVector SpecularFieldMask
static const osg::BitVector EmissionFieldMask
static const osg::BitVector ShininessFieldMask
static const osg::BitVector LitFieldMask
static const osg::BitVector ColorMaterialFieldMask
static const osg::BitVector BackMaterialFieldMask
static const osg::BitVector BackDiffuseFieldMask
static const osg::BitVector BackAmbientFieldMask
static const osg::BitVector BackSpecularFieldMask
static const osg::BitVector BackEmissionFieldMask
static const osg::BitVector BackShininessFieldMask
static const osg::BitVector BackColorMaterialFieldMask
static const osg::BitVector MTInfluenceMask
static const BitVector InternalFieldMask = (1 << Attachment::InternalFieldId)
static const BitVector ParentsFieldMask = (1 << Attachment::ParentsFieldId)
static const BitVector NextFieldMask
CoredNodePtr helper
static const bool isNodeCore = false

Protected Member Functions

Sync
void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
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)
Constructors
MaterialChunkBase (void)
 MaterialChunkBase (const MaterialChunkBase &source)
Destructors
*virtual ~MaterialChunkBase (void)
Sync
*void executeSyncImpl (MaterialChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (Attachment *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (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)

Static Protected Member Functions

static void initMethod (void)
Create Fieldcontainer
template<class ObjectPtrT>
*static void newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP)
template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result)
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

Member
*UInt32 _shares
Fields
*SFColor4f _sfDiffuse
SFColor4f _sfAmbient
SFColor4f _sfSpecular
SFColor4f _sfEmission
SFReal32 _sfShininess
SFBool _sfLit
SFGLenum _sfColorMaterial
SFBool _sfBackMaterial
SFColor4f _sfBackDiffuse
SFColor4f _sfBackAmbient
SFColor4f _sfBackSpecular
SFColor4f _sfBackEmission
SFReal32 _sfBackShininess
SFGLenum _sfBackColorMaterial
Fields
*SFBool _sfInternal
MFFieldContainerPtr _parents
Member
*UInt32 _shares

Private Types

typedef StateChunk Inherited

Private Member Functions

void operator= (const MaterialChunkBase &source)

Static Private Attributes

static FieldDescription_desc []
 MaterialChunk description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 94 of file OSGMaterialChunkBase.h.


Member Typedef Documentation

typedef StateChunk osg::MaterialChunkBase::Inherited [private]
 

Reimplemented from osg::StateChunk.

Reimplemented in osg::MaterialChunk.

Definition at line 98 of file OSGMaterialChunkBase.h.

typedef MaterialChunkPtr osg::MaterialChunkBase::Ptr
 

Reimplemented from osg::StateChunkBase.

Definition at line 103 of file OSGMaterialChunkBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
DiffuseFieldId 
AmbientFieldId 
SpecularFieldId 
EmissionFieldId 
ShininessFieldId 
LitFieldId 
ColorMaterialFieldId 
BackMaterialFieldId 
BackDiffuseFieldId 
BackAmbientFieldId 
BackSpecularFieldId 
BackEmissionFieldId 
BackShininessFieldId 
BackColorMaterialFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 105 of file OSGMaterialChunkBase.h.

00106     {
00107         DiffuseFieldId           = Inherited::NextFieldId,
00108         AmbientFieldId           = DiffuseFieldId           + 1,
00109         SpecularFieldId          = AmbientFieldId           + 1,
00110         EmissionFieldId          = SpecularFieldId          + 1,
00111         ShininessFieldId         = EmissionFieldId          + 1,
00112         LitFieldId               = ShininessFieldId         + 1,
00113         ColorMaterialFieldId     = LitFieldId               + 1,
00114         BackMaterialFieldId      = ColorMaterialFieldId     + 1,
00115         BackDiffuseFieldId       = BackMaterialFieldId      + 1,
00116         BackAmbientFieldId       = BackDiffuseFieldId       + 1,
00117         BackSpecularFieldId      = BackAmbientFieldId       + 1,
00118         BackEmissionFieldId      = BackSpecularFieldId      + 1,
00119         BackShininessFieldId     = BackEmissionFieldId      + 1,
00120         BackColorMaterialFieldId = BackShininessFieldId     + 1,
00121         NextFieldId              = BackColorMaterialFieldId + 1
00122     };


Constructor & Destructor Documentation

MaterialChunkBase::MaterialChunkBase void   )  [protected]
 

Definition at line 309 of file OSGMaterialChunkBase.cpp.

00309                                          :
00310     _sfDiffuse                (Color4f(1,1,1,1)), 
00311     _sfAmbient                (Color4f(.2,.2,.2,1)), 
00312     _sfSpecular               (Color4f(.5,.5,.5,1)), 
00313     _sfEmission               (Color4f(0,0,0,1)), 
00314     _sfShininess              (Real32(10)), 
00315     _sfLit                    (bool(true)), 
00316     _sfColorMaterial          (GLenum(GL_DIFFUSE)), 
00317     _sfBackMaterial           (bool(false)), 
00318     _sfBackDiffuse            (Color4f(1,1,1,0)), 
00319     _sfBackAmbient            (Color4f(.2,.2,.2,0)), 
00320     _sfBackSpecular           (Color4f(.5,.5,.5,0)), 
00321     _sfBackEmission           (Color4f(0,0,0,0)), 
00322     _sfBackShininess          (Real32(10)), 
00323     _sfBackColorMaterial      (GLenum(GL_DIFFUSE)), 
00324     Inherited() 
00325 {
00326 }

MaterialChunkBase::MaterialChunkBase const MaterialChunkBase source  )  [protected]
 

Definition at line 332 of file OSGMaterialChunkBase.cpp.

00332                                                                     :
00333     _sfDiffuse                (source._sfDiffuse                ), 
00334     _sfAmbient                (source._sfAmbient                ), 
00335     _sfSpecular               (source._sfSpecular               ), 
00336     _sfEmission               (source._sfEmission               ), 
00337     _sfShininess              (source._sfShininess              ), 
00338     _sfLit                    (source._sfLit                    ), 
00339     _sfColorMaterial          (source._sfColorMaterial          ), 
00340     _sfBackMaterial           (source._sfBackMaterial           ), 
00341     _sfBackDiffuse            (source._sfBackDiffuse            ), 
00342     _sfBackAmbient            (source._sfBackAmbient            ), 
00343     _sfBackSpecular           (source._sfBackSpecular           ), 
00344     _sfBackEmission           (source._sfBackEmission           ), 
00345     _sfBackShininess          (source._sfBackShininess          ), 
00346     _sfBackColorMaterial      (source._sfBackColorMaterial      ), 
00347     Inherited                 (source)
00348 {
00349 }

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

Definition at line 353 of file OSGMaterialChunkBase.cpp.

00354 {
00355 }


Member Function Documentation

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

Reimplemented from osg::StateChunkBase.

Definition at line 58 of file OSGMaterialChunkBase.inl.

References _type.

Referenced by create(), and modifyMaterial().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 65 of file OSGMaterialChunkBase.inl.

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

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

FieldContainerType & MaterialChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 251 of file OSGMaterialChunkBase.cpp.

References _type.

00252 {
00253     return _type; 
00254 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 256 of file OSGMaterialChunkBase.cpp.

References _type.

00257 {
00258     return _type;
00259 } 

UInt32 MaterialChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 271 of file OSGMaterialChunkBase.cpp.

00272 { 
00273     return sizeof(MaterialChunk); 
00274 }

SFColor4f * osg::MaterialChunkBase::getSFDiffuse void   )  [inline]
 

Definition at line 101 of file OSGMaterialChunkBase.inl.

References _sfDiffuse.

00102 {
00103     return &_sfDiffuse;
00104 }

SFColor4f * osg::MaterialChunkBase::getSFAmbient void   )  [inline]
 

Definition at line 108 of file OSGMaterialChunkBase.inl.

References _sfAmbient.

00109 {
00110     return &_sfAmbient;
00111 }

SFColor4f * osg::MaterialChunkBase::getSFSpecular void   )  [inline]
 

Definition at line 115 of file OSGMaterialChunkBase.inl.

References _sfSpecular.

00116 {
00117     return &_sfSpecular;
00118 }

SFColor4f * osg::MaterialChunkBase::getSFEmission void   )  [inline]
 

Definition at line 122 of file OSGMaterialChunkBase.inl.

References _sfEmission.

00123 {
00124     return &_sfEmission;
00125 }

SFReal32 * osg::MaterialChunkBase::getSFShininess void   )  [inline]
 

Definition at line 129 of file OSGMaterialChunkBase.inl.

References _sfShininess.

00130 {
00131     return &_sfShininess;
00132 }

SFBool * osg::MaterialChunkBase::getSFLit void   )  [inline]
 

Definition at line 136 of file OSGMaterialChunkBase.inl.

References _sfLit.

00137 {
00138     return &_sfLit;
00139 }

SFGLenum * osg::MaterialChunkBase::getSFColorMaterial void   )  [inline]
 

Definition at line 143 of file OSGMaterialChunkBase.inl.

References _sfColorMaterial.

00144 {
00145     return &_sfColorMaterial;
00146 }

SFBool * osg::MaterialChunkBase::getSFBackMaterial void   )  [inline]
 

Definition at line 150 of file OSGMaterialChunkBase.inl.

References _sfBackMaterial.

00151 {
00152     return &_sfBackMaterial;
00153 }

SFColor4f * osg::MaterialChunkBase::getSFBackDiffuse void   )  [inline]
 

Definition at line 157 of file OSGMaterialChunkBase.inl.

References _sfBackDiffuse.

00158 {
00159     return &_sfBackDiffuse;
00160 }

SFColor4f * osg::MaterialChunkBase::getSFBackAmbient void   )  [inline]
 

Definition at line 164 of file OSGMaterialChunkBase.inl.

References _sfBackAmbient.

00165 {
00166     return &_sfBackAmbient;
00167 }

SFColor4f * osg::MaterialChunkBase::getSFBackSpecular void   )  [inline]
 

Definition at line 171 of file OSGMaterialChunkBase.inl.

References _sfBackSpecular.

00172 {
00173     return &_sfBackSpecular;
00174 }

SFColor4f * osg::MaterialChunkBase::getSFBackEmission void   )  [inline]
 

Definition at line 178 of file OSGMaterialChunkBase.inl.

References _sfBackEmission.

00179 {
00180     return &_sfBackEmission;
00181 }