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

osg::PolygonChunk Class Reference
[OpenGL State Handling]

State chunk for polygon-specific modes. See PolygonChunk for a description. More...

#include <OSGPolygonChunk.h>

Inheritance diagram for osg::PolygonChunk:

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

Public Types

typedef PolygonChunkPtr Ptr
enum  {
  CullFaceFieldId = Inherited::NextFieldId, FrontFaceFieldId = CullFaceFieldId + 1, FrontModeFieldId = FrontFaceFieldId + 1, BackModeFieldId = FrontModeFieldId + 1,
  SmoothFieldId = BackModeFieldId + 1, OffsetFactorFieldId = SmoothFieldId + 1, OffsetBiasFieldId = OffsetFactorFieldId + 1, OffsetPointFieldId = OffsetBiasFieldId + 1,
  OffsetLineFieldId = OffsetPointFieldId + 1, OffsetFillFieldId = OffsetLineFieldId + 1, StippleFieldId = OffsetFillFieldId + 1, NextFieldId = StippleFieldId + 1
}

Public Member Functions

Chunk Class Access
*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)
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
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFInt32getSFCullFace (void)
 Get the PolygonChunk::_sfCullFace field.
SFInt32getSFFrontFace (void)
 Get the PolygonChunk::_sfFrontFace field.
SFInt32getSFFrontMode (void)
 Get the PolygonChunk::_sfFrontMode field.
SFInt32getSFBackMode (void)
 Get the PolygonChunk::_sfBackMode field.
SFBoolgetSFSmooth (void)
 Get the PolygonChunk::_sfSmooth field.
SFReal32getSFOffsetFactor (void)
 Get the PolygonChunk::_sfOffsetFactor field.
SFReal32getSFOffsetBias (void)
 Get the PolygonChunk::_sfOffsetBias field.
SFBoolgetSFOffsetPoint (void)
 Get the PolygonChunk::_sfOffsetPoint field.
SFBoolgetSFOffsetLine (void)
 Get the PolygonChunk::_sfOffsetLine field.
SFBoolgetSFOffsetFill (void)
 Get the PolygonChunk::_sfOffsetFill field.
MFInt32getMFStipple (void)
 Get the PolygonChunk::_mfStipple field.
Int32getCullFace (void)
 Get the value of the PolygonChunk::_sfCullFace field.
const Int32getCullFace (void) const
 Get the value of the PolygonChunk::_sfCullFace field.
Int32getFrontFace (void)
 Get the value of the PolygonChunk::_sfFrontFace field.
const Int32getFrontFace (void) const
 Get the value of the PolygonChunk::_sfFrontFace field.
Int32getFrontMode (void)
 Get the value of the PolygonChunk::_sfFrontMode field.
const Int32getFrontMode (void) const
 Get the value of the PolygonChunk::_sfFrontMode field.
Int32getBackMode (void)
 Get the value of the PolygonChunk::_sfBackMode field.
const Int32getBackMode (void) const
 Get the value of the PolygonChunk::_sfBackMode field.
bool & getSmooth (void)
 Get the value of the PolygonChunk::_sfSmooth field.
const bool & getSmooth (void) const
 Get the value of the PolygonChunk::_sfSmooth field.
Real32getOffsetFactor (void)
 Get the value of the PolygonChunk::_sfOffsetFactor field.
const Real32getOffsetFactor (void) const
 Get the value of the PolygonChunk::_sfOffsetFactor field.
Real32getOffsetBias (void)
 Get the value of the PolygonChunk::_sfOffsetBias field.
const Real32getOffsetBias (void) const
 Get the value of the PolygonChunk::_sfOffsetBias field.
bool & getOffsetPoint (void)
 Get the value of the PolygonChunk::_sfOffsetPoint field.
const bool & getOffsetPoint (void) const
 Get the value of the PolygonChunk::_sfOffsetPoint field.
bool & getOffsetLine (void)
 Get the value of the PolygonChunk::_sfOffsetLine field.
const bool & getOffsetLine (void) const
 Get the value of the PolygonChunk::_sfOffsetLine field.
bool & getOffsetFill (void)
 Get the value of the PolygonChunk::_sfOffsetFill field.
const bool & getOffsetFill (void) const
 Get the value of the PolygonChunk::_sfOffsetFill field.
