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

osg::DVRAppearance Class Reference

*put brief class description here* More...

#include <OSGDVRAppearance.h>

Inheritance diagram for osg::DVRAppearance:

osg::DVRAppearanceBase osg::ChunkMaterial osg::ChunkMaterialBase osg::Material osg::MaterialBase osg::AttachmentContainer osg::FieldContainer List of all members.

Rendering

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

Public Types

typedef DVRAppearancePtr Ptr
enum  { ChunksFieldId = Inherited::NextFieldId, SlotsFieldId = ChunksFieldId + 1, NextFieldId = SlotsFieldId + 1 }

Public Member Functions

Sync
*virtual void changed (BitVector whichField, UInt32 from)
 react to field changes
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
 output the instance for debug purposes
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
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)
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.

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 DVRAppearancePtr create (void)
 create a new instance of the class
static DVRAppearancePtr 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 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
DVRAppearance (void)
 Constructor.
 DVRAppearance (const DVRAppearance &source)
 Copy Constructor.
Destructors
*virtual ~DVRAppearance (void)
 Destructor.
Sync
*void executeSyncImpl (DVRAppearanceBase *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
*MFStateChunkPtr _mfChunks
MFInt32 _mfSlots
Fields
*SFInt32 _sfSortKey

Private Types

typedef DVRAppearanceBase Inherited

Private Member Functions

void operator= (const DVRAppearance &source)

Static Private Member Functions

static void initMethod (void)
 initialize the static features of the class, e.g. action callbacks

Friends

class FieldContainer
class DVRAppearanceBase

Detailed Description

Appearance used for the OpenSG direct volume rendering module. It represents the volume data to be rendered as long as some other visual parameters like transfer function or normal for shading.

Definition at line 54 of file OSGDVRAppearance.h.


Member Typedef Documentation

typedef DVRAppearanceBase osg::DVRAppearance::Inherited [private]
 

Reimplemented from osg::DVRAppearanceBase.

Definition at line 58 of file OSGDVRAppearance.h.

typedef DVRAppearancePtr osg::DVRAppearanceBase::Ptr [inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 89 of file OSGDVRAppearanceBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
ChunksFieldId 
SlotsFieldId 
NextFieldId 

Reimplemented from osg::MaterialBase.

Definition at line 93 of file OSGChunkMaterialBase.h.

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


Constructor & Destructor Documentation

DVRAppearance::DVRAppearance void   )  [protected]
 

Definition at line 62 of file OSGDVRAppearance.cpp.

00062                                  :
00063     Inherited()
00064 {
00065 }

DVRAppearance::DVRAppearance const DVRAppearance source  )  [protected]
 

Definition at line 68 of file OSGDVRAppearance.cpp.

00068                                                         :
00069     Inherited(source)
00070 {
00071 }

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

Definition at line 74 of file OSGDVRAppearance.cpp.

00075 {
00076 }


Member Function Documentation

void DVRAppearance::changed BitVector  whichField,
UInt32  from
[virtual]
 

Reimplemented from osg::ChunkMaterial.

Definition at line 86 of file OSGDVRAppearance.cpp.

References osg::ChunkMaterial::changed().

00087 { 
00088     Inherited::changed(whichField, origin);
00089 }

void DVRAppearance::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

Reimplemented from osg::ChunkMaterial.

Definition at line 92 of file OSGDVRAppearance.cpp.

References SLOG.

00094 {
00095     SLOG << "Dump DVRAppearance NI" << std::endl;
00096 }

void DVRAppearance::initMethod void   )  [static, private]
 

Reimplemented from osg::ChunkMaterial.

Definition at line 81 of file OSGDVRAppearance.cpp.

00082 {
00083 }

void osg::DVRAppearance::operator= const DVRAppearance source  )  [private]
 

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

Reimplemented from osg::ChunkMaterialBase.

Definition at line 58 of file OSGDVRAppearanceBase.inl.

