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

osg::LightBase Class Reference

Light Base Class.

#include <OSGLightBase.h>

Inheritance diagram for osg::LightBase:

osg::NodeCore osg::AttachmentContainer osg::FieldContainer osg::Light osg::DirectionalLightBase osg::PointLightBase osg::DirectionalLight osg::PointLight osg::SpotLightBase osg::SpotLight List of all members.

Public Types

typedef LightPtr Ptr
enum  {
  AmbientFieldId = Inherited::NextFieldId, DiffuseFieldId = AmbientFieldId + 1, SpecularFieldId = DiffuseFieldId + 1, BeaconFieldId = SpecularFieldId + 1,
  OnFieldId = BeaconFieldId + 1, ConstantAttenuationFieldId = OnFieldId + 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
*SFColor4fgetSFAmbient (void)
 Get the Light::_sfAmbient field.
SFColor4fgetSFDiffuse (void)
 Get the Light::_sfDiffuse field.
SFColor4fgetSFSpecular (void)
 Get the Light::_sfSpecular field.
SFNodePtrgetSFBeacon (void)
 Get the Light::_sfBeacon field.
SFBoolgetSFOn (void)
 Get the Light::_sfOn field.
SFReal32getSFConstantAttenuation (void)
 Get the Light::_sfConstantAttenuation field.
SFReal32getSFLinearAttenuation (void)
 Get the Light::_sfLinearAttenuation field.
SFReal32getSFQuadraticAttenuation (void)
 Get the Light::_sfQuadraticAttenuation field.
Color4fgetAmbient (void)
 Get the value of the Light::_sfAmbient field.
const Color4fgetAmbient (void) const
 Get the value of the Light::_sfAmbient field.
Color4fgetDiffuse (void)
 Get the value of the Light::_sfDiffuse field.
const Color4fgetDiffuse (void) const
 Get the value of the Light::_sfDiffuse field.
Color4fgetSpecular (void)
 Get the value of the Light::_sfSpecular field.
const Color4fgetSpecular (void) const
 Get the value of the Light::_sfSpecular field.
NodePtrgetBeacon (void)
 Get the value of the Light::_sfBeacon field.
const NodePtrgetBeacon (void) const
 Get the value of the Light::_sfBeacon field.
bool & getOn (void)
 Get the value of the Light::_sfOn field.
const bool & getOn (void) const
 Get the value of the Light::_sfOn field.
Real32getConstantAttenuation (void)
 Get the value of the Light::_sfConstantAttenuation field.
const Real32getConstantAttenuation (void) const
 Get the value of the Light::_sfConstantAttenuation field.
Real32getLinearAttenuation (void)
 Get the value of the Light::_sfLinearAttenuation field.
const Real32getLinearAttenuation (void) const
 Get the value of the Light::_sfLinearAttenuation field.
Real32getQuadraticAttenuation (void)
 Get the value of the Light::_sfQuadraticAttenuation field.
const Real32getQuadraticAttenuation (void) const
 Get the value of the Light::_sfQuadraticAttenuation field.
Field Set
*void setAmbient (const Color4f &value)
 Set the value of the Light::_sfAmbient field.
void setDiffuse (const Color4f &value)
 Set the value of the Light::_sfDiffuse field.
void setSpecular (const Color4f &value)
 Set the value of the Light::_sfSpecular field.
void setBeacon (const NodePtr &value)
 Set the value of the Light::_sfBeacon field.
void setOn (const bool &value)
 Set the value of the Light::_sfOn field.
void setConstantAttenuation (const Real32 &value)
 Set the value of the Light::_sfConstantAttenuation field.
void setLinearAttenuation (const Real32 &value)
 Set the value of the Light::_sfLinearAttenuation field.
void setQuadraticAttenuation (const Real32 &value)
 Set the value of the Light::_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)
Parents
*MFNodePtrgetParents (void)
const MFNodePtrgetParents (void) const
MFNodePtrgetMFParents (void)
Dump
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Volume
*virtual void invalidateVolume (void)
Changed
*virtual void changed (BitVector whichField, UInt32 origin)
Clone
*virtual FieldContainerPtr shallowCopy (void) const =0

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

Static Public Attributes

static const osg::BitVector AmbientFieldMask
static const osg::BitVector DiffuseFieldMask
static const osg::BitVector SpecularFieldMask
static const osg::BitVector BeaconFieldMask
static const osg::BitVector OnFieldMask
static const osg::BitVector ConstantAttenuationFieldMask
static const osg::BitVector LinearAttenuationFieldMask
static const osg::BitVector QuadraticAttenuationFieldMask
static const osg::BitVector MTInfluenceMask
static const BitVector ParentsFieldMask = (1 << NodeCore::ParentsFieldId )
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper
*static const bool isNodeCore = true

