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

osg::LightChunkBase Class Reference

LightChunk Base Class.

#include <OSGLightChunkBase.h>

Inheritance diagram for osg::LightChunkBase:

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

Public Types

typedef LightChunkPtr Ptr
enum  {
  DiffuseFieldId = Inherited::NextFieldId, AmbientFieldId = DiffuseFieldId + 1, SpecularFieldId = AmbientFieldId + 1, PositionFieldId = SpecularFieldId + 1,
  DirectionFieldId = PositionFieldId + 1, ExponentFieldId = DirectionFieldId + 1, CutoffFieldId = ExponentFieldId + 1, ConstantAttenuationFieldId = CutoffFieldId + 1,
  LinearAttenuationFieldId = ConstantAttenuationFieldId + 1, QuadraticAttenuationFieldId = LinearAttenuationFieldId + 1, NextFieldId = QuadraticAttenuationFieldId + 1
}

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFColor4fgetSFDiffuse (void)
 Get the LightChunk::_sfDiffuse field.
SFColor4fgetSFAmbient (void)
 Get the LightChunk::_sfAmbient field.
SFColor4fgetSFSpecular (void)
 Get the LightChunk::_sfSpecular field.
SFVec4fgetSFPosition (void)
 Get the LightChunk::_sfPosition field.
SFVec3fgetSFDirection (void)
 Get the LightChunk::_sfDirection field.
SFReal32getSFExponent (void)
 Get the LightChunk::_sfExponent field.
SFReal32getSFCutoff (void)
 Get the LightChunk::_sfCutoff field.
SFReal32getSFConstantAttenuation (void)
 Get the LightChunk::_sfConstantAttenuation field.
SFReal32getSFLinearAttenuation (void)
 Get the LightChunk::_sfLinearAttenuation field.
SFReal32getSFQuadraticAttenuation (void)
 Get the LightChunk::_sfQuadraticAttenuation field.
Color4fgetDiffuse (void)
 Get the value of the LightChunk::_sfDiffuse field.
const Color4fgetDiffuse (void) const
 Get the value of the LightChunk::_sfDiffuse field.
Color4fgetAmbient (void)
 Get the value of the LightChunk::_sfAmbient field.
const Color4fgetAmbient (void) const
 Get the value of the LightChunk::_sfAmbient field.
Color4fgetSpecular (void)
 Get the value of the LightChunk::_sfSpecular field.
const Color4fgetSpecular (void) const
 Get the value of the LightChunk::_sfSpecular field.
Vec4fgetPosition (void)
 Get the value of the LightChunk::_sfPosition field.
const Vec4fgetPosition (void) const
 Get the value of the LightChunk::_sfPosition field.
Vec3fgetDirection (void)
 Get the value of the LightChunk::_sfDirection field.
const Vec3fgetDirection (void) const
 Get the value of the LightChunk::_sfDirection field.
Real32getExponent (void)
 Get the value of the LightChunk::_sfExponent field.
const Real32getExponent (void) const
 Get the value of the LightChunk::_sfExponent field.
Real32getCutoff (void)
 Get the value of the LightChunk::_sfCutoff field.
const Real32getCutoff (void) const
 Get the value of the LightChunk::_sfCutoff field.
Real32getConstantAttenuation (void)
 Get the value of the LightChunk::_sfConstantAttenuation field.
const Real32getConstantAttenuation (void) const
 Get the value of the LightChunk::_sfConstantAttenuation field.
Real32getLinearAttenuation (void)
 Get the value of the LightChunk::_sfLinearAttenuation field.
const Real32getLinearAttenuation (void) const
 Get the value of the LightChunk::_sfLinearAttenuation field.
Real32getQuadraticAttenuation (void)
 Get the value of the LightChunk::_sfQuadraticAttenuation field.
const Real32getQuadraticAttenuation (void) const
 Get the value of the LightChunk::_sfQuadraticAttenuation field.
Field Set
*void setDiffuse (const Color4f &value)
 Set the value of the LightChunk::_sfDiffuse field.
void setAmbient (const Color4f &value)
 Set the value of the LightChunk::_sfAmbient field.
void setSpecular (const Color4f &value)
 Set the value of the LightChunk::_sfSpecular field.
void setPosition (const Vec4f &value)
 Set the value of the LightChunk::_sfPosition field.
void setDirection (const Vec3f &value)
 Set the value of the LightChunk::_sfDirection field.
void setExponent (const Real32 &value)
 Set the value of the LightChunk::_sfExponent field.
void setCutoff (const Real32 &value)
 Set the value of the LightChunk::_sfCutoff field.
