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

osg::SimpleMaterialBase Class Reference

SimpleMaterial Base Class.

#include <OSGSimpleMaterialBase.h>

Inheritance diagram for osg::SimpleMaterialBase:

osg::ChunkMaterial osg::ChunkMaterialBase osg::Material osg::MaterialBase osg::AttachmentContainer osg::FieldContainer osg::SimpleMaterial osg::SimpleTexturedMaterialBase osg::SimpleTexturedMaterial List of all members.

Rendering

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

Public Types

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

Public Member Functions

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)
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)
Field Access *SFAttachmentMapgetSFAttachments (void)
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)
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Rendering
*virtual void draw (DrawFunctor &func, DrawActionBase *action)
virtual void draw (Geometry *geo, DrawActionBase *action)
virtual StatePtr makeState (void)
virtual void rebuildState (void)
virtual bool isTransparent (void) const
Access
*bool addChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
bool subChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
Int32 find (StateChunkPtr chunk)
StateChunkPtr find (const FieldContainerType &type, Int32 slot=State::AutoSlotReplace)
virtual bool operator== (const Material &other)
Comparison
virtual bool operator== (const Material &other) const
*virtual bool operator< (const Material &other) const
virtual bool operator!= (const Material &other) const
Field Get
*MFStateChunkPtrgetMFChunks (void)
 Get the ChunkMaterial::_mfChunks field.
MFInt32getMFSlots (void)
 Get the ChunkMaterial::_mfSlots field.
StateChunkPtrgetChunks (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfChunks field.
MFStateChunkPtrgetChunks (void)
 Get the ChunkMaterial::_mfChunks field.
const MFStateChunkPtrgetChunks (void) const
 Get the ChunkMaterial::_mfChunks field.
Int32getSlots (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfSlots field.
MFInt32getSlots (void)
 Get the ChunkMaterial::_mfSlots field.
const MFInt32getSlots (void) const
 Get the ChunkMaterial::_mfSlots field.
Field Get
*SFInt32getSFSortKey (void)
 Get the Material::_sfSortKey field.
Int32getSortKey (void)
 Get the value of the Material::_sfSortKey field.
const Int32getSortKey (void) const
 Get the value of the Material::_sfSortKey field.
Field Set
*void setSortKey (const Int32 &value)
 Set the value of the Material::_sfSortKey field.
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)
Field Access *SFAttachmentMapgetSFAttachments (void)
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
*SFColor3fgetSFAmbient (void)
 Get the SimpleMaterial::_sfAmbient field.
SFColor3fgetSFDiffuse (void)
 Get the SimpleMaterial::_sfDiffuse field.
SFColor3fgetSFSpecular (void)
 Get the SimpleMaterial::_sfSpecular field.
SFReal32getSFShininess (void)
 Get the SimpleMaterial::_sfShininess field.
SFColor3fgetSFEmission (void)
 Get the SimpleMaterial::_sfEmission field.
SFReal32getSFTransparency (void)
 Get the SimpleMaterial::_sfTransparency field.
SFBoolgetSFLit (void)
 Get the SimpleMaterial::_sfLit field.
SFGLenumgetSFColorMaterial (void)
 Get the SimpleMaterial::_sfColorMaterial field.
Color3fgetAmbient (void)
 Get the value of the SimpleMaterial::_sfAmbient field.
const Color3fgetAmbient (void) const
 Get the value of the SimpleMaterial::_sfAmbient field.
Color3fgetDiffuse (void)
 Get the value of the SimpleMaterial::_sfDiffuse field.
const Color3fgetDiffuse (void) const
 Get the value of the SimpleMaterial::_sfDiffuse field.
Color3fgetSpecular (void)
 Get the value of the SimpleMaterial::_sfSpecular field.
const Color3fgetSpecular (void) const
 Get the value of the SimpleMaterial::_sfSpecular field.
Real32getShininess (void)
 Get the value of the SimpleMaterial::_sfShininess field.
const Real32getShininess (void) const
 Get the value of the SimpleMaterial::_sfShininess field.
Color3fgetEmission (void)
 Get the value of the SimpleMaterial::_sfEmission field.
const Color3fgetEmission (void) const
 Get the value of the SimpleMaterial::_sfEmission field.
Real32getTransparency (void)
 Get the value of the SimpleMaterial::_sfTransparency field.
const Real32getTransparency (void) const
 Get the value of the SimpleMaterial::_sfTransparency field.
bool & getLit (void)
 Get the value of the SimpleMaterial::_sfLit field.
const bool & getLit (void) const
 Get the value of the SimpleMaterial::_sfLit field.
GLenumgetColorMaterial (void)
 Get the value of the SimpleMaterial::_sfColorMaterial field.
const GLenumgetColorMaterial (void) const
 Get the value of the SimpleMaterial::_sfColorMaterial field.
Field Set
*void setAmbient (const Color3f &value)
 Set the value of the SimpleMaterial::_sfAmbient field.
void setDiffuse (const Color3f &value)
 Set the value of the SimpleMaterial::_sfDiffuse field.
void setSpecular (const Color3f &value)
 Set the value of the SimpleMaterial::_sfSpecular field.
void setShininess (const Real32 &value)
 Set the value of the SimpleMaterial::_sfShininess field.
void setEmission (const Color3f &value)
 Set the value of the SimpleMaterial::_sfEmission field.
void setTransparency (const Real32 &value)
 Set the value of the SimpleMaterial::_sfTransparency field.
void setLit (const bool &value)
 Set the value of the SimpleMaterial::_sfLit field.
void setColorMaterial (const GLenum &value)
 Set the value of the SimpleMaterial::_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
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Rendering
*virtual void draw (DrawFunctor &func, DrawActionBase *action)
virtual void draw (Geometry *geo, DrawActionBase *action)
virtual StatePtr makeState (void)
virtual void rebuildState (void)
virtual bool isTransparent (void) const
Access
*bool addChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
bool subChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace)
Int32 find (StateChunkPtr chunk)
StateChunkPtr find (const FieldContainerType &type, Int32 slot=State::AutoSlotReplace)
virtual bool operator== (const Material &other)
Comparison
virtual bool operator== (const Material &other) const
*virtual bool operator< (const Material &other) const
virtual bool operator!= (const Material &other) const
Field Get
*MFStateChunkPtrgetMFChunks (void)
 Get the ChunkMaterial::_mfChunks field.
