#include <OSGMultiPassMaterial.h>
Inheritance diagram for osg::MultiPassMaterial:

Rendering | |
| StatePtr | getState (void) |
| *typedef TypedFunctor1Base< Action::ResultE, PtrCallArg< DrawActionBase > > | DrawFunctor |
Public Types | |
| typedef MultiPassMaterialPtr | Ptr |
| enum | { MaterialsFieldId = Inherited::NextFieldId, NextFieldId = MaterialsFieldId + 1 } |
Public Member Functions | |
Comparison | |
| *virtual bool | operator< (const Material &other) const |
| virtual bool | operator== (const Material &other) const |
| virtual bool | operator!= (const Material &other) const |
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. | |
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 StatePtr | getState (UInt32 index) |
| virtual UInt32 | getNPasses (void) |
| virtual bool | isTransparent (void) const |
Access | |
| *void | addMaterial (MaterialPtr mat) |
| void | subMaterial (MaterialPtr mat) |
| bool | hasMaterial (MaterialPtr mat) |
FieldContainer Get | |
| *virtual FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (void) const |
| virtual UInt32 | getContainerSize (void) const |
Field Get | |
| *MFMaterialPtr * | getMFMaterials (void) |
| Get the MultiPassMaterial::_mfMaterials field. | |
| MaterialPtr & | getMaterials (const UInt32 index) |
| Get the value of the index element the MultiPassMaterial::_mfMaterials field. | |
| MFMaterialPtr & | getMaterials (void) |
| Get the MultiPassMaterial::_mfMaterials field. | |
| const MFMaterialPtr & | getMaterials (void) const |
| Get the MultiPassMaterial::_mfMaterials 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 |
Comparison | |
| *virtual bool | operator< (const Material &other) const |
| virtual bool | operator== (const Material &other) const |
| virtual bool | operator!= (const Material &other) const |
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 FieldContainerType & | getClassType (void) |
| access the type of the class | |
| static UInt32 | getClassTypeId (void) |
| access the numerical type of the class | |
Construction | |
| *static MultiPassMaterialPtr | create (void) |
| create a new instance of the class | |
| static MultiPassMaterialPtr | createEmpty (void) |
| create an empty new instance of the class, do not copy the prototype | |
Class Get | |
| *static const char * | getClassname (void) |
Static Public Attributes | |
| static const osg::BitVector | MaterialsFieldMask |
| static const osg::BitVector | MTInfluenceMask |
| static const osg::BitVector | SortKeyFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
Constants | |
| *static const Int32 | NoStateSorting = 0x7fffffff |
Constants | |
| *static const Int32 | NoStateSorting = 0x7fffffff |
Protected Member Functions | |
Sync | |
| *void | executeSyncImpl (MaterialBase *pOther, const BitVector &whichField) |
Constructors | |
| * | MultiPassMaterial (void) |
| MultiPassMaterial (const MultiPassMaterial &source) | |
Destructors | |
| *virtual | ~MultiPassMaterial (void) |
Sync | |
| *void | executeSyncImpl (MultiPassMaterialBase *pOther, const BitVector &whichField) |
| virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
Sync | |
| *void | executeSyncImpl (MaterialBase *pOther, const BitVector &whichField) |
Protected Attributes | |
| StatePtr | _pState |
Fields | |
| *SFInt32 | _sfSortKey |
Fields | |
| *MFMaterialPtr | _mfMaterials |
Fields | |
| *SFInt32 | _sfSortKey |
Private Types | |
| typedef MultiPassMaterialBase | Inherited |
Private Member Functions | |
| void | operator= (const MultiPassMaterial &source) |
Static Private Member Functions | |
| static void | initMethod (void) |
Friends | |
| class | FieldContainer |
| class | MultiPassMaterialBase |
Definition at line 55 of file OSGMultiPassMaterial.h.
|
|
Reimplemented from osg::MultiPassMaterialBase. Definition at line 59 of file OSGMultiPassMaterial.h. |
|
|
Reimplemented from osg::MaterialBase. Definition at line 90 of file OSGMultiPassMaterialBase.h. |
|
|
Reimplemented from osg::MaterialBase. Definition at line 92 of file OSGMultiPassMaterialBase.h. 00093 { 00094 MaterialsFieldId = Inherited::NextFieldId, 00095 NextFieldId = MaterialsFieldId + 1 00096 };
|
|
|
Definition at line 83 of file OSGMultiPassMaterial.cpp. 00083 : 00084 Inherited() 00085 { 00086 }
|
|
|
Definition at line 88 of file OSGMultiPassMaterial.cpp. 00088 : 00089 Inherited(source) 00090 { 00091 }
|
|
|
Definition at line 93 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::end(), and osg::subRefCP(). 00094 { 00095 MFMaterialPtr::iterator matIt = _mfMaterials.begin(); 00096 MFMaterialPtr::iterator matEnd = _mfMaterials.end (); 00097 00098 while(matIt != matEnd) 00099 { 00100 subRefCP(*matIt); 00101 00102 ++matIt; 00103 } 00104 }
|
|
||||||||||||
|
Reimplemented from osg::Material. Definition at line 108 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::ChangedOrigin::Abstract, osg::addRefCP(), osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::Material::changed(), and osg::MField< FieldTypeT, fieldNameSpace >::end(). 00109 { 00110 if(origin & ChangedOrigin::Abstract) 00111 { 00112 MFMaterialPtr::iterator matIt = _mfMaterials.begin(); 00113 MFMaterialPtr::iterator matEnd = _mfMaterials.end (); 00114 00115 while(matIt != matEnd) 00116 { 00117 addRefCP(*matIt); 00118 00119 ++matIt; 00120 } 00121 } 00122 00123 Inherited::changed(whichField, origin); 00124 }
|
|
||||||||||||
|
Reimplemented from osg::Material. Definition at line 244 of file OSGMultiPassMaterial.cpp. References SLOG. 00246 { 00247 SLOG << "Dump MultiPassMaterial NI" << std::endl; 00248 }
|
|
||||||||||||
|
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 182 of file OSGMultiPassMaterial.cpp.
|
|
||||||||||||
|
Draw the geometry with this material. Implements osg::Material. Definition at line 173 of file OSGMultiPassMaterial.cpp.
|
|
|
Create a osg::State that represents this Material and return it. Implements osg::Material. Definition at line 189 of file OSGMultiPassMaterial.cpp. References osg::NullFC. 00190 { 00191 return NullFC; 00192 }
|
|
|
Rebuild the internal State. Just collects the chunks in the State. Implements osg::Material. Definition at line 197 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00198 { 00199 for(UInt32 i = 0; i < _mfMaterials.size(); ++i) 00200 { 00201 if(_mfMaterials[i] != NullFC) 00202 _mfMaterials[i]->rebuildState(); 00203 } 00204 }
|
|
|
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. Definition at line 206 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING. Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry(). 00207 { 00208 if(index >= _mfMaterials.size()) 00209 { 00210 SWARNING << "MultiPassMaterial::getState: index out of range!" << std::endl; 00211 return NullFC; 00212 } 00213 00214 if(_mfMaterials[index] != NullFC) 00215 return _mfMaterials[index]->getState(); 00216 00217 return NullFC; 00218 }
|
|
|
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. Definition at line 220 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, and osg::MField< FieldTypeT, fieldNameSpace >::size(). Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry(). 00221 { 00222 return _mfMaterials.size(); 00223 }
|
|
|
Check if the Material (i.e. any of its materials) is transparent.. Implements osg::Material. Definition at line 227 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::end(), and osg::NullFC. 00228 { 00229 MFMaterialPtr::const_iterator it = _mfMaterials.begin(); 00230 MFMaterialPtr::const_iterator matsEnd = _mfMaterials.end(); 00231 00232 for(; it != matsEnd; ++it) 00233 { 00234 if((*it) == NullFC) 00235 return false; 00236 00237 if(!(*it)->isTransparent()) 00238 return false; 00239 } 00240 00241 return true; 00242 }
|
|
|
Definition at line 126 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::addRefCP(), osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::push_back(). 00127 { 00128 if(mat == NullFC) 00129 return; 00130 00131 _mfMaterials.push_back(mat); 00132 addRefCP(mat); 00133 }
|
|
|
Definition at line 135 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), osg::NullFC, osg::MField< FieldTypeT, fieldNameSpace >::size(), osg::subRefCP(), and SWARNING. 00136 { 00137 if(mat == NullFC) 00138 return; 00139 00140 UInt32 i; 00141 00142 for(i = 0; i < _mfMaterials.size(); ++i) 00143 { 00144 if(_mfMaterials[i] == mat) 00145 { 00146 subRefCP(mat); 00147 _mfMaterials.erase(_mfMaterials.begin() + i); 00148 return; 00149 } 00150 } 00151 00152 SWARNING << "MultiPassMaterial::subMaterial(" << this << ") has no material " 00153 << mat << std::endl; 00154 }
|
|
|
Definition at line 156 of file OSGMultiPassMaterial.cpp. References osg::MultiPassMaterialBase::_mfMaterials, and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00157 { 00158 UInt32 i; 00159 00160 for(i = 0; i < _mfMaterials.size(); ++i) 00161 { 00162 if(_mfMaterials[i] == mat) 00163 return true; 00164 } 00165 00166 return false; 00167 }
|
|
|
Reimplemented from osg::Material. Definition at line 68 of file OSGMultiPassMaterial.cpp.
|
|
|
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 58 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_type. Referenced by osg::MultiPassMaterialBase::create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 65 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 106 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_type. 00107 { 00108 return _type; 00109 }
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 111 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_type. 00112 { 00113 return _type; 00114 }
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 126 of file OSGMultiPassMaterialBase.cpp. 00127 { 00128 return sizeof(MultiPassMaterial); 00129 }
|
|
|
Definition at line 101 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_mfMaterials. 00102 { 00103 return &_mfMaterials; 00104 }
|
|
|
Definition at line 110 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_mfMaterials. 00111 { 00112 return _mfMaterials[index]; 00113 }
|
|
|
Definition at line 117 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_mfMaterials. 00118 { 00119 return _mfMaterials; 00120 }
|
|
|
Definition at line 124 of file OSGMultiPassMaterialBase.inl. References osg::MultiPassMaterialBase::_mfMaterials. 00125 { 00126 return _mfMaterials; 00127 }
|
|
|
Reimplemented from osg::MaterialBase. Definition at line 189 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::MaterialBase::getBinSize(), osg::MultiPassMaterialBase::MaterialsFieldMask, and osg::FieldBits::NoField. 00190 { 00191 UInt32 returnValue = Inherited::getBinSize(whichField); 00192 00193 if(FieldBits::NoField != (MaterialsFieldMask & whichField)) 00194 { 00195 returnValue += _mfMaterials.getBinSize(); 00196 } 00197 00198 00199 return returnValue; 00200 }
|
|
||||||||||||
|
Reimplemented from osg::MaterialBase. Definition at line 202 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::MaterialBase::copyToBin(), osg::MultiPassMaterialBase::MaterialsFieldMask, and osg::FieldBits::NoField. 00204 { 00205 Inherited::copyToBin(pMem, whichField); 00206 00207 if(FieldBits::NoField != (MaterialsFieldMask & whichField)) 00208 { 00209 _mfMaterials.copyToBin(pMem); 00210 } 00211 00212 00213 }
|
|
||||||||||||
|
Reimplemented from osg::MaterialBase. Definition at line 215 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::MaterialBase::copyFromBin(), osg::MultiPassMaterialBase::MaterialsFieldMask, and osg::FieldBits::NoField. 00217 { 00218 Inherited::copyFromBin(pMem, whichField); 00219 00220 if(FieldBits::NoField != (MaterialsFieldMask & whichField)) 00221 { 00222 _mfMaterials.copyFromBin(pMem); 00223 } 00224 00225 00226 }
|
|
|
Definition at line 72 of file OSGMultiPassMaterialBase.inl. References osg::AttachmentContainerPtr::dcast(), osg::MultiPassMaterialBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::MultiPassMaterialBase::shallowCopy(). 00073 { 00074 MultiPassMaterialPtr fc; 00075 00076 if(getClassType().getPrototype() != OSG::NullFC) 00077 { 00078 fc = MultiPassMaterialPtr::dcast( 00079 getClassType().getPrototype()-> shallowCopy()); 00080 } 00081 00082 return fc; 00083 }
|
|
|
Definition at line 87 of file OSGMultiPassMaterialBase.inl. References osg::FieldContainer::newPtr(). 00088 { 00089 MultiPassMaterialPtr returnValue; 00090 00091 newPtr(returnValue); 00092 00093 return returnValue; 00094 }
|
|
|
Implements osg::FieldContainer. Definition at line 117 of file OSGMultiPassMaterialBase.cpp. References osg::FieldContainer::newPtr(). Referenced by osg::MultiPassMaterialBase::create(). 00118 { 00119 MultiPassMaterialPtr returnValue; 00120 00121 newPtr(returnValue, dynamic_cast<const MultiPassMaterial *>(this)); 00122 00123 return returnValue; 00124 }
|
|
||||||||||||
|
Definition at line 229 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::_mfMaterials, osg::MaterialBase::executeSyncImpl(), osg::MultiPassMaterialBase::MaterialsFieldMask, osg::FieldBits::NoField, and osg::MField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::MultiPassMaterialBase::executeSync(). 00231 { 00232 00233 Inherited::executeSyncImpl(pOther, whichField); 00234 00235 if(FieldBits::NoField != (MaterialsFieldMask & whichField)) 00236 _mfMaterials.syncWith(pOther->_mfMaterials); 00237 00238 00239 }
|
|
||||||||||||
|
Definition at line 219 of file OSGMaterialBase.cpp. References osg::MaterialBase::_sfSortKey, osg::AttachmentContainer::executeSyncImpl(), osg::FieldBits::NoField, osg::MaterialBase::SortKeyFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith(). Referenced by osg::MaterialBase::executeSync(), osg::MultiPassMaterialBase::executeSyncImpl(), and osg::ChunkMaterialBase::executeSyncImpl(). 00221 { 00222 00223 Inherited::executeSyncImpl(pOther, whichField); 00224 00225 if(FieldBits::NoField != (SortKeyFieldMask & whichField)) 00226 _sfSortKey.syncWith(pOther->_sfSortKey); 00227 00228 00229 }
|
|
||||||||||||
|
||||||||||||
|
Definition at line 333 of file OSGFieldContainerImpl.inl. Referenced by osg::StateBase::executeSyncImpl(), osg::DVRShaderBase::executeSyncImpl(), osg::DVRClipGeometryBase::executeSyncImpl(), osg::AttachmentContainer::executeSyncImpl(), and osg::Attachment::executeSyncImpl().
|
|
||||||||||||
|
Reimplemented from osg::MaterialBase. Definition at line 133 of file OSGMultiPassMaterialBase.cpp. References osg::MultiPassMaterialBase::executeSyncImpl(). 00135 { 00136 this->executeSyncImpl((MultiPassMaterialBase *) &other, whichField); 00137 }
|
|
|
Reimplemented in osg::ChunkMaterial, and osg::SimpleMaterial. Definition at line 71 of file OSGMaterial.h.
|
|
|
Access the internal osg::State, used by the osg::RenderAction. Definition at line 152 of file OSGMaterial.cpp. References osg::Material::_pState. Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry(). 00153 { 00154 return _pState; 00155 }
|
|