References osg::DVRAppearanceBase::_type.

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

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::DVRAppearanceBase::getClassTypeId void   )  [inline, static, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 65 of file OSGDVRAppearanceBase.inl.

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

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

FieldContainerType & DVRAppearanceBase::getType void   )  [virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 86 of file OSGDVRAppearanceBase.cpp.

References osg::DVRAppearanceBase::_type.

00087 {
00088     return _type; 
00089 } 

const FieldContainerType & DVRAppearanceBase::getType void   )  const [virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 91 of file OSGDVRAppearanceBase.cpp.

References osg::DVRAppearanceBase::_type.

00092 {
00093     return _type;
00094 } 

UInt32 DVRAppearanceBase::getContainerSize void   )  const [virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 106 of file OSGDVRAppearanceBase.cpp.

00107 { 
00108     return sizeof(DVRAppearance); 
00109 }

UInt32 DVRAppearanceBase::getBinSize const BitVector whichField  )  [virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 166 of file OSGDVRAppearanceBase.cpp.

References osg::ChunkMaterialBase::getBinSize().

00167 {
00168     UInt32 returnValue = Inherited::getBinSize(whichField);
00169 
00170 
00171     return returnValue;
00172 }

void DVRAppearanceBase::copyToBin BinaryDataHandler pMem,
const BitVector whichField
[virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 174 of file OSGDVRAppearanceBase.cpp.

References osg::ChunkMaterialBase::copyToBin().

00176 {
00177     Inherited::copyToBin(pMem, whichField);
00178 
00179 
00180 }

void DVRAppearanceBase::copyFromBin BinaryDataHandler pMem,
const BitVector whichField
[virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 182 of file OSGDVRAppearanceBase.cpp.

References osg::ChunkMaterialBase::copyFromBin().

00184 {
00185     Inherited::copyFromBin(pMem, whichField);
00186 
00187 
00188 }

DVRAppearancePtr osg::DVRAppearanceBase::create void   )  [inline, static, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 72 of file OSGDVRAppearanceBase.inl.

References osg::AttachmentContainerPtr::dcast(), osg::DVRAppearanceBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::DVRAppearanceBase::shallowCopy().

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

DVRAppearancePtr osg::DVRAppearanceBase::createEmpty void   )  [inline, static, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 87 of file OSGDVRAppearanceBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr DVRAppearanceBase::shallowCopy void   )  const [virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 97 of file OSGDVRAppearanceBase.cpp.

References osg::FieldContainer::newPtr().

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

00098 { 
00099     DVRAppearancePtr returnValue; 
00100 
00101     newPtr(returnValue, dynamic_cast<const DVRAppearance *>(this)); 
00102 
00103     return returnValue; 
00104 }

void DVRAppearanceBase::executeSyncImpl DVRAppearanceBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 191 of file OSGDVRAppearanceBase.cpp.

References osg::ChunkMaterialBase::executeSyncImpl().

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

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

void ChunkMaterialBase::executeSyncImpl ChunkMaterialBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 258 of file OSGChunkMaterialBase.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::ChunkMaterialBase::_mfSlots, osg::ChunkMaterialBase::ChunksFieldMask, osg::MaterialBase::executeSyncImpl(), osg::FieldBits::NoField, osg::ChunkMaterialBase::SlotsFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::ChunkMaterialBase::executeSync(), osg::SimpleMaterialBase::executeSyncImpl(), osg::PhongMaterialBase::executeSyncImpl(), osg::FresnelMaterialBase::executeSyncImpl(), and osg::DVRAppearanceBase::executeSyncImpl().

00260 {
00261 
00262     Inherited::executeSyncImpl(pOther, whichField);
00263 
00264     if(FieldBits::NoField != (ChunksFieldMask & whichField))
00265         _mfChunks.syncWith(pOther->_mfChunks);
00266 
00267     if(FieldBits::NoField != (SlotsFieldMask & whichField))
00268         _mfSlots.syncWith(pOther->_mfSlots);
00269 
00270 
00271 }

void MaterialBase::executeSyncImpl MaterialBase pOther,
const BitVector whichField
[protected, inherited]
 

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 }

void AttachmentContainer::executeSyncImpl AttachmentContainer pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 316 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::AttachmentContainer::AttachmentsFieldMask, osg::FieldContainer::executeSyncImpl(), osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::AttachmentContainer::executeSync(), osg::WindowBase::executeSyncImpl(), osg::ViewportBase::executeSyncImpl(), osg::ShaderParameterBase::executeSyncImpl(), osg::Node::executeSyncImpl(), osg::NodeCore::executeSyncImpl(), osg::MaterialBase::executeSyncImpl(), osg::ImageComposerBase::executeSyncImpl(), osg::ImageBase::executeSyncImpl(), osg::ForegroundBase::executeSyncImpl(), osg::DisplayCalibrationBase::executeSyncImpl(), osg::CameraBase::executeSyncImpl(), and osg::BackgroundBase::executeSyncImpl().

00319 {
00320     Inherited::executeSyncImpl(pOther, whichField);
00321 
00322     if (FieldBits::NoField != (AttachmentsFieldMask & whichField))
00323     {
00324         _attachmentMap.syncWith(pOther->_attachmentMap);
00325     }
00326 }

void osg::FieldContainer::executeSyncImpl FieldContainer pOther,
const BitVector whichField
[inline, protected, inherited]
 

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().

00335 {
00336 }

void DVRAppearanceBase::executeSync FieldContainer other,
const BitVector whichField
[protected, virtual, inherited]
 

Reimplemented from osg::ChunkMaterialBase.

Definition at line 113 of file OSGDVRAppearanceBase.cpp.

References osg::DVRAppearanceBase::executeSyncImpl().

00115 {
00116     this->executeSyncImpl((DVRAppearanceBase *) &other, whichField);
00117 }

* 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 274 of file OSGChunkMaterial.cpp.

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

00275 {
00276     StatePtr state = makeState();
00277 
00278     addRefCP(state);
00279 
00280     state->activate(action);
00281 
00282     func.call(action);
00283 
00284     state->deactivate(action);
00285 
00286     subRefCP(state); // kill it
00287 }

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

Draw the geometry with this material.

Implements osg::Material.

Definition at line 254 of file OSGChunkMaterial.cpp.

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

00255 {
00256     StatePtr state = makeState();
00257 
00258     addRefCP(state);
00259 
00260     state->activate(action);
00261 
00262     geo->drawPrimitives(action);
00263 
00264     state->deactivate(action);
00265 
00266     subRefCP(state); // kill it
00267 }

StatePtr ChunkMaterial::makeState void   )  [virtual, inherited]
 

Create a osg::State that represents this Material and return it.

Implements osg::Material.

Reimplemented in osg::FresnelMaterial, osg::PhongMaterial, osg::SimpleMaterial, and osg::SimpleTexturedMaterial.

Definition at line 292 of file OSGChunkMaterial.cpp.

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

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

00293 {
00294     StatePtr state = State::create();
00295     UInt32 i;
00296     
00297     for(i = 0; i < _mfChunks.size(); ++i)
00298         state->addChunk(_mfChunks[i], 
00299                         (i < _mfSlots.size()) ? _mfSlots[i]
00300                                                 : State::AutoSlotReplace);
00301 
00302     return state;
00303 }

void ChunkMaterial::rebuildState void   )  [virtual, inherited]
 