MFInt32getMFSlots (void)
 Get the ChunkMaterial::_mfSlots field.
StateChunkPtrgetChunks (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfChunks field.
MFStateChunkPtrgetChunks (void)
 Get the ChunkMaterial::_mfChunks field.
const MFStateChunkPtrgetChunks (void) const
 Get the ChunkMaterial::_mfChunks field.
Int32getSlots (const UInt32 index)
 Get the value of the index element the ChunkMaterial::_mfSlots field.
MFInt32getSlots (void)
 Get the ChunkMaterial::_mfSlots field.
const MFInt32getSlots (void) const
 Get the ChunkMaterial::_mfSlots field.
Field Get
*SFInt32getSFSortKey (void)
 Get the Material::_sfSortKey field.
Int32getSortKey (void)
 Get the value of the Material::_sfSortKey field.
const Int32getSortKey (void) const
 Get the value of the Material::_sfSortKey field.
Field Set
*void setSortKey (const Int32 &value)
 Set the value of the Material::_sfSortKey field.
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)
Field Access *SFAttachmentMapgetSFAttachments (void)
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)
Get Class Type Information
static UInt16 getClassGroupId (void)
Class Get
*static const char * getClassname (void)
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 SimpleMaterialPtr create (void)
 create a new instance of the class
static SimpleMaterialPtr 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 BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper
static const bool isNodeCore = false
Constants
*static const Int32 NoStateSorting = 0x7fffffff
CoredNodePtr helper
static const bool isNodeCore = false
Constants
*static const Int32 NoStateSorting = 0x7fffffff
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)
Pointer
*AttachmentContainerPtr getPtr (void)
Sync
void executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField)
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)
Sync
*void executeSyncImpl (ChunkMaterialBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (MaterialBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
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)
Constructors
SimpleMaterialBase (void)
 SimpleMaterialBase (const SimpleMaterialBase &source)
Destructors
*virtual ~SimpleMaterialBase (void)
Sync
*void executeSyncImpl (SimpleMaterialBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (ChunkMaterialBase *pOther, const BitVector &whichField)
Sync
*void executeSyncImpl (MaterialBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
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)
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)
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
Member
*UInt32 _shares
Fields
*SFAttachmentMap _attachmentMap
Member
*UInt32 _shares
Fields
*MFStateChunkPtr _mfChunks
MFInt32 _mfSlots
Fields
*SFInt32 _sfSortKey
Fields
*SFAttachmentMap _attachmentMap
Member
*UInt32 _shares
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
Fields
*SFAttachmentMap _attachmentMap
Member
*UInt32 _shares

Private Types

typedef ChunkMaterial Inherited

Private Member Functions

void operator= (const SimpleMaterialBase &source)

Static Private Attributes

static FieldDescription_desc []
 SimpleMaterial description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 88 of file OSGSimpleMaterialBase.h.


Member Typedef Documentation

typedef ChunkMaterial osg::SimpleMaterialBase::Inherited [private]
 

Reimplemented from osg::ChunkMaterial.

Reimplemented in osg::SimpleMaterial, osg::SimpleTexturedMaterial, and osg::SimpleTexturedMaterialBase.

Definition at line 92 of file OSGSimpleMaterialBase.h.

typedef SimpleMaterialPtr osg::SimpleMaterialBase::Ptr
 

Reimplemented from osg::ChunkMaterialBase.

Reimplemented in osg::SimpleTexturedMaterialBase.

Definition at line 97 of file OSGSimpleMaterialBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
AmbientFieldId 
DiffuseFieldId 
SpecularFieldId 
ShininessFieldId 
EmissionFieldId 
TransparencyFieldId 
LitFieldId 
ColorMaterialFieldId 
NextFieldId 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 99 of file OSGSimpleMaterialBase.h.

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


Constructor & Destructor Documentation

SimpleMaterialBase::SimpleMaterialBase void   )  [protected]
 