Int32getStipple (const UInt32 index)
 Get the value of the index element the PolygonChunk::_mfStipple field.
MFInt32getStipple (void)
 Get the PolygonChunk::_mfStipple field.
const MFInt32getStipple (void) const
 Get the PolygonChunk::_mfStipple field.
Field Set
*void setCullFace (const Int32 &value)
 Set the value of the PolygonChunk::_sfCullFace field.
void setFrontFace (const Int32 &value)
 Set the value of the PolygonChunk::_sfFrontFace field.
void setFrontMode (const Int32 &value)
 Set the value of the PolygonChunk::_sfFrontMode field.
void setBackMode (const Int32 &value)
 Set the value of the PolygonChunk::_sfBackMode field.
void setSmooth (const bool &value)
 Set the value of the PolygonChunk::_sfSmooth field.
void setOffsetFactor (const Real32 &value)
 Set the value of the PolygonChunk::_sfOffsetFactor field.
void setOffsetBias (const Real32 &value)
 Set the value of the PolygonChunk::_sfOffsetBias field.
void setOffsetPoint (const bool &value)
 Set the value of the PolygonChunk::_sfOffsetPoint field.
void setOffsetLine (const bool &value)
 Set the value of the PolygonChunk::_sfOffsetLine field.
void setOffsetFill (const bool &value)
 Set the value of the PolygonChunk::_sfOffsetFill 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

Static Public Member Functions

Static Chunk Class Access
*static UInt32 getStaticClassId (void)
static const StateChunkClassgetStaticClass (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 PolygonChunkPtr create (void)
 create a new instance of the class
static PolygonChunkPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector CullFaceFieldMask
static const osg::BitVector FrontFaceFieldMask
static const osg::BitVector FrontModeFieldMask
static const osg::BitVector BackModeFieldMask
static const osg::BitVector SmoothFieldMask
static const osg::BitVector OffsetFactorFieldMask
static const osg::BitVector OffsetBiasFieldMask
static const osg::BitVector OffsetPointFieldMask
static const osg::BitVector OffsetLineFieldMask
static const osg::BitVector OffsetFillFieldMask
static const osg::BitVector StippleFieldMask
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
PolygonChunk (void)
 PolygonChunk (const PolygonChunk &source)
Destructors
*virtual ~PolygonChunk (void)
Sync
*void executeSyncImpl (PolygonChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)

Protected Attributes

Fields
*SFInt32 _sfCullFace
SFInt32 _sfFrontFace
SFInt32 _sfFrontMode
SFInt32 _sfBackMode
SFBool _sfSmooth
SFReal32 _sfOffsetFactor
SFReal32 _sfOffsetBias
SFBool _sfOffsetPoint
SFBool _sfOffsetLine
SFBool _sfOffsetFill
MFInt32 _mfStipple

Private Types

typedef PolygonChunkBase Inherited

Private Member Functions

void operator= (const PolygonChunk &source)

Static Private Member Functions

static void initMethod (void)

Static Private Attributes

static char cvsid []
static StateChunkClass _class

Friends

class FieldContainer
class PolygonChunkBase

Detailed Description

See PolygonChunk for details.

The parameters of the following functions are wrapped here: glCullFace() (osg::PolygonChunk::_sfCullFace), glFrontFace() (osg::PolygonChunk::_sfFrontFace), glPolygonMode() (osg::PolygonChunk::_sfFrontMode, osg::PolygonChunk::_sfBackMode), glEnable(GL_POLYGON_SMOOTH) (osg::PolygonChunk::_sfSmooth), glPolygonOffset() (osg::PolygonChunk::_sfOffsetFactor, osg::PolygonChunk::_sfOffsetBias), glEnable(GL_POLYGON_OFFSET_POINT) (osg::PolygonChunk::_sfOffsetPoint), glEnable(GL_POLYGON_OFFSET_LINE) (osg::PolygonChunk::_sfOffsetLine), glEnable(GL_POLYGON_OFFSET_FILL) (osg::PolygonChunk::_sfOffsetFill), glStipplePattern() and glEnable(GL_POLYGON_STIPPLE) (osg::PolygonChunk::_sfStipple).

Definition at line 55 of file OSGPolygonChunk.h.


Member Typedef Documentation

typedef PolygonChunkBase osg::PolygonChunk::Inherited [private]
 

Reimplemented from osg::PolygonChunkBase.

Definition at line 138 of file OSGPolygonChunk.h.

typedef PolygonChunkPtr osg::PolygonChunkBase::Ptr [inherited]
 

Reimplemented from osg::StateChunkBase.

Definition at line 100 of file OSGPolygonChunkBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
CullFaceFieldId 
FrontFaceFieldId 
FrontModeFieldId 
BackModeFieldId 
SmoothFieldId 
OffsetFactorFieldId 
OffsetBiasFieldId 
OffsetPointFieldId 
OffsetLineFieldId 
OffsetFillFieldId 
StippleFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 102 of file OSGPolygonChunkBase.h.

00103     {
00104         CullFaceFieldId     = Inherited::NextFieldId,
00105         FrontFaceFieldId    = CullFaceFieldId     + 1,
00106         FrontModeFieldId    = FrontFaceFieldId    + 1,
00107         BackModeFieldId     = FrontModeFieldId    + 1,
00108         SmoothFieldId       = BackModeFieldId     + 1,
00109         OffsetFactorFieldId = SmoothFieldId       + 1,
00110         OffsetBiasFieldId   = OffsetFactorFieldId + 1,
00111         OffsetPointFieldId  = OffsetBiasFieldId   + 1,
00112         OffsetLineFieldId   = OffsetPointFieldId  + 1,
00113         OffsetFillFieldId   = OffsetLineFieldId   + 1,
00114         StippleFieldId      = OffsetFillFieldId   + 1,
00115         NextFieldId         = StippleFieldId      + 1
00116     };


Constructor & Destructor Documentation

PolygonChunk::PolygonChunk void   )  [protected]
 