Rebuild the internal State. Just collects the chunks in the State.

Implements osg::Material.

Reimplemented in osg::FresnelMaterial, osg::PhongMaterial, osg::SimpleMaterial, and osg::SimpleTexturedMaterial.

Definition at line 308 of file OSGChunkMaterial.cpp.

References osg::ChunkMaterialBase::_mfChunks, osg::ChunkMaterialBase::_mfSlots, osg::Material::_pState, osg::addRefCP(), osg::State::AutoSlotReplace, osg::StateBase::create(), osg::NullFC, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00309 {
00310     if(_pState != NullFC)
00311     {
00312         _pState->clearChunks();
00313     }
00314     else
00315     {
00316         _pState = State::create();
00317 
00318         addRefCP(_pState);
00319     }
00320 
00321     UInt32 i;
00322     
00323     for(i = 0; i < _mfChunks.size(); ++i)
00324         _pState->addChunk(_mfChunks[i], 
00325                           (i < _mfSlots.size()) ? _mfSlots[i]
00326                                                   : State::AutoSlotReplace);
00327 }

bool ChunkMaterial::isTransparent void   )  const [virtual, inherited]
 

Check if the Material (i.e. any of its chunks) is transparent..

Implements osg::Material.

Reimplemented in osg::FresnelMaterial, osg::PhongMaterial, osg::SimpleMaterial, and osg::SimpleTexturedMaterial.

Definition at line 332 of file OSGChunkMaterial.cpp.

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

Referenced by osg::SimpleMaterial::isTransparent(), osg::PhongMaterial::isTransparent(), and osg::FresnelMaterial::isTransparent().

00333 {
00334     bool             returnValue = false;
00335 
00336     MFStateChunkPtr::const_iterator it        = _mfChunks.begin();
00337     MFStateChunkPtr::const_iterator chunksEnd = _mfChunks.end();
00338 
00339     for(; it != chunksEnd && returnValue == false; ++it)
00340     {
00341         returnValue =(*it)->isTransparent();
00342     }
00343 
00344     return returnValue;
00345 }

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 144 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().

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

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 166 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.

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

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 194 of file OSGChunkMaterial.cpp.

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

00195 {
00196     UInt32 i;
00197     
00198     for(i = 0; i < _mfChunks.size(); ++i)
00199     {
00200         if(_mfChunks[i] == chunk)
00201             return i;
00202     }
00203              
00204     return -1;
00205 }

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.

Definition at line 212 of file OSGChunkMaterial.cpp.

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

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

bool ChunkMaterial::operator== const