void setConstantAttenuation (const Real32 &value)
 Set the value of the LightChunk::_sfConstantAttenuation field.
void setLinearAttenuation (const Real32 &value)
 Set the value of the LightChunk::_sfLinearAttenuation field.
void setQuadraticAttenuation (const Real32 &value)
 Set the value of the LightChunk::_sfQuadraticAttenuation 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

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static LightChunkPtr create (void)
 create a new instance of the class
static LightChunkPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype

Static Public Attributes

static const osg::BitVector DiffuseFieldMask
static const osg::BitVector AmbientFieldMask
static const osg::BitVector SpecularFieldMask
static const osg::BitVector PositionFieldMask
static const osg::BitVector DirectionFieldMask
static const osg::BitVector ExponentFieldMask
static const osg::BitVector CutoffFieldMask
static const osg::BitVector ConstantAttenuationFieldMask
static const osg::BitVector LinearAttenuationFieldMask
static const osg::BitVector QuadraticAttenuationFieldMask
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
LightChunkBase (void)
 LightChunkBase (const LightChunkBase &source)
Destructors
*virtual ~LightChunkBase (void)
Sync
*void executeSyncImpl (LightChunkBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)

Static Protected Member Functions

static void initMethod (void)

Protected Attributes

Fields
*SFColor4f _sfDiffuse
SFColor4f _sfAmbient
SFColor4f _sfSpecular
SFVec4f _sfPosition
SFVec3f _sfDirection
SFReal32 _sfExponent
SFReal32 _sfCutoff
SFReal32 _sfConstantAttenuation
SFReal32 _sfLinearAttenuation
SFReal32 _sfQuadraticAttenuation

Private Types

typedef StateChunk Inherited

Private Member Functions

void operator= (const LightChunkBase &source)

Static Private Attributes

static FieldDescription_desc []
 LightChunk description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 90 of file OSGLightChunkBase.h.


Member Typedef Documentation

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

Reimplemented from osg::StateChunk.

Reimplemented in osg::LightChunk.

Definition at line 94 of file OSGLightChunkBase.h.

typedef LightChunkPtr osg::LightChunkBase::Ptr
 

Reimplemented from osg::StateChunkBase.

Definition at line 99 of file OSGLightChunkBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
DiffuseFieldId 
AmbientFieldId 
SpecularFieldId 
PositionFieldId 
DirectionFieldId 
ExponentFieldId 
CutoffFieldId 
ConstantAttenuationFieldId 
LinearAttenuationFieldId 
QuadraticAttenuationFieldId 
NextFieldId 

Reimplemented from osg::Attachment.

Definition at line 101 of file OSGLightChunkBase.h.

00102     {
00103         DiffuseFieldId              = Inherited::NextFieldId,
00104         AmbientFieldId              = DiffuseFieldId              + 1,
00105         SpecularFieldId             = AmbientFieldId              + 1,
00106         PositionFieldId             = SpecularFieldId             + 1,
00107         DirectionFieldId            = PositionFieldId             + 1,
00108         ExponentFieldId             = DirectionFieldId            + 1,
00109         CutoffFieldId               = ExponentFieldId             + 1,
00110         ConstantAttenuationFieldId  = CutoffFieldId               + 1,
00111         LinearAttenuationFieldId    = ConstantAttenuationFieldId  + 1,
00112         QuadraticAttenuationFieldId = LinearAttenuationFieldId    + 1,
00113         NextFieldId                 = QuadraticAttenuationFieldId + 1
00114     };


Constructor & Destructor Documentation

LightChunkBase::LightChunkBase void   )  [protected]
 

Definition at line 263 of file OSGLightChunkBase.cpp.

00263                                    :
00264     _sfDiffuse                (Color4f(1,1,1,0)), 
00265     _sfAmbient                (Color4f(.1,.1,.1,0)), 
00266     _sfSpecular               (Color4f(1,1,1,0)), 
00267     _sfPosition               (Vec4f(0,-1,0,0)), 
00268     _sfDirection              (Vec3f(0,0,1)), 
00269     _sfExponent               (Real32(2)), 
00270     _sfCutoff                 (Real32(180)), 
00271     _sfConstantAttenuation    (Real32(1)), 
00272     _sfLinearAttenuation      (Real32(0)), 
00273     _sfQuadraticAttenuation   (Real32(0)), 
00274     Inherited() 
00275 {
00276 }

LightChunkBase::LightChunkBase const LightChunkBase source  )  [protected]
 

Definition at line 282 of file OSGLightChunkBase.cpp.