Definition at line 102 of file OSGPolygonChunk.cpp.

00102                                :
00103     Inherited()
00104 {
00105 }

PolygonChunk::PolygonChunk const PolygonChunk source  )  [protected]
 

Definition at line 107 of file OSGPolygonChunk.cpp.

00107                                                      :
00108     Inherited(source)
00109 {
00110 }

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

Definition at line 112 of file OSGPolygonChunk.cpp.

00113 {
00114 }


Member Function Documentation

const StateChunkClass * PolygonChunk::getClass void   )  const [virtual]
 

Reimplemented from osg::StateChunk.

Definition at line 118 of file OSGPolygonChunk.cpp.

References _class.

00119 {
00120     return &_class;
00121 }

UInt32 osg::PolygonChunk::getStaticClassId void   )  [inline, static]
 

Reimplemented from osg::StateChunk.

Definition at line 47 of file OSGPolygonChunk.inl.

References osg::StateChunkClass::getId(), and getStaticClass().

00048 {
00049     return getStaticClass()->getId();
00050 }

const StateChunkClass * osg::PolygonChunk::getStaticClass void   )  [inline, static]
 

Reimplemented from osg::StateChunk.

Definition at line 53 of file OSGPolygonChunk.inl.

References _class.

Referenced by getStaticClassId().

00054 {
00055     return &PolygonChunk::_class;
00056 }

void PolygonChunk::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::StateChunk.

Definition at line 125 of file OSGPolygonChunk.cpp.

References osg::StateChunk::changed().

00126 {
00127     Inherited::changed(whichField, origin);
00128 }

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

Reimplemented from osg::StateChunk.

Definition at line 132 of file OSGPolygonChunk.cpp.

References osg::StateChunk::dump().

00134 {
00135    Inherited::dump(uiIndent, bvFlags);
00136 }

void PolygonChunk::activate DrawActionBase action,
UInt32  index = 0
[virtual]
 

Activate the chunk, i.e. set the OpenGl state covered by the chunk which is different from the default state to the given state.

Reimplemented from osg::StateChunk.

Definition at line 141 of file OSGPolygonChunk.cpp.