Protected Member Functions

Constructors
LightBase (void)
 LightBase (const LightBase &source)
Destructors
*virtual ~LightBase (void)
Sync
*void executeSyncImpl (LightBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)
Set / Get Parents
*void addParent (const NodePtr &parent)
void subParent (const NodePtr &parent)
Pointer
*NodeCorePtr getPtr (void) const
Sync
void executeSyncImpl (NodeCore *pOther, const BitVector &whichField)
Transformation
*virtual void accumulateMatrix (Matrix &result)
Volume
*virtual void adjustVolume (Volume &volume)

Protected Attributes

Fields
*SFColor4f _sfAmbient
SFColor4f _sfDiffuse
SFColor4f _sfSpecular
SFNodePtr _sfBeacon
SFBool _sfOn
SFReal32 _sfConstantAttenuation
SFReal32 _sfLinearAttenuation
SFReal32 _sfQuadraticAttenuation
Fields
*MFNodePtr _parents

Private Types

typedef NodeCore Inherited

Private Member Functions

void operator= (const LightBase &source)

Static Private Attributes

static FieldDescription_desc []
 Light description.
static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 88 of file OSGLightBase.h.


Member Typedef Documentation

typedef NodeCore osg::LightBase::Inherited [private]
 

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLight, osg::DirectionalLightBase, osg::Light, osg::PointLight, osg::PointLightBase, osg::SpotLight, and osg::SpotLightBase.

Definition at line 92 of file OSGLightBase.h.

typedef LightPtr osg::LightBase::Ptr
 

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 97 of file OSGLightBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
AmbientFieldId 
DiffuseFieldId 
SpecularFieldId 
BeaconFieldId 
OnFieldId 
ConstantAttenuationFieldId 
LinearAttenuationFieldId 
QuadraticAttenuationFieldId 
NextFieldId 

Reimplemented from osg::NodeCore.

Definition at line 99 of file OSGLightBase.h.

00100     {
00101         AmbientFieldId              = Inherited::NextFieldId,
00102         DiffuseFieldId              = AmbientFieldId              + 1,
00103         SpecularFieldId             = DiffuseFieldId              + 1,
00104         BeaconFieldId               = SpecularFieldId             + 1,
00105         OnFieldId                   = BeaconFieldId               + 1,
00106         ConstantAttenuationFieldId  = OnFieldId                   + 1,
00107         LinearAttenuationFieldId    = ConstantAttenuationFieldId  + 1,
00108         QuadraticAttenuationFieldId = LinearAttenuationFieldId    + 1,
00109         NextFieldId                 = QuadraticAttenuationFieldId + 1
00110     };


Constructor & Destructor Documentation

LightBase::LightBase void   )  [protected]
 

Definition at line 232 of file OSGLightBase.cpp.

00232                          :
00233     _sfAmbient                (Color4f(0,0,0,1)), 
00234     _sfDiffuse                (Color4f(1,1,1,1)), 
00235     _sfSpecular               (Color4f(1,1,1,1)), 
00236     _sfBeacon                 (), 
00237     _sfOn                     (bool(true)), 
00238     _sfConstantAttenuation    (Real32(1)), 
00239     _sfLinearAttenuation      (Real32(0)), 
00240     _sfQuadraticAttenuation   (Real32(0)), 
00241     Inherited() 
00242 {
00243 }

LightBase::LightBase const LightBase source  )  [protected]
 

Definition at line 249 of file OSGLightBase.cpp.

00249                                             :
00250     _sfAmbient                (source._sfAmbient                ), 
00251     _sfDiffuse                (source._sfDiffuse                ), 
00252     _sfSpecular               (source._sfSpecular               ), 
00253     _sfBeacon                 (source._sfBeacon                 ), 
00254     _sfOn                     (source._sfOn                     ), 
00255     _sfConstantAttenuation    (source._sfConstantAttenuation    ), 
00256     _sfLinearAttenuation      (source._sfLinearAttenuation      ), 
00257     _sfQuadraticAttenuation   (source._sfQuadraticAttenuation   ), 
00258     Inherited                 (source)
00259 {
00260 }

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

Definition at line 264 of file OSGLightBase.cpp.

00265 {
00266 }


