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

osg::DepthChunkBase Class Reference

DepthChunk Base Class.

#include <OSGDepthChunkBase.h>

Inheritance diagram for osg::DepthChunkBase:

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

Public Types

typedef DepthChunkPtr Ptr
enum  {
  EnableFieldId = Inherited::NextFieldId, FuncFieldId = EnableFieldId + 1, NearFieldId = FuncFieldId + 1, FarFieldId = NearFieldId + 1,
  ReadOnlyFieldId = FarFieldId + 1, NextFieldId = ReadOnlyFieldId + 1
}

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFBoolgetSFEnable (void)
 Get the DepthChunk::_sfEnable field.
SFGLenumgetSFFunc (void)
 Get the DepthChunk::_sfFunc field.
SFReal32getSFNear (void)
 Get the DepthChunk::_sfNear field.
SFReal32getSFFar (void)
 Get the DepthChunk::_sfFar field.
SFBoolgetSFReadOnly (void)
 Get the DepthChunk::_sfReadOnly field.
bool & getEnable (void)
 Get the value of the DepthChunk::_sfEnable field.
const bool & getEnable (void) const
 Get the value of the DepthChunk::_sfEnable field.
GLenumgetFunc (void)
 Get the value of the DepthChunk::_sfFunc field.
const GLenumgetFunc (void) const
 Get the value of the DepthChunk::_sfFunc field.
Real32getNear (void)
 Get the value of the DepthChunk::_sfNear field.
const Real32getNear (void) const
 Get the value of the DepthChunk::_sfNear field.
Real32getFar (void)
 Get the value of the DepthChunk::_sfFar field.
const Real32getFar (void) const
 Get the value of the DepthChunk::_sfFar field.
bool & getReadOnly (void)
 Get the value of the DepthChunk::_sfReadOnly field.
const bool & getReadOnly (void) const
 Get the value of the DepthChunk::_sfReadOnly field.
Field Set
*void setEnable (const bool &value)
 Set the value of the DepthChunk::_sfEnable field.
void setFunc (const GLenum &value)
 Set the value of the DepthChunk::_sfFunc field.
void setNear (const Real32 &value)
 Set the value of the DepthChunk::_sfNear field.
void setFar (const Real32 &value)
 Set the value of the DepthChunk::_sfFar field.
void setReadOnly (const bool &value)
 Set the value of the DepthChunk::_sfReadOnly 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

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 DepthChunkPtr create (void)
 create a new instance of the class
static DepthChunkPtr 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)

Static Public Attributes

static const osg::BitVector EnableFieldMask
static const osg::BitVector FuncFieldMask
static const osg::BitVector NearFieldMask
static const osg::BitVector FarFieldMask
static const osg::BitVector ReadOnlyFieldMask
static const osg::BitVector MTInfluenceMask
static const BitVector InternalFieldMask = (1 << Attachment::InternalFieldId)
static const BitVector ParentsFieldMask = (1 << Attachment::ParentsFieldId)
static const BitVector NextFieldMask

Protected Member Functions

Constructors
DepthChunkBase (void)
 DepthChunkBase (const DepthChunkBase &source)
Destructors
*virtual ~DepthChunkBase (void)
Sync
*void executeSyncImpl (DepthChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField)

Static Protected Member Functions

static void initMethod (void)

Protected Attributes

Fields
*SFBool _sfEnable
SFGLenum _sfFunc
SFReal32 _sfNear
SFReal32 _sfFar
SFBool _sfReadOnly

Private Types

typedef StateChunk Inherited

Private Member Functions

void operator= (const DepthChunkBase &source)

Static Private Attributes

static FieldDescription_desc []
 DepthChunk description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 85 of file OSGDepthChunkBase.h.


Member Typedef Documentation

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

Reimplemented from osg::StateChunk.

Reimplemented in osg::DepthChunk.

Definition at line 89 of file OSGDepthChunkBase.h.

typedef DepthChunkPtr osg::DepthChunkBase::Ptr
 

Reimplemented from osg::StateChunkBase.

Definition at line 94 of file OSGDepthChunkBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
EnableFieldId 
FuncFieldId 
NearFieldId 
FarFieldId 
ReadOnlyFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 96 of file OSGDepthChunkBase.h.

00097     {
00098         EnableFieldId   = Inherited::NextFieldId,
00099         FuncFieldId     = EnableFieldId   + 1,
00100         NearFieldId     = FuncFieldId     + 1,
00101         FarFieldId      = NearFieldId     + 1,
00102         ReadOnlyFieldId = FarFieldId      + 1,
00103         NextFieldId     = ReadOnlyFieldId + 1
00104     };


Constructor & Destructor Documentation

