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

osg::LineChunkBase Class Reference

LineChunk Base Class.

#include <OSGLineChunkBase.h>

Inheritance diagram for osg::LineChunkBase:

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

Public Types

typedef LineChunkPtr Ptr
enum  {
  WidthFieldId = Inherited::NextFieldId, StippleRepeatFieldId = WidthFieldId + 1, StipplePatternFieldId = StippleRepeatFieldId + 1, SmoothFieldId = StipplePatternFieldId + 1,
  NextFieldId = SmoothFieldId + 1
}

Public Member Functions

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
Parents
*MFFieldContainerPtrgetParents (void)
const MFFieldContainerPtrgetParents (void) const
MFFieldContainerPtrgetMFParents (void)
void addParent (FieldContainerPtr parent)
void subParent (FieldContainerPtr parent)
Int32 findParent (FieldContainerPtr parent)
Parents
*SFBoolgetInternal (void)
const SFBoolgetInternal (void) const
SFBoolgetSFInternal (void)
void setInternal (bool bVal)
FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFReal32getSFWidth (void)
 Get the LineChunk::_sfWidth field.
SFInt32getSFStippleRepeat (void)
 Get the LineChunk::_sfStippleRepeat field.
SFUInt16getSFStipplePattern (void)
 Get the LineChunk::_sfStipplePattern field.
SFBoolgetSFSmooth (void)
 Get the LineChunk::_sfSmooth field.
Real32getWidth (void)
 Get the value of the LineChunk::_sfWidth field.
const Real32getWidth (void) const
 Get the value of the LineChunk::_sfWidth field.
Int32getStippleRepeat (void)
 Get the value of the LineChunk::_sfStippleRepeat field.
const Int32getStippleRepeat (void) const
 Get the value of the LineChunk::_sfStippleRepeat field.
UInt16getStipplePattern (void)
 Get the value of the LineChunk::_sfStipplePattern field.
const UInt16getStipplePattern (void) const
 Get the value of the LineChunk::_sfStipplePattern field.
bool & getSmooth (void)
 Get the value of the LineChunk::_sfSmooth field.
const bool & getSmooth (void) const
 Get the value of the LineChunk::_sfSmooth field.
Field Set
*void setWidth (const Real32 &value)
 Set the value of the LineChunk::_sfWidth field.
void setStippleRepeat (const Int32 &value)
 Set the value of the LineChunk::_sfStippleRepeat field.
void setStipplePattern (const UInt16 &value)
 Set the value of the LineChunk::_sfStipplePattern field.
void setSmooth (const bool &value)
 Set the value of the LineChunk::_sfSmooth 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
Parents
*MFFieldContainerPtrgetParents (void)
const MFFieldContainerPtrgetParents (void) const
MFFieldContainerPtrgetMFParents (void)
void addParent (FieldContainerPtr parent)
void subParent (FieldContainerPtr parent)
Int32 findParent (FieldContainerPtr parent)
Parents
*SFBoolgetInternal (void)
const SFBoolgetInternal (void) const
SFBoolgetSFInternal (void)
void setInternal (bool bVal)
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
Parents
*MFFieldContainerPtrgetParents (void)
const MFFieldContainerPtrgetParents (void) const
MFFieldContainerPtrgetMFParents (void)
void addParent (FieldContainerPtr parent)
void subParent (FieldContainerPtr parent)
Int32 findParent (FieldContainerPtr parent)
Parents
*SFBoolgetInternal (void)
const SFBoolgetInternal (void) const
SFBoolgetSFInternal (void)
void setInternal (bool bVal)

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 LineChunkPtr create (void)
 create a new instance of the class
static LineChunkPtr 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 Chunk Class Access
*static UInt32 getStaticClassId (void)
static const StateChunkClassgetStaticClass (void)

Static Public Attributes

static const osg::BitVector WidthFieldMask
static const osg::BitVector StippleRepeatFieldMask
static const osg::BitVector StipplePatternFieldMask
static const osg::BitVector SmoothFieldMask
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