References osg::PolygonChunkBase::_mfStipple, osg::PolygonChunkBase::_sfBackMode, osg::PolygonChunkBase::_sfCullFace, osg::PolygonChunkBase::_sfFrontFace, osg::PolygonChunkBase::_sfFrontMode, osg::PolygonChunkBase::_sfOffsetBias, osg::PolygonChunkBase::_sfOffsetFactor, osg::PolygonChunkBase::_sfOffsetFill, osg::PolygonChunkBase::_sfOffsetLine, osg::PolygonChunkBase::_sfOffsetPoint, osg::PolygonChunkBase::_sfSmooth, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00142 {
00143 // cullFace
00144 
00145     if(_sfCullFace.getValue() != GL_NONE)
00146     {
00147         glCullFace(_sfCullFace.getValue());
00148         glEnable(GL_CULL_FACE);
00149     }
00150 
00151 // frontFace
00152 
00153     if(_sfFrontFace.getValue() != GL_CCW)
00154         glFrontFace(_sfFrontFace.getValue());
00155 
00156 // smooth
00157 
00158     if(_sfSmooth.getValue()) 
00159         glEnable(GL_POLYGON_SMOOTH);
00160 
00161 // mode
00162 
00163     if(_sfFrontMode.getValue() != GL_FILL)
00164         glPolygonMode(GL_FRONT, _sfFrontMode.getValue());
00165 
00166     if(_sfBackMode.getValue() != GL_FILL)
00167         glPolygonMode(GL_BACK, _sfBackMode.getValue());
00168 
00169 // offset
00170    
00171     if(_sfOffsetFactor.getValue() != 0.f || _sfOffsetBias.getValue() != 0.f)    
00172         glPolygonOffset(_sfOffsetFactor.getValue(), _sfOffsetBias.getValue());
00173 
00174     if(_sfOffsetPoint.getValue())    
00175         glEnable(GL_POLYGON_OFFSET_POINT);
00176 
00177     if(_sfOffsetLine.getValue()) 
00178         glEnable(GL_POLYGON_OFFSET_LINE);
00179 
00180     if(_sfOffsetFill.getValue()) 
00181         glEnable(GL_POLYGON_OFFSET_FILL);
00182 
00183 // stipple
00184 
00185     if(_mfStipple.size() == 32)
00186     {
00187         glPolygonStipple((const GLubyte *) &(_mfStipple[0]));
00188         glEnable(GL_POLYGON_STIPPLE);
00189     }
00190 }

void PolygonChunk::changeFrom DrawActionBase action,
StateChunk old_chunk,
UInt32  index = 0
[virtual]
 

Change from an old chunk of the same type to this chunk. Note that in general no type checking is done, make sure to use this on a legal combination of chunks!

Reimplemented from osg::StateChunk.

Definition at line 193 of file OSGPolygonChunk.cpp.