DepthChunkBase::DepthChunkBase void   )  [protected]
 

Definition at line 209 of file OSGDepthChunkBase.cpp.

00209                                    :
00210     _sfEnable                 (bool(true)), 
00211     _sfFunc                   (GLenum(GL_LEQUAL)), 
00212     _sfNear                   (Real32(-1.f)), 
00213     _sfFar                    (Real32(-1.f)), 
00214     _sfReadOnly               (bool(false)), 
00215     Inherited() 
00216 {
00217 }

DepthChunkBase::DepthChunkBase const DepthChunkBase source  )  [protected]
 

Definition at line 223 of file OSGDepthChunkBase.cpp.

00223                                                            :
00224     _sfEnable                 (source._sfEnable                 ), 
00225     _sfFunc                   (source._sfFunc                   ), 
00226     _sfNear                   (source._sfNear                   ), 
00227     _sfFar                    (source._sfFar                    ), 
00228     _sfReadOnly               (source._sfReadOnly               ), 
00229     Inherited                 (source)
00230 {
00231 }

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

Definition at line 235 of file OSGDepthChunkBase.cpp.

00236 {
00237 }


Member Function Documentation

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

Reimplemented from osg::StateChunkBase.

Definition at line 58 of file OSGDepthChunkBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 65 of file OSGDepthChunkBase.inl.

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

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

FieldContainerType & DepthChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 151 of file OSGDepthChunkBase.cpp.

References _type.

00152 {
00153     return _type; 
00154 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 156 of file OSGDepthChunkBase.cpp.

References _type.

00157 {
00158     return _type;
00159 } 

UInt32 DepthChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 171 of file OSGDepthChunkBase.cpp.

00172 { 
00173     return sizeof(DepthChunk); 
00174 }

SFBool * osg::DepthChunkBase::getSFEnable void   )  [inline]
 

Definition at line 101 of file OSGDepthChunkBase.inl.

References _sfEnable.

00102 {
00103     return &_sfEnable;
00104 }

SFGLenum * osg::DepthChunkBase::getSFFunc void   )  [inline]
 

Definition at line 108 of file OSGDepthChunkBase.inl.

References _sfFunc.

00109 {
00110     return &_sfFunc;
00111 }

SFReal32 * osg::DepthChunkBase::getSFNear void   )  [inline]
 

Definition at line 115 of file OSGDepthChunkBase.inl.

References _sfNear.

00116 {
00117     return &_sfNear;
00118 }

SFReal32 * osg::DepthChunkBase::getSFFar void   )  [inline]
 

Definition at line 122 of file OSGDepthChunkBase.inl.

References _sfFar.

00123 {
00124     return &_sfFar;
00125 }

SFBool * osg::DepthChunkBase::getSFReadOnly void   )  [inline]
 

Definition at line 129 of file OSGDepthChunkBase.inl.

References _sfReadOnly.

00130 {
00131     return &_sfReadOnly;
00132 }

bool & osg::DepthChunkBase::getEnable void   )  [inline]
 

Definition at line 137 of file OSGDepthChunkBase.inl.

References _sfEnable, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::DepthChunk::activate(), osg::DepthChunk::deactivate(), and osg::DepthChunk::operator==().

00138 {
00139     return _sfEnable.getValue();
00140 }

const bool & osg::DepthChunkBase::getEnable void   )  const [inline]
 

Definition at line 144 of file OSGDepthChunkBase.inl.

References _sfEnable, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00145 {
00146     return _sfEnable.getValue();
00147 }

GLenum & osg::DepthChunkBase::getFunc void   )  [inline]
 

Definition at line 158 of file OSGDepthChunkBase.inl.

References _sfFunc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::DepthChunk::operator==().

00159 {
00160     return _sfFunc.getValue();
00161 }

const GLenum & osg::DepthChunkBase::getFunc void   )  const [inline]
 

Definition at line 165 of file OSGDepthChunkBase.inl.

References _sfFunc, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00166 {
00167     return _sfFunc.getValue();
00168 }

Real32 & osg::DepthChunkBase::getNear void   )  [inline]
 

Definition at line 179 of file OSGDepthChunkBase.inl.

References _sfNear, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::DepthChunk::activate(), osg::DepthChunk::deactivate(), and osg::DepthChunk::operator==().

00180 {
00181     return _sfNear.getValue();
00182 }

const Real32 & osg::DepthChunkBase::getNear void   )  const [inline]
 

Definition at line 186 of file OSGDepthChunkBase.inl.

References _sfNear, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00187 {
00188     return _sfNear.getValue();
00189 }

Real32 & osg::DepthChunkBase::getFar void   )  [inline]
 