00282                                                            :
00283     _sfDiffuse                (source._sfDiffuse                ), 
00284     _sfAmbient                (source._sfAmbient                ), 
00285     _sfSpecular               (source._sfSpecular               ), 
00286     _sfPosition               (source._sfPosition               ), 
00287     _sfDirection              (source._sfDirection              ), 
00288     _sfExponent               (source._sfExponent               ), 
00289     _sfCutoff                 (source._sfCutoff                 ), 
00290     _sfConstantAttenuation    (source._sfConstantAttenuation    ), 
00291     _sfLinearAttenuation      (source._sfLinearAttenuation      ), 
00292     _sfQuadraticAttenuation   (source._sfQuadraticAttenuation   ), 
00293     Inherited                 (source)
00294 {
00295 }

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

Definition at line 299 of file OSGLightChunkBase.cpp.

00300 {
00301 }


Member Function Documentation

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

Reimplemented from osg::StateChunkBase.

Definition at line 58 of file OSGLightChunkBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 65 of file OSGLightChunkBase.inl.

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

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

FieldContainerType & LightChunkBase::getType void   )  [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 205 of file OSGLightChunkBase.cpp.

References _type.

00206 {
00207     return _type; 
00208 } 

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

Reimplemented from osg::StateChunkBase.

Definition at line 210 of file OSGLightChunkBase.cpp.

References _type.

00211 {
00212     return _type;
00213 } 

UInt32 LightChunkBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::StateChunkBase.

Definition at line 225 of file OSGLightChunkBase.cpp.

00226 { 
00227     return sizeof(LightChunk); 
00228 }

SFColor4f * osg::LightChunkBase::getSFDiffuse void   )  [inline]
 

Definition at line 101 of file OSGLightChunkBase.inl.

References _sfDiffuse.

00102 {
00103     return &_sfDiffuse;
00104 }

SFColor4f * osg::LightChunkBase::getSFAmbient void   )  [inline]
 

Definition at line 108 of file OSGLightChunkBase.inl.

References _sfAmbient.

00109 {
00110     return &_sfAmbient;
00111 }

SFColor4f * osg::LightChunkBase::getSFSpecular void   )  [inline]
 

Definition at line 115 of file OSGLightChunkBase.inl.

References _sfSpecular.

00116 {
00117     return &_sfSpecular;
00118 }

SFVec4f * osg::LightChunkBase::getSFPosition void   )  [inline]
 

Definition at line 122 of file OSGLightChunkBase.inl.

References _sfPosition.

00123 {
00124     return &_sfPosition;
00125 }

SFVec3f * osg::LightChunkBase::getSFDirection void   )  [inline]
 

Definition at line 129 of file OSGLightChunkBase.inl.

References _sfDirection.

00130 {
00131     return &_sfDirection;
00132 }

SFReal32 * osg::LightChunkBase::getSFExponent void   )  [inline]
 

Definition at line 136 of file OSGLightChunkBase.inl.

References _sfExponent.

00137 {
00138     return &_sfExponent;
00139 }

SFReal32 * osg::LightChunkBase::getSFCutoff void   )  [inline]
 

Definition at line 143 of file OSGLightChunkBase.inl.

References _sfCutoff.

00144 {
00145     return &_sfCutoff;
00146 }

SFReal32 * osg::LightChunkBase::getSFConstantAttenuation void   )  [inline]
 

Definition at line 150 of file OSGLightChunkBase.inl.

References _sfConstantAttenuation.

00151 {
00152     return &_sfConstantAttenuation;
00153 }

SFReal32 * osg::LightChunkBase::getSFLinearAttenuation void   )  [inline]
 

Definition at line 157 of file OSGLightChunkBase.inl.

References _sfLinearAttenuation.

00158 {
00159     return &_sfLinearAttenuation;
00160 }

SFReal32 * osg::LightChunkBase::getSFQuadraticAttenuation void   )  [inline]
 

Definition at line 164 of file OSGLightChunkBase.inl.

References _sfQuadraticAttenuation.

00165 {
00166     return &_sfQuadraticAttenuation;
00167 }

Color4f & osg::LightChunkBase::getDiffuse void   )  [inline]
 

Definition at line 172 of file OSGLightChunkBase.inl.

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

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

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

const Color4f & osg::LightChunkBase::getDiffuse void   )  const [inline]
 

Definition at line 179 of file OSGLightChunkBase.inl.

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

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

Color4f & osg::LightChunkBase::getAmbient void   )  [inline]
 

Definition at line 193 of file OSGLightChunkBase.inl.

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

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

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

const Color4f & osg::LightChunkBase::getAmbient void   )  const [inline]
 