References osg::PolygonChunkBase::_mfStipple, osg::PolygonChunkBase::_sfBackMode, osg::PolygonChunkBase::_sfCullFace, osg::PolygonChunkBase::_sfFrontFace, osg::PolygonChunkBase::_sfFrontMode, osg::PolygonChunkBase::_sfOffsetBias, osg::PolygonChunkBase::_sfOffsetFactor, osg::PolygonChunkBase::_sfOffsetFill, osg::PolygonChunkBase::_sfOffsetLine, osg::PolygonChunkBase::_sfOffsetPoint, osg::PolygonChunkBase::_sfSmooth, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::MField< FieldTypeT, fieldNameSpace >::getValues(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00194 {
00195     PolygonChunk const *old = dynamic_cast<PolygonChunk const*>(old_chunk);
00196 
00197     // change from me to me?
00198     // this assumes I haven't changed in the meantime. is that a valid assumption?
00199     if(old == this)
00200         return;
00201 
00202 // cullFace
00203 
00204     if(_sfCullFace.getValue() != old->_sfCullFace.getValue())
00205     {
00206         if(_sfCullFace.getValue() != GL_NONE)
00207         {
00208             glCullFace(_sfCullFace.getValue());
00209             glEnable(GL_CULL_FACE);
00210         }
00211         else  
00212         {
00213             glDisable(GL_CULL_FACE);
00214         }
00215     }
00216 
00217 // frontFace
00218 
00219     if(_sfFrontFace.getValue() != old->_sfFrontFace.getValue())
00220     {
00221         glFrontFace(_sfFrontFace.getValue());
00222     }
00223 
00224 // smooth
00225 
00226     if(_sfSmooth.getValue() != old->_sfSmooth.getValue())
00227     {
00228         if(_sfSmooth.getValue())   
00229         {
00230             glEnable(GL_POLYGON_SMOOTH);
00231         }
00232         else
00233         {
00234             glDisable(GL_POLYGON_SMOOTH);
00235         }
00236     }
00237 
00238 // mode
00239 
00240     if(_sfFrontMode.getValue() !=  old->_sfFrontMode.getValue())
00241         glPolygonMode(GL_FRONT, _sfFrontMode.getValue());
00242 
00243     if(_sfBackMode.getValue() !=  old->_sfBackMode.getValue())
00244         glPolygonMode(GL_BACK, _sfBackMode.getValue());
00245 
00246 // offset
00247 
00248     if(_sfOffsetFactor.getValue() != old->_sfOffsetFactor.getValue() ||
00249          _sfOffsetBias.getValue()   != old->_sfOffsetBias.getValue())
00250     {
00251         glPolygonOffset(_sfOffsetFactor.getValue(), _sfOffsetBias.getValue());
00252     }
00253 
00254     if(_sfOffsetPoint.getValue() != old->_sfOffsetPoint.getValue())
00255     {
00256         if(_sfOffsetPoint.getValue())  
00257         {
00258             glEnable(GL_POLYGON_OFFSET_POINT);
00259         }
00260         else                            
00261         {
00262             glDisable(GL_POLYGON_OFFSET_POINT);
00263         }
00264     }
00265 
00266     if(_sfOffsetLine.getValue() != old->_sfOffsetLine.getValue())
00267     {
00268         if(_sfOffsetLine.getValue())  
00269         {
00270             glEnable(GL_POLYGON_OFFSET_LINE);
00271         }
00272         else                            
00273         {
00274             glDisable(GL_POLYGON_OFFSET_LINE);
00275         }
00276     }
00277 
00278     if(_sfOffsetFill.getValue() != old->_sfOffsetFill.getValue())
00279     {
00280         if(_sfOffsetFill.getValue())  
00281         {
00282             glEnable(GL_POLYGON_OFFSET_FILL);
00283         }
00284         else                            
00285         {
00286             glDisable(GL_POLYGON_OFFSET_FILL);
00287         }
00288     }
00289 
00290 // stipple
00291 
00292     if(_mfStipple.getValues() != old->_mfStipple.getValues())
00293     {
00294         if(_mfStipple.size() == 32)
00295         {
00296             glPolygonStipple((const GLubyte *) &(_mfStipple[0]));
00297             glEnable(GL_POLYGON_STIPPLE);
00298         }
00299         else glDisable(GL_POLYGON_STIPPLE);
00300     }
00301 
00302 }

void PolygonChunk::deactivate DrawActionBase action,
UInt32  index = 0
[virtual]
 

Deactivate the chunk, i.e. set the OpenGl state covered by the chunk which is different from the default state to the default state.

Reimplemented from osg::StateChunk.

Definition at line 304 of file OSGPolygonChunk.cpp.

References osg::PolygonChunkBase::_mfStipple, osg::PolygonChunkBase::_sfBackMode, osg::PolygonChunkBase::_sfCullFace, osg::PolygonChunkBase::_sfFrontFace, osg::PolygonChunkBase::_sfFrontMode, osg::PolygonChunkBase::_sfOffsetFill, osg::PolygonChunkBase::_sfOffsetLine, osg::PolygonChunkBase::_sfOffsetPoint, osg::PolygonChunkBase::_sfSmooth, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00305 {
00306 
00307 // cullFace
00308 
00309     if(_sfCullFace.getValue() != GL_NONE)
00310         glDisable(GL_CULL_FACE);
00311 
00312 // frontFace
00313 
00314     if(_sfFrontFace.getValue() != GL_CCW)
00315         glFrontFace(GL_CCW);
00316 
00317 // smooth
00318 
00319     if(_sfSmooth.getValue())
00320         glDisable(GL_POLYGON_SMOOTH);
00321 
00322 // mode
00323 
00324     if(_sfFrontMode.getValue() != GL_FILL)
00325         glPolygonMode(GL_FRONT, GL_FILL);
00326 
00327     if(_sfBackMode.getValue() != GL_FILL)
00328         glPolygonMode(GL_BACK, GL_FILL);
00329 
00330 // offset
00331 
00332     if(_sfOffsetPoint.getValue())
00333         glDisable(GL_POLYGON_OFFSET_POINT);
00334 
00335     if(_sfOffsetLine.getValue())
00336         glDisable(GL_POLYGON_OFFSET_LINE);
00337 
00338     if(_sfOffsetFill.getValue())
00339         glDisable(GL_POLYGON_OFFSET_FILL);
00340 
00341 // stipple
00342 
00343     if(_mfStipple.size() == 32)
00344         glDisable(GL_POLYGON_STIPPLE);
00345 
00346 }

Real32 PolygonChunk::switchCost StateChunk chunk  )  [virtual]
 

Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0.