Definition at line 200 of file OSGDepthChunkBase.inl.

References _sfFar, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::DepthChunk::activate(), osg::DepthChunk::deactivate(), and osg::DepthChunk::operator==().

00201 {
00202     return _sfFar.getValue();
00203 }

const Real32 & osg::DepthChunkBase::getFar void   )  const [inline]
 

Definition at line 207 of file OSGDepthChunkBase.inl.

References _sfFar, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00208 {
00209     return _sfFar.getValue();
00210 }

bool & osg::DepthChunkBase::getReadOnly void   )  [inline]
 

Definition at line 221 of file OSGDepthChunkBase.inl.

References _sfReadOnly, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

Referenced by osg::DepthChunk::activate(), and osg::DepthChunk::operator==().

00222 {
00223     return _sfReadOnly.getValue();
00224 }

const bool & osg::DepthChunkBase::getReadOnly void   )  const [inline]
 

Definition at line 228 of file OSGDepthChunkBase.inl.

References _sfReadOnly, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00229 {
00230     return _sfReadOnly.getValue();
00231 }

void osg::DepthChunkBase::setEnable const bool &  value  )  [inline]
 

Definition at line 151 of file OSGDepthChunkBase.inl.

References _sfEnable, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00152 {
00153     _sfEnable.setValue(value);
00154 }

void osg::DepthChunkBase::setFunc const GLenum value  )  [inline]
 

Definition at line 172 of file OSGDepthChunkBase.inl.

References _sfFunc, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00173 {
00174     _sfFunc.setValue(value);
00175 }

void osg::DepthChunkBase::setNear const Real32 value  )  [inline]
 

Definition at line 193 of file OSGDepthChunkBase.inl.

References _sfNear, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00194 {
00195     _sfNear.setValue(value);
00196 }

void osg::DepthChunkBase::setFar const Real32 value  )  [inline]
 

Definition at line 214 of file OSGDepthChunkBase.inl.

References _sfFar, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00215 {
00216     _sfFar.setValue(value);
00217 }

void osg::DepthChunkBase::setReadOnly const bool &  value  )  [inline]
 

Definition at line 235 of file OSGDepthChunkBase.inl.

References _sfReadOnly, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00236 {
00237     _sfReadOnly.setValue(value);
00238 }