Member Function Documentation

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

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 58 of file OSGLightBase.inl.

References _type.

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 65 of file OSGLightBase.inl.

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

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

FieldContainerType & LightBase::getType void   )  [virtual]
 

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 183 of file OSGLightBase.cpp.

References _type.

00184 {
00185     return _type; 
00186 } 

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

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 188 of file OSGLightBase.cpp.

References _type.

00189 {
00190     return _type;
00191 } 

UInt32 LightBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 194 of file OSGLightBase.cpp.

00195 { 
00196     return sizeof(Light); 
00197 }

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

Definition at line 75 of file OSGLightBase.inl.

References _sfAmbient.

00076 {
00077     return &_sfAmbient;
00078 }

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

Definition at line 82 of file OSGLightBase.inl.

References _sfDiffuse.

00083 {
00084     return &_sfDiffuse;
00085 }

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

Definition at line 89 of file OSGLightBase.inl.

References _sfSpecular.

00090 {
00091     return &_sfSpecular;
00092 }

SFNodePtr * osg::LightBase::getSFBeacon void   )  [inline]
 

Definition at line 96 of file OSGLightBase.inl.

References _sfBeacon.

00097 {
00098     return &_sfBeacon;
00099 }

SFBool * osg::LightBase::getSFOn void   )  [inline]
 

Definition at line 103 of file OSGLightBase.inl.

References _sfOn.

00104 {
00105     return &_sfOn;
00106 }

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

Definition at line 110 of file OSGLightBase.inl.

References _sfConstantAttenuation.

00111 {
00112     return &_sfConstantAttenuation;
00113 }

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

Definition at line 117 of file OSGLightBase.inl.

References _sfLinearAttenuation.

00118 {
00119     return &_sfLinearAttenuation;
00120 }

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

Definition at line 124 of file OSGLightBase.inl.

References _sfQuadraticAttenuation.

00125 {
00126     return &_sfQuadraticAttenuation;
00127 }

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

Definition at line 132 of file OSGLightBase.inl.

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

Referenced by osg::Light::makeChunk().

00133 {
00134     return _sfAmbient.getValue();
00135 }

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

Definition at line 139 of file OSGLightBase.inl.

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

00140 {
00141     return _sfAmbient.getValue();
00142 }

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

Definition at line 153 of file OSGLightBase.inl.

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

Referenced by osg::Light::makeChunk().

00154 {
00155     return _sfDiffuse.getValue();
00156 }

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

Definition at line 160 of file OSGLightBase.inl.

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

00161 {
00162     return _sfDiffuse.getValue();
00163 }

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

Definition at line 174 of file OSGLightBase.inl.

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

Referenced by osg::Light::makeChunk().

00175 {
00176     return _sfSpecular.getValue();
00177 }

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

Definition at line 181 of file OSGLightBase.inl.

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

00182 {
00183     return _sfSpecular.getValue();
00184 }

NodePtr & osg::LightBase::getBeacon void   )  [inline]
 

Definition at line 195 of file OSGLightBase.inl.

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

Referenced by osg::Light::drawEnter(), and osg::RenderAction::dropLight().

00196 {
00197     return _sfBeacon.getValue();
00198 }

const NodePtr & osg::LightBase::getBeacon void   )  const [inline]
 

Definition at line 202 of file OSGLightBase.inl.

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

00203 {
00204     return _sfBeacon.getValue();
00205 }

bool & osg::LightBase::getOn void   )  [inline]
 

Definition at line 216 of file OSGLightBase.inl.

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

Referenced by osg::SpotLight::drawEnter(), osg::PointLight::drawEnter(), osg::DirectionalLight::drawEnter(), osg::SpotLight::drawLeave(), osg::PointLight::drawLeave(), osg::DirectionalLight::drawLeave(), osg::SpotLight::renderEnter(), osg::PointLight::renderEnter(), osg::DirectionalLight::renderEnter(), osg::SpotLight::renderLeave(), osg::PointLight::renderLeave(), and osg::DirectionalLight::renderLeave().

00217 {
00218     return _sfOn.getValue();
00219 }

const bool & osg::LightBase::getOn void   )  const [inline]
 

Definition at line 223 of file OSGLightBase.inl.

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

00224 {
00225     return _sfOn.getValue();
00226 }

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

Definition at line 237 of file OSGLightBase.inl.

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

Referenced by osg::PointLight::makeChunk().

00238 {
00239     return _sfConstantAttenuation.getValue();
00240 }

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