Definition at line 200 of file OSGLightChunkBase.inl.

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

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

Color4f & osg::LightChunkBase::getSpecular void   )  [inline]
 

Definition at line 214 of file OSGLightChunkBase.inl.

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

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

00215 {
00216     return _sfSpecular.getValue();
00217 }

const Color4f & osg::LightChunkBase::getSpecular void   )  const [inline]
 

Definition at line 221 of file OSGLightChunkBase.inl.

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

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

Vec4f & osg::LightChunkBase::getPosition void   )  [inline]
 

Definition at line 235 of file OSGLightChunkBase.inl.

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

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

00236 {
00237     return _sfPosition.getValue();
00238 }

const Vec4f & osg::LightChunkBase::getPosition void   )  const [inline]
 

Definition at line 242 of file OSGLightChunkBase.inl.

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

00243 {
00244     return _sfPosition.getValue();
00245 }

Vec3f & osg::LightChunkBase::getDirection void   )  [inline]
 

Definition at line 256 of file OSGLightChunkBase.inl.

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

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

00257 {
00258     return _sfDirection.getValue();
00259 }

const Vec3f & osg::LightChunkBase::getDirection void   )  const [inline]
 

Definition at line 263 of file OSGLightChunkBase.inl.

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

00264 {
00265     return _sfDirection.getValue();
00266 }

Real32 & osg::LightChunkBase::getExponent void   )  [inline]
 

Definition at line 277 of file OSGLightChunkBase.inl.

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

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

00278 {
00279     return _sfExponent.getValue();
00280 }

const Real32 & osg::LightChunkBase::getExponent void   )  const [inline]
 

Definition at line 284 of file OSGLightChunkBase.inl.

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

00285 {
00286     return _sfExponent.getValue();
00287 }

Real32 & osg::LightChunkBase::getCutoff void   )  [inline]
 

Definition at line 298 of file OSGLightChunkBase.inl.

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

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

00299 {
00300     return _sfCutoff.getValue();
00301 }

const Real32 & osg::LightChunkBase::getCutoff void   )  const [inline]
 

Definition at line 305 of file OSGLightChunkBase.inl.

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

00306 {
00307     return _sfCutoff.getValue();
00308 }

Real32 & osg::LightChunkBase::getConstantAttenuation void   )  [inline]
 

Definition at line 319 of file OSGLightChunkBase.inl.

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

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

00320 {
00321     return _sfConstantAttenuation.getValue();
00322 }

const Real32 & osg::LightChunkBase::getConstantAttenuation void   )  const [inline]
 

Definition at line 326 of file OSGLightChunkBase.inl.

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

00327 {
00328     return _sfConstantAttenuation.getValue();
00329 }

Real32 & osg::LightChunkBase::getLinearAttenuation void   )  [inline]
 

Definition at line 340 of file OSGLightChunkBase.inl.

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

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

00341 {
00342     return _sfLinearAttenuation.getValue();
00343 }

const Real32 & osg::LightChunkBase::getLinearAttenuation void   )  const [inline]
 

Definition at line 347 of file OSGLightChunkBase.inl.

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

00348 {
00349     return _sfLinearAttenuation.getValue();
00350 }

Real32 & osg::LightChunkBase::getQuadraticAttenuation void   )  [inline]
 

Definition at line 361 of file OSGLightChunkBase.inl.

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

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

00362 {
00363     return _sfQuadraticAttenuation.getValue();
00364 }

const Real32 & osg::LightChunkBase::getQuadraticAttenuation void   )  const [inline]
 

Definition at line 368 of file OSGLightChunkBase.inl.

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

00369 {
00370     return _sfQuadraticAttenuation.getValue();
00371 }

void osg::LightChunkBase::setDiffuse const Color4f value  )  [inline]
 

Definition at line 186 of file OSGLightChunkBase.inl.

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

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

void osg::LightChunkBase::setAmbient const Color4f value  )  [inline]
 

Definition at line 207 of file OSGLightChunkBase.inl.

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

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

void osg::LightChunkBase::setSpecular const Color4f value  )  [inline]
 

Definition at line 228 of file OSGLightChunkBase.inl.

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

00229 {
00230     _sfSpecular.setValue(value);
00231 }

void osg::LightChunkBase::setPosition const Vec4f value  )  [inline]
 

Definition at line 249 of file OSGLightChunkBase.inl.

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

00250 {
00251     _sfPosition.setValue(value);
00252 }

void osg::LightChunkBase::setDirection const Vec3f value  )  [inline]
 

Definition at line 270 of file OSGLightChunkBase.inl.

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

00271 {
00272