UInt32 DepthChunkBase::getBinSize const BitVector whichField  )  [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 241 of file OSGDepthChunkBase.cpp.

References _sfEnable, _sfFar, _sfFunc, _sfNear, _sfReadOnly, EnableFieldMask, FarFieldMask, FuncFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::StateChunkBase::getBinSize(), NearFieldMask, osg::FieldBits::NoField, and ReadOnlyFieldMask.

00242 {
00243     UInt32 returnValue = Inherited::getBinSize(whichField);
00244 
00245     if(FieldBits::NoField != (EnableFieldMask & whichField))
00246     {
00247         returnValue += _sfEnable.getBinSize();
00248     }
00249 
00250     if(FieldBits::NoField != (FuncFieldMask & whichField))
00251     {
00252         returnValue += _sfFunc.getBinSize();
00253     }
00254 
00255     if(FieldBits::NoField != (NearFieldMask & whichField))
00256     {
00257         returnValue += _sfNear.getBinSize();
00258     }
00259 
00260     if(FieldBits::NoField != (FarFieldMask & whichField))
00261     {
00262         returnValue += _sfFar.getBinSize();
00263     }
00264 
00265     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00266     {
00267         returnValue += _sfReadOnly.getBinSize();
00268     }
00269 
00270 
00271     return returnValue;
00272 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 274 of file OSGDepthChunkBase.cpp.

References _sfEnable, _sfFar, _sfFunc, _sfNear, _sfReadOnly, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::StateChunkBase::copyToBin(), EnableFieldMask, FarFieldMask, FuncFieldMask, NearFieldMask, osg::FieldBits::NoField, and ReadOnlyFieldMask.

00276 {
00277     Inherited::copyToBin(pMem, whichField);
00278 
00279     if(FieldBits::NoField != (EnableFieldMask & whichField))
00280     {
00281         _sfEnable.copyToBin(pMem);
00282     }
00283 
00284     if(FieldBits::NoField != (FuncFieldMask & whichField))
00285     {
00286         _sfFunc.copyToBin(pMem);
00287     }
00288 
00289     if(FieldBits::NoField != (NearFieldMask & whichField))
00290     {
00291         _sfNear.copyToBin(pMem);
00292     }
00293 
00294     if(FieldBits::NoField != (FarFieldMask & whichField))
00295     {
00296         _sfFar.copyToBin(pMem);
00297     }
00298 
00299     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00300     {
00301         _sfReadOnly.copyToBin(pMem);
00302     }
00303 
00304 
00305 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 307 of file OSGDepthChunkBase.cpp.

References _sfEnable, _sfFar, _sfFunc, _sfNear, _sfReadOnly, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::StateChunkBase::copyFromBin(), EnableFieldMask, FarFieldMask, FuncFieldMask, NearFieldMask, osg::FieldBits::NoField, and ReadOnlyFieldMask.

00309 {
00310     Inherited::copyFromBin(pMem, whichField);
00311 
00312     if(FieldBits::NoField != (EnableFieldMask & whichField))
00313     {
00314         _sfEnable.copyFromBin(pMem);
00315     }
00316 
00317     if(FieldBits::NoField != (FuncFieldMask & whichField))
00318     {
00319         _sfFunc.copyFromBin(pMem);
00320     }
00321 
00322     if(FieldBits::NoField != (NearFieldMask & whichField))
00323     {
00324         _sfNear.copyFromBin(pMem);
00325     }
00326 
00327     if(FieldBits::NoField != (FarFieldMask & whichField))
00328     {
00329         _sfFar.copyFromBin(pMem);
00330     }
00331 
00332     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00333     {
00334         _sfReadOnly.copyFromBin(pMem);
00335     }
00336 
00337 
00338 }

DepthChunkPtr osg::DepthChunkBase::create void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 72 of file OSGDepthChunkBase.inl.

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

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

DepthChunkPtr osg::DepthChunkBase::createEmpty void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 87 of file OSGDepthChunkBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr DepthChunkBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::Attachment.

Definition at line 162 of file OSGDepthChunkBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00163 { 
00164     DepthChunkPtr returnValue; 
00165 
00166     newPtr(returnValue, dynamic_cast<const DepthChunk *>(this)); 
00167 
00168     return returnValue; 
00169 }

void DepthChunkBase::executeSyncImpl DepthChunkBase pOther,
const BitVector whichField
[protected]
 

Definition at line 341 of file OSGDepthChunkBase.cpp.

References _sfEnable, _sfFar, _sfFunc, _sfNear, _sfReadOnly, EnableFieldMask, osg::StateChunkBase::executeSyncImpl(), FarFieldMask, FuncFieldMask, NearFieldMask, osg::FieldBits::NoField, ReadOnlyFieldMask, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by executeSync().

00343 {
00344 
00345     Inherited::executeSyncImpl(pOther, whichField);
00346 
00347     if(FieldBits::NoField != (EnableFieldMask & whichField))
00348         _sfEnable.syncWith(pOther->_sfEnable);
00349 
00350     if(FieldBits::NoField != (FuncFieldMask & whichField))
00351         _sfFunc.syncWith(pOther->_sfFunc);
00352 
00353     if(FieldBits::NoField != (NearFieldMask & whichField))
00354         _sfNear.syncWith(pOther->_sfNear);
00355 
00356     if(FieldBits::NoField != (FarFieldMask & whichField))
00357         _sfFar.syncWith(pOther->_sfFar);
00358 
00359     if(FieldBits::NoField != (ReadOnlyFieldMask & whichField))
00360         _sfReadOnly.syncWith(pOther->_sfReadOnly);
00361 
00362 
00363 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 178 of file OSGDepthChunkBase.cpp.

References executeSyncImpl().

00180 {
00181     this->executeSyncImpl((DepthChunkBase *) &other, whichField);
00182 }

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

UInt32 osg::StateChunk::getClassId void   )  const [inline, inherited]
 

Definition at line 48 of file OSGStateChunk.inl.

References osg::StateChunk::getClass(), and osg::StateChunkClass::getId().

00049 {
00050     return getClass()->getId();
00051 }

const StateChunkClass * StateChunk::getClass void   )  const [virtual, inherited]
 

Reimplemented in osg::BlendChunk, osg::ClipPlaneChunk, osg::ColorMaskChunk, osg::CubeTextureChunk, osg::DepthChunk, osg::FragmentProgramChunk, osg::LightChunk, osg::LineChunk, osg::MaterialChunk, osg::PointChunk, osg::PolygonChunk, osg::ProgramChunk, osg::RegisterCombinersChunk, osg::StencilChunk, osg::TexGenChunk, osg::TextureChunk, osg::TextureTransformChunk, osg::TransformChunk, osg::TwoSidedLightingChunk, osg::VertexProgramChunk, osg::SHLChunk, and osg::SHLParameterChunk.

Definition at line 282 of file OSGStateChunk.cpp.

Referenced by osg::StateChunk::getClassId().

00283 {
00284     return NULL;
00285 }