Definition at line 244 of file OSGLightBase.inl.

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

00245 {
00246     return _sfConstantAttenuation.getValue();
00247 }

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

Definition at line 258 of file OSGLightBase.inl.

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

Referenced by osg::PointLight::makeChunk().

00259 {
00260     return _sfLinearAttenuation.getValue();
00261 }

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

Definition at line 265 of file OSGLightBase.inl.

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

00266 {
00267     return _sfLinearAttenuation.getValue();
00268 }

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

Definition at line 279 of file OSGLightBase.inl.

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

Referenced by osg::PointLight::makeChunk().

00280 {
00281     return _sfQuadraticAttenuation.getValue();
00282 }

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

Definition at line 286 of file OSGLightBase.inl.

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

00287 {
00288     return _sfQuadraticAttenuation.getValue();
00289 }

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

Reimplemented in osg::Light.

Definition at line 146 of file OSGLightBase.inl.

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

Referenced by osg::Light::setAmbient().

00147 {
00148     _sfAmbient.setValue(value);
00149 }

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

Reimplemented in osg::Light.

Definition at line 167 of file OSGLightBase.inl.

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

Referenced by osg::Light::setDiffuse().

00168 {
00169     _sfDiffuse.setValue(value);
00170 }

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

Reimplemented in osg::Light.

Definition at line 188 of file OSGLightBase.inl.

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

Referenced by osg::Light::setSpecular().

00189 {
00190     _sfSpecular.setValue(value);
00191 }

void osg::LightBase::setBeacon const NodePtr value  )  [inline]
 

Definition at line 209 of file OSGLightBase.inl.

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

00210 {
00211     _sfBeacon.setValue(value);
00212 }

void osg::LightBase::setOn const bool &  value  )  [inline]
 

Definition at line 230 of file OSGLightBase.inl.

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

00231 {
00232     _sfOn.setValue(value);
00233 }

void osg::LightBase::setConstantAttenuation const Real32 value  )  [inline]
 

Definition at line 251 of file OSGLightBase.inl.

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

00252 {
00253     _sfConstantAttenuation.setValue(value);
00254 }

void osg::LightBase::setLinearAttenuation const Real32 value  )  [inline]
 

Definition at line 272 of file OSGLightBase.inl.

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

00273 {
00274     _sfLinearAttenuation.setValue(value);
00275 }

void osg::LightBase::setQuadraticAttenuation const Real32 value  )  [inline]
 

Definition at line 293 of file OSGLightBase.inl.

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

00294 {
00295     _sfQuadraticAttenuation.setValue(value);
00296 }

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

Reimplemented from osg::NodeCore.

Reimplemented in osg::DirectionalLightBase, osg::PointLightBase, and osg::SpotLightBase.

Definition at line 270 of file OSGLightBase.cpp.

References _sfAmbient, _sfBeacon, _sfConstantAttenuation, _sfDiffuse, _sfLinearAttenuation, _sfOn, _sfQuadraticAttenuation, _sfSpecular, AmbientFieldMask, BeaconFieldMask, ConstantAttenuationFieldMask, DiffuseFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::NodeCore::getBinSize(), LinearAttenuationFieldMask, osg::FieldBits::NoField, OnFieldMask, QuadraticAttenuationFieldMask, and SpecularFieldMask.

Referenced by osg::PointLightBase::getBinSize(), and osg::DirectionalLightBase::getBinSize().

00271 {
00272     UInt32 returnValue = Inherited::getBinSize(whichField);
00273 
00274     if(FieldBits::NoField != (AmbientFieldMask & whichField))
00275     {
00276         returnValue += _sfAmbient.getBinSize();
00277     }
00278 
00279     if(FieldBits::NoField != (DiffuseFieldMask & whichField))
00280     {
00281         returnValue += _sfDiffuse.getBinSize();
00282     }
00283 
00284     if(FieldBits::NoField != (SpecularFieldMask & whichField))
00285     {
00286         returnValue += _sfSpecular.getBinSize();
00287     }
00288 
00289     if(FieldBits::NoField != (BeaconFieldMask & whichField))
00290     {
00291         returnValue += _sfBeacon.getBinSize();
00292     }
00293 
00294     if(FieldBits::NoField != (OnFieldMask & whichField))
00295     {
00296         returnValue += _sfOn.getBinSize();
00297     }
00298 
00299     if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00300     {
00301         returnValue += _sfConstantAttenuation.getBinSize();
00302     }
00303 
00304     if(FieldBits::NoField != (LinearAttenuatio