#include <OSGSimpleMaterial.h>
Inheritance diagram for osg::SimpleMaterial:

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 | |
Sync | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Rendering | |
| *virtual StatePtr | makeState (void) |
| virtual void | rebuildState (void) |
| virtual bool | isTransparent (void) const |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *SFColor3f * | getSFAmbient (void) |
| Get the SimpleMaterial::_sfAmbient field. | |
| SFColor3f * | getSFDiffuse (void) |
| Get the SimpleMaterial::_sfDiffuse field. | |
| SFColor3f * | getSFSpecular (void) |
| Get the SimpleMaterial::_sfSpecular field. | |
| SFReal32 * | getSFShininess (void) |
| Get the SimpleMaterial::_sfShininess field. | |
| SFColor3f * | getSFEmission (void) |
| Get the SimpleMaterial::_sfEmission field. | |
| SFReal32 * | getSFTransparency (void) |
| Get the SimpleMaterial::_sfTransparency field. | |
| SFBool * | getSFLit (void) |
| Get the SimpleMaterial::_sfLit field. | |
| SFGLenum * | getSFColorMaterial (void) |
| Get the SimpleMaterial::_sfColorMaterial field. | |
| Color3f & | getAmbient (void) |
| Get the value of the SimpleMaterial::_sfAmbient field. | |
| const Color3f & | getAmbient (void) const |
| Get the value of the SimpleMaterial::_sfAmbient field. | |
| Color3f & | getDiffuse (void) |
| Get the value of the SimpleMaterial::_sfDiffuse field. | |
| const Color3f & | getDiffuse (void) const |
| Get the value of the SimpleMaterial::_sfDiffuse field. | |
| Color3f & | getSpecular (void) |
| Get the value of the SimpleMaterial::_sfSpecular field. | |
| const Color3f & | getSpecular (void) const |
| Get the value of the SimpleMaterial::_sfSpecular field. | |
| Real32 & | getShininess (void) |
| Get the value of the SimpleMaterial::_sfShininess field. | |
| const Real32 & | getShininess (void) const |
| Get the value of the SimpleMaterial::_sfShininess field. | |
| Color3f & | getEmission (void) |
| Get the value of the SimpleMaterial::_sfEmission field. | |
| const Color3f & | getEmission (void) const |
| Get the value of the SimpleMaterial::_sfEmission field. | |
| Real32 & | getTransparency (void) |
| Get the value of the SimpleMaterial::_sfTransparency field. | |
| const Real32 & | getTransparency (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. | |
| GLenum & | getColorMaterial (void) |
| Get the value of the SimpleMaterial::_sfColorMaterial field. | |
| const GLenum & | getColorMaterial (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 |
Rendering | |
| *virtual void | draw (DrawFunctor &func, DrawActionBase *action) |
| virtual void | draw (Geometry *geo, DrawActionBase *action) |
Access | |
| *bool | addChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace) |
| bool | subChunk (StateChunkPtr chunk, Int32 slot=State::AutoSlotReplace) |
| Int32 | find (StateChunkPtr chunk) |
| StateChunkPtr | find (const FieldContainerType &type, Int32 slot=State::AutoSlotReplace) |
| virtual bool | operator== (const Material &other) |
Comparison | |
| virtual bool | operator== (const Material &other) const |
| *virtual bool | operator< (const Material &other) const |
| virtual bool | operator!= (const Material &other) const |
Field Get | |
| *MFStateChunkPtr * | getMFChunks (void) |
| Get the ChunkMaterial::_mfChunks field. | |
| MFInt32 * | getMFSlots (void) |
| Get the ChunkMaterial::_mfSlots field. | |
| StateChunkPtr & | getChunks (const UInt32 index) |
| Get the value of the index element the ChunkMaterial::_mfChunks field. | |
| MFStateChunkPtr & | getChunks (void) |
| Get the ChunkMaterial::_mfChunks field. | |
| const MFStateChunkPtr & | getChunks (void) const |
| Get the ChunkMaterial::_mfChunks field. | |
| Int32 & | getSlots (const UInt32 index) |
| Get the value of the index element the ChunkMaterial::_mfSlots field. | |
| MFInt32 & | getSlots (void) |
| Get the ChunkMaterial::_mfSlots field. | |
| const MFInt32 & | getSlots (void) const |
| Get the ChunkMaterial::_mfSlots field. | |
Field Get | |
| *SFInt32 * | getSFSortKey (void) |
| Get the Material::_sfSortKey field. | |
| Int32 & | getSortKey (void) |
| Get the value of the Material::_sfSortKey field. | |
| const Int32 & | getSortKey (void) const |
| Get the value of the Material::_sfSortKey field. | |
Field Set | |
| *void | setSortKey (const Int32 &value) |
| Set the value of the Material::_sfSortKey field. | |
Static Public Member Functions | |
Class Get | |
| *static const char * | getClassname (void) |
Class Get | |
| *static FieldContainerType & | getClassType (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 | |
Static Public Attributes | |
| static const osg::BitVector | AmbientFieldMask |
| static const osg::BitVector | DiffuseFieldMask |
| static const osg::BitVector | SpecularFieldMask |
| static const osg::BitVector | ShininessFieldMask |
| static const osg::BitVector | EmissionFieldMask |
| static const osg::BitVector | TransparencyFieldMask |
| static const osg::BitVector | LitFieldMask |
| static const osg::BitVector | ColorMaterialFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | ChunksFieldMask |
| static const osg::BitVector | SlotsFieldMask |
| static const osg::BitVector | SortKeyFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Constants | |
| *static const Int32 | NoStateSorting = 0x7fffffff |
Protected Member Functions | |
Constructors | |
| * | SimpleMaterial (void) |
| SimpleMaterial (const SimpleMaterial &source) | |
Destructors | |
| *virtual | ~SimpleMaterial (void) |
Helper | |
| *void | prepareLocalChunks (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) |
Protected Attributes | |
| StatePtr | _pState |
Fields | |
| *SFColor3f | _sfAmbient |
| SFColor3f | _sfDiffuse |
| SFColor3f | _sfSpecular |
| SFReal32 | _sfShininess |
| SFColor3f | _sfEmission |
| SFReal32 | _sfTransparency |
| SFBool | _sfLit |
| SFGLenum | _sfColorMaterial |
Fields | |
| *MFStateChunkPtr | _mfChunks |
| MFInt32 | _mfSlots |
Fields | |
| *SFInt32 | _sfSortKey |
Private Types | |
| typedef SimpleMaterialBase | Inherited |
Private Member Functions | |
| void | operator= (const SimpleMaterial &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
Private Attributes | |
| MaterialChunkPtr | _materialChunk |
| BlendChunkPtr | _blendChunk |
Friends | |
| class | FieldContainer |
| class | SimpleMaterialBase |
This material wraps the standard calls to glMaterial() in osg::SimpleMaterial::_sfAmbient, osg::SimpleMaterial::_sfDiffuse, osg::SimpleMaterial::_sfEmission, osg::SimpleMaterial::_sfSpecular, osg::SimpleMaterial::_sfShininess. In addition it supports transparency (osg::SimpleMaterial::_sfTransparency), can switch lighting (osg::SimpleMaterial::_sfLit) and the color material (osg::SimpleMaterial::_sfColorMaterial).
Definition at line 57 of file OSGSimpleMaterial.h.
|
|
Reimplemented from osg::SimpleMaterialBase. Reimplemented in osg::SimpleTexturedMaterial, and osg::SimpleTexturedMaterialBase. Definition at line 126 of file OSGSimpleMaterial.h. |
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 97 of file OSGSimpleMaterialBase.h. |
|
|
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 };
|
|
|
Definition at line 137 of file OSGSimpleMaterial.cpp. 00137 : 00138 Inherited(), 00139 _materialChunk(NullFC), 00140 _blendChunk (NullFC) 00141 { 00142 }
|
|
|
Definition at line 144 of file OSGSimpleMaterial.cpp. 00144 : 00145 Inherited (source ), 00146 _materialChunk(source._materialChunk), 00147 _blendChunk (source._blendChunk ) 00148 { 00149 }
|
|
|
Definition at line 151 of file OSGSimpleMaterial.cpp. References _blendChunk, _materialChunk, and osg::subRefCP(). 00152 { 00153 subRefCP(_materialChunk); 00154 subRefCP(_blendChunk ); 00155 }
|
|
|
Reimplemented from osg::ChunkMaterial. Definition at line 66 of file OSGSimpleMaterial.h.
|
|
||||||||||||
|
Reimplemented from osg::ChunkMaterial. Reimplemented in osg::SimpleTexturedMaterial. Definition at line 157 of file OSGSimpleMaterial.cpp. References osg::ChunkMaterial::changed(). Referenced by osg::SimpleTexturedMaterial::changed(). 00158 { 00159 Inherited::changed(whichField, origin); 00160 }
|
|
||||||||||||
|
Reimplemented from osg::ChunkMaterial. Reimplemented in osg::SimpleTexturedMaterial. Definition at line 287 of file OSGSimpleMaterial.cpp. References osg::ChunkMaterialBase::_mfChunks, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::FieldContainerPtrBase::dump(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::SimpleMaterialBase::getAmbient(), osg::SimpleMaterialBase::getDiffuse(), osg::SimpleMaterialBase::getEmission(), osg::SimpleMaterialBase::getLit(), osg::SimpleMaterialBase::getShininess(), osg::SimpleMaterialBase::getSpecular(), osg::SimpleMaterialBase::getTransparency(), osg::indentLog(), PLOG, and osg::FCDumpFlags::RefCount. 00289 { 00290 00291 SimpleMaterialPtr thisP(*this); 00292 00293 thisP.dump(uiIndent, FCDumpFlags::RefCount); 00294 00295 indentLog(uiIndent, PLOG); 00296 PLOG << "SimpleMaterial at " << this << std::endl; 00297 00298 indentLog(uiIndent, PLOG); 00299 PLOG << "\tambient: " << getAmbient() << std::endl; 00300 00301 indentLog(uiIndent, PLOG); 00302 PLOG << "\tdiffuse: " << getDiffuse() << std::endl; 00303 00304 indentLog(uiIndent, PLOG); 00305 PLOG << "\tspecular: " << getSpecular() << std::endl; 00306 00307 indentLog(uiIndent, PLOG); 00308 PLOG << "\tshininess: " << getShininess() << std::endl; 00309 00310 indentLog(uiIndent, PLOG); 00311 PLOG << "\temission: " << getEmission() << std::endl; 00312 00313 indentLog(uiIndent, PLOG); 00314 PLOG << "\ttransparency: " << getTransparency() << std::endl; 00315 00316 indentLog(uiIndent, PLOG); 00317 PLOG << "\tlit: " << getLit() << std::endl; 00318 00319 indentLog(uiIndent, PLOG); 00320 PLOG << "\tChunks: " << std::endl; 00321 00322 for(MFStateChunkPtr::const_iterator i = _mfChunks.begin(); 00323 i != _mfChunks.end(); i++) 00324 { 00325 indentLog(uiIndent, PLOG); 00326 PLOG << "\t" << *i << std::endl; 00327 } 00328 00329 indentLog(uiIndent, PLOG); 00330 PLOG << "SimpleMaterial end " << this << std::endl; 00331 }
|
|
|
|
|
Check if the Material (i.e. any of its chunks) is transparent.. Reimplemented from osg::ChunkMaterial. Reimplemented in osg::SimpleTexturedMaterial. Definition at line 280 of file OSGSimpleMaterial.cpp. References osg::Eps, osg::SimpleMaterialBase::getTransparency(), and osg::ChunkMaterial::isTransparent(). Referenced by osg::SimpleTexturedMaterial::isTransparent(), makeState(), and rebuildState(). 00281 { 00282 return ((getTransparency() > Eps) || (Inherited::isTransparent())); 00283 }
|
|
|
Reimplemented in osg::SimpleTexturedMaterial. Definition at line 95 of file OSGSimpleMaterial.cpp. References _blendChunk, _materialChunk, osg::addRefCP(), osg::beginEditCP(), osg::BlendChunkBase::create(), osg::MaterialChunkBase::create(), osg::endEditCP(), and osg::NullFC. Referenced by makeState(), and rebuildState(). 00096 { 00097 if(_materialChunk == NullFC) 00098 { 00099 _materialChunk = MaterialChunk::create(); 00100 00101 addRefCP(_materialChunk); 00102 } 00103 00104 if(_blendChunk == NullFC) 00105 { 00106 _blendChunk = BlendChunk ::create(); 00107 00108 beginEditCP(_blendChunk); 00109 { 00110 _blendChunk->setSrcFactor (GL_SRC_ALPHA); 00111 _blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA); 00112 } 00113 endEditCP (_blendChunk); 00114 00115 addRefCP (_blendChunk); 00116 } 00117 }
|
|
|
Reimplemented from osg::ChunkMaterial. Reimplemented in osg::SimpleTexturedMaterial. Definition at line 123 of file OSGSimpleMaterial.cpp.
|
|
|
|
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 58 of file OSGSimpleMaterialBase.inl. References osg::SimpleMaterialBase::_type. Referenced by osg::SimpleMaterialBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 65 of file OSGSimpleMaterialBase.inl. References osg::SimpleMaterialBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 184 of file OSGSimpleMaterialBase.cpp. References osg::SimpleMaterialBase::_type. 00185 { 00186 return _type; 00187 }
|
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 189 of file OSGSimpleMaterialBase.cpp. References osg::SimpleMaterialBase::_type. 00190 { 00191 return _type; 00192 }
|
|
|
Reimplemented from osg::ChunkMaterialBase. Reimplemented in osg::SimpleTexturedMaterialBase. Definition at line 204 of file OSGSimpleMaterialBase.cpp. 00205 { 00206 return sizeof(SimpleMaterial); 00207 }
|
|
|
Definition at line 101 of file OSGSimpleMaterialBase.inl. References osg::SimpleMaterialBase::_sfAmbient. 00102 { 00103 return &_sfAmbient; 00104 }
|
|