Definition at line 242 of file OSGSimpleMaterialBase.cpp.

00242                                            :
00243     _sfAmbient                (Color3f(0,0,0)), 
00244     _sfDiffuse                (Color3f(0,0,0)), 
00245     _sfSpecular               (Color3f(0,0,0)), 
00246     _sfShininess              (Real32(1)), 
00247     _sfEmission               (Color3f(0,0,0)), 
00248     _sfTransparency           (Real32(0)), 
00249     _sfLit                    (bool(true)), 
00250     _sfColorMaterial          (GLenum(GL_DIFFUSE)), 
00251     Inherited() 
00252 {
00253 }

SimpleMaterialBase::SimpleMaterialBase const SimpleMaterialBase source  )  [protected]
 

Definition at line 259 of file OSGSimpleMaterialBase.cpp.

00259                                                                        :
00260     _sfAmbient                (source._sfAmbient                ), 
00261     _sfDiffuse                (source._sfDiffuse                ), 
00262     _sfSpecular               (source._sfSpecular               ), 
00263     _sfShininess              (source._sfShininess              ), 
00264     _sfEmission               (source._sfEmission               ), 
00265     _sfTransparency           (source._sfTransparency           ), 
00266     _sfLit                    (source._sfLit                    ), 
00267     _sfColorMaterial          (source._sfColorMaterial          ), 
00268     Inherited                 (source)
00269 {
00270 }

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

Definition at line 274 of file OSGSimpleMaterialBase.cpp.

00275 {
00276 }


Member Function Documentation

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

Reimplemented from osg::ChunkMaterialBase.

Reimplemented in osg::SimpleTexturedMaterialBase.

Definition at line 58 of file OSGSimpleMaterialBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::ChunkMaterialBase.

Reimplemented in osg::SimpleTexturedMaterialBase.

Definition at line 65 of file OSGSimpleMaterialBase.inl.

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

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