Sync
*void executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (Attachment *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Constructors
LineChunkBase (void)
 LineChunkBase (const LineChunkBase &source)
Destructors
*virtual ~LineChunkBase (void)
Sync
*void executeSyncImpl (LineChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (Attachment *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Sync
*void executeSyncImpl (StateChunkBase *pOther, const BitVector &whichField)
Sync
void executeSyncImpl (Attachment *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)

Static Protected Member Functions

static void initMethod (void)

Protected Attributes

Fields
*SFBool _sfInternal
MFFieldContainerPtr _parents
Fields
*SFReal32 _sfWidth
SFInt32 _sfStippleRepeat
SFUInt16 _sfStipplePattern
SFBool _sfSmooth
Fields
*SFBool _sfInternal
MFFieldContainerPtr _parents
Fields
*SFBool _sfInternal
MFFieldContainerPtr _parents

Private Types

typedef StateChunk Inherited

Private Member Functions

void operator= (const LineChunkBase &source)

Static Private Attributes

static FieldDescription_desc []
 LineChunk description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 84 of file OSGLineChunkBase.h.


Member Typedef Documentation

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

Reimplemented from osg::StateChunk.

Reimplemented in osg::LineChunk.

Definition at line 88 of file OSGLineChunkBase.h.

typedef LineChunkPtr osg::LineChunkBase::Ptr
 

Reimplemented from osg::StateChunkBase.

Definition at line 93 of file OSGLineChunkBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
WidthFieldId 
StippleRepeatFieldId 
StipplePatternFieldId 
SmoothFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 95 of file OSGLineChunkBase.h.

00096     {
00097         WidthFieldId          = Inherited::NextFieldId,
00098         StippleRepeatFieldId  = WidthFieldId          + 1,
00099         StipplePatternFieldId = StippleRepeatFieldId  + 1,
00100         SmoothFieldId         = StipplePatternFieldId + 1,
00101         NextFieldId           = SmoothFieldId         + 1
00102     };


Constructor & Destructor Documentation

LineChunkBase::LineChunkBase void   )  [protected]
 

Definition at line 198 of file OSGLineChunkBase.cpp.

00198                                  :
00199     _sfWidth                  (Real32(1)), 
00200     _sfStippleRepeat          (Int32(1)), 
00201     _sfStipplePattern         (UInt16(0xffff)), 
00202     _sfSmooth                 (bool(GL_FALSE)), 
00203     Inherited() 
00204 {
00205 }

LineChunkBase::LineChunkBase const LineChunkBase source  )  [protected]
 

Definition at line 211 of file OSGLineChunkBase.cpp.

00211                                                         :
00212     _sfWidth                  (source._sfWidth                  ), 
00213     _sfStippleRepeat          (source._sfStippleRepeat          ), 
00214     _sfStipplePattern         (source._sfStipplePattern         ), 
00215     _sfSmooth                 (source._sfSmooth                 ), 
00216     Inherited                 (source)
00217 {
00218 }

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

Definition at line 222 of file OSGLineChunkBase.cpp.

00223 {
00224 }


Member Function Documentation

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

Reimplemented from osg::StateChunkBase.

Definition at line 58 of file OSGLineChunkBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 65 of file OSGLineChunkBase.inl.

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

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

FieldContainerType & LineChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 140 of file OSGLineChunkBase.cpp.

References _type.

00141 {
00142     return _type; 
00143 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 145 of file OSGLineChunkBase.cpp.

References _type.

00146 {
00147     return _type;
00148 } 

UInt32 LineChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 160 of file OSGLineChunkBase.cpp.

00161 { 
00162     return sizeof(LineChunk); 
00163 }

SFReal32 * osg::LineChunkBase::getSFWidth void   )  [inline]
 

Definition at line 101 of file OSGLineChunkBase.inl.

References _sfWidth.

00102 {
00103     return &_sfWidth;
00104 }

SFInt32 * osg::LineChunkBase::getSFStippleRepeat void   )  [inline]
 

Definition at line 108 of file OSGLineChunkBase.inl.

References _sfStippleRepeat.

00109 {
00110     return &_sfStippleRepeat;
00111 }

SFUInt16 * osg::LineChunkBase::getSFStipplePattern void   )  [inline]
 

Definition at line 115 of file OSGLineChunkBase.inl.

References _sfStipplePattern.

00116 {
00117     return &_sfStipplePattern;
00118 }

SFBool * osg::LineChunkBase::getSFSmooth void   )  [inline]
 

Definition at line 122 of file OSGLineChunkBase.inl.

References _sfSmooth.

00123 {
00124     return &_sfSmooth;
00125 }

Real32 & osg::LineChunkBase::getWidth void   )  [inline]
 

Definition at line 130 of file OSGLineChunkBase.inl.

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

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

00131 {
00132     return _sfWidth.getValue();
00133 }

const Real32 & osg::LineChunkBase::getWidth void   )  const [inline]
 

Definition at line 137 of file OSGLineChunkBase.inl.

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

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

Int32 & osg::LineChunkBase::getStippleRepeat void   )  [inline]
 

Definition at line 151 of file OSGLineChunkBase.inl.

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

00152 {
00153     return _sfStippleRepeat.getValue();
00154 }

const Int32 & osg::LineChunkBase::getStippleRepeat void   )  const [inline]
 

Definition at line 158 of file OSGLineChunkBase.inl.

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

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

UInt16 & osg::LineChunkBase::getStipplePattern void   )  [inline]
 

Definition at line 172 of file OSGLineChunkBase.inl.

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

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

00173 {
00174     return _sfStipplePattern.getValue();
00175 }

const UInt16 & osg::LineChunkBase::getStipplePattern void   )  const [inline]
 

Definition at line 179 of file OSGLineChunkBase.inl.

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

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

bool & osg::LineChunkBase::getSmooth void   )  [inline]
 

Definition at line 193 of file OSGLineChunkBase.inl.

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

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

00194 {
00195     return _sfSmooth.getValue();
00196 }

const bool & osg::LineChunkBase::getSmooth void   )  const [inline]
 

Definition at line 200 of file OSGLineChunkBase.inl.

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

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

void osg::LineChunkBase::setWidth const Real32 value  )  [inline]
 