Reimplemented from osg::StateChunk.

Definition at line 351 of file OSGPolygonChunk.cpp.

00352 {
00353     return 0;
00354 }

bool PolygonChunk::operator< const StateChunk other  )  const [virtual]
 

Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0.

Reimplemented from osg::StateChunk.

Definition at line 356 of file OSGPolygonChunk.cpp.

00357 {
00358     return this < &other;
00359 }

bool PolygonChunk::operator== const StateChunk other  )  const [virtual]
 

Compare two chunks. In most cases not implemented yet, will return false.

Reimplemented from osg::StateChunk.

Definition at line 361 of file OSGPolygonChunk.cpp.

References osg::PolygonChunkBase::getBackMode(), osg::PolygonChunkBase::getCullFace(), osg::PolygonChunkBase::getFrontFace(), osg::PolygonChunkBase::getFrontMode(), osg::PolygonChunkBase::getOffsetBias(), osg::PolygonChunkBase::getOffsetFactor(), osg::PolygonChunkBase::getOffsetFill(), osg::PolygonChunkBase::getOffsetLine(), osg::PolygonChunkBase::getOffsetPoint(), osg::PolygonChunkBase::getSmooth(), osg::PolygonChunkBase::getStipple(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00362 {
00363     PolygonChunk const *tother = dynamic_cast<PolygonChunk const*>(&other);
00364 
00365     if(!tother)
00366         return false;
00367 
00368     if(tother == this)
00369         return true;
00370 
00371     if(getCullFace()       != tother->getCullFace()      ||
00372        getFrontFace()      != tother->getFrontFace()     ||
00373        getSmooth()         != tother->getSmooth()        ||
00374        getFrontMode()      != tother->getFrontMode()     ||
00375        getBackMode()       != tother->getBackMode()      ||
00376        getOffsetPoint()    != tother->getOffsetPoint()   ||
00377        getOffsetLine()     != tother->getOffsetLine()    ||
00378        getOffsetFill()     != tother->getOffsetFill()    ||
00379        getOffsetFactor()   != tother->getOffsetFactor()  ||
00380        getOffsetBias()     != tother->getOffsetBias()    ||
00381        getStipple().size() != tother->getStipple().size()
00382       )
00383         return false;
00384 
00385     // would need to compare the whole stipple data
00386     // cheap trick: if != 0 take as different
00387     
00388     if(        getStipple().size() != 0 ||
00389        tother->getStipple().size() != 0 
00390       )
00391         return false;
00392 
00393     return true;
00394 }

bool PolygonChunk::operator!= const StateChunk other  )  const [virtual]
 

Calculate how expensive it is to switch from one instance of the chunk class to another. In most cases not implemented yet, will return 0.

Reimplemented from osg::StateChunk.

Definition at line 396 of file OSGPolygonChunk.cpp.

00397 {
00398     return !(*this == other);
00399 }

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

Reimplemented from osg::StateChunk.

Definition at line 87 of file OSGPolygonChunk.cpp.

00088 {
00089 }

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

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

Reimplemented from osg::StateChunkBase.

Definition at line 58 of file OSGPolygonChunkBase.inl.

References osg::PolygonChunkBase::_type.

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

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 65 of file OSGPolygonChunkBase.inl.

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

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

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

Reimplemented from osg::StateChunkBase.

Definition at line 224 of file OSGPolygonChunkBase.cpp.

References osg::PolygonChunkBase::_type.

00225 {
00226     return _type; 
00227 }