Definition at line 144 of file OSGLineChunkBase.inl.

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

00145 {
00146     _sfWidth.setValue(value);
00147 }

void osg::LineChunkBase::setStippleRepeat const Int32 value  )  [inline]
 

Definition at line 165 of file OSGLineChunkBase.inl.

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

00166 {
00167     _sfStippleRepeat.setValue(value);
00168 }

void osg::LineChunkBase::setStipplePattern const UInt16 value  )  [inline]
 

Definition at line 186 of file OSGLineChunkBase.inl.

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

00187 {
00188     _sfStipplePattern.setValue(value);
00189 }

void osg::LineChunkBase::setSmooth const bool &  value  )  [inline]
 

Definition at line 207 of file OSGLineChunkBase.inl.

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

00208 {
00209     _sfSmooth.setValue(value);
00210 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 228 of file OSGLineChunkBase.cpp.

References _sfSmooth, _sfStipplePattern, _sfStippleRepeat, _sfWidth, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::StateChunkBase::getBinSize(), osg::FieldBits::NoField, SmoothFieldMask, StipplePatternFieldMask, StippleRepeatFieldMask, and WidthFieldMask.

00229 {
00230     UInt32 returnValue = Inherited::getBinSize(whichField);
00231 
00232     if(FieldBits::NoField != (WidthFieldMask & whichField))
00233     {
00234         returnValue += _sfWidth.getBinSize();
00235     }
00236 
00237     if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00238     {
00239         returnValue += _sfStippleRepeat.getBinSize();
00240     }
00241 
00242     if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00243     {
00244         returnValue += _sfStipplePattern.getBinSize();
00245     }
00246 
00247     if(FieldBits::NoField != (SmoothFieldMask & whichField))
00248     {
00249         returnValue += _sfSmooth.getBinSize();
00250     }
00251 
00252 
00253     return returnValue;
00254 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 256 of file OSGLineChunkBase.cpp.

References _sfSmooth, _sfStipplePattern, _sfStippleRepeat, _sfWidth, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::StateChunkBase::copyToBin(), osg::FieldBits::NoField, SmoothFieldMask, StipplePatternFieldMask, StippleRepeatFieldMask, and WidthFieldMask.

00258 {
00259     Inherited::copyToBin(pMem, whichField);
00260 
00261     if(FieldBits::NoField != (WidthFieldMask & whichField))
00262     {
00263         _sfWidth.copyToBin(pMem);
00264     }
00265 
00266     if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00267     {
00268         _sfStippleRepeat.copyToBin(pMem);
00269     }
00270 
00271     if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00272     {
00273         _sfStipplePattern.copyToBin(pMem);
00274     }
00275 
00276     if(FieldBits::NoField != (SmoothFieldMask & whichField))
00277     {
00278         _sfSmooth.copyToBin(pMem);
00279     }
00280 
00281 
00282 }

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

Reimplemented from osg::StateChunkBase.

Definition at line 284 of file OSGLineChunkBase.cpp.

References _sfSmooth, _sfStipplePattern, _sfStippleRepeat, _sfWidth, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::StateChunkBase::copyFromBin(), osg::FieldBits::NoField, SmoothFieldMask, StipplePatternFieldMask, StippleRepeatFieldMask, and WidthFieldMask.

00286 {
00287     Inherited::copyFromBin(pMem, whichField);
00288 
00289     if(FieldBits::NoField != (WidthFieldMask & whichField))
00290     {
00291         _sfWidth.copyFromBin(pMem);
00292     }
00293 
00294     if(FieldBits::NoField != (StippleRepeatFieldMask & whichField))
00295     {
00296         _sfStippleRepeat.copyFromBin(pMem);
00297     }
00298 
00299     if(FieldBits::NoField != (StipplePatternFieldMask & whichField))
00300     {
00301         _sfStipplePattern.copyFromBin(pMem);
00302     }
00303 
00304     if(FieldBits::NoField != (SmoothFieldMask & whichField))
00305     {
00306         _sfSmooth.copyFromBin(pMem);
00307     }
00308 
00309 
00310 }

LineChunkPtr osg::LineChunkBase::create void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 72 of file OSGLineChunkBase.inl.

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

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

LineChunkPtr osg::LineChunkBase::createEmpty void   )  [inline, static]
 

Reimplemented from osg::Attachment.

Definition at line 87 of file OSGLineChunkBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr LineChunkBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::Attachment.

Definition at line 151 of file OSGLineChunkBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00152 { 
00153     LineChunkPtr returnValue; 
00154 
00155     newPtr(returnValue, dynamic_cast<const LineChunk *>(this)); 
00156 
00157     return returnValue; 
00158 }

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

Definition at line 313 of file OSGLineChunkBase.cpp.

References _sfSmooth, _sfStipplePattern, _sfStippleRepeat, _sfWidth, osg::StateChunkBase::executeSyncImpl(), osg::FieldBits::NoField, SmoothFieldMask, StipplePatternFieldMask, StippleRepeatFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), and WidthFieldMask.

Referenced by executeSync().

00315 {
00316 
00317     Inherited::execute