V-ART
Public Member Functions | List of all members
VART::PointLight Class Reference

Point light source. More...

#include <pointlight.h>

Inheritance diagram for VART::PointLight:
VART::Light VART::SceneNode VART::MemoryObj

Public Member Functions

 PointLight ()
 
 PointLight (Point4D loc, float constantAtt=1.0, float linearAtt=0.0, float quadraticAtt=0.0)
 
void SetAttenuation (float constant=1.0, float linear=0.0, float quadratic=0.0)
 Sets the three attenuation factors, described on OpenGL Red Book, Chapter 5: Lighting, section Creating Light Sources. More...
 
float GetConstantAttenuation () const
 
float GetLinearAttenuation () const
 
float GetQuadraticAttenuation () const
 
virtual bool DrawOGL (unsigned int oglLightID) const
 Draws (sets up) a light using OpenGL commands. More...
 
void SetLocation (const Point4D &newLocation)
 
Point4D GetLocation () const
 
- Public Member Functions inherited from VART::Light
 Light ()
 
 Light (const Light &light)
 
 Light (float i, float ai, Color c, bool o)
 
 Light (const std::string &newDescription, float newIntensity, float newAmbientIntensity, const Color &newColor, const Point4D &newLocation)
 
virtual ~Light ()
 
virtual SceneNodeCopy ()
 Returns a copy of an Light. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy. More...
 
Lightoperator= (const Light &light)
 
void SetIntensity (float i)
 
float GetIntensity () const
 
void SetAmbientIntensity (float ai)
 
float GetAmbientIntensity () const
 
void SetColor (const Color &c)
 
Color GetColor () const
 
void Turn (bool on_off)
 Turns a light on or off. More...
 
bool IsOn () const
 
virtual bool RecursiveBoundingBox (BoundingBox *bBox)
 Always returns false, therefore recursive bbox does not exist. More...
 
void SetLocation (const Point4D &newLocation)
 Sets the location of the light. More...
 
Point4D GetLocation () const
 
TransformGetTransform () const
 Gets a pointer to the light transform. More...
 
virtual void DrawForPicking () const
 Draws and object, setting pick info. More...
 
- Public Member Functions inherited from VART::SceneNode
 SceneNode ()
 Creates an uninitialized scene node. More...
 
 SceneNode (SceneNode &node)
 
virtual ~SceneNode ()
 
SceneNodeoperator= (const SceneNode &node)
 
virtual SceneNodeRecursiveCopy ()
 
const std::string & GetDescription () const
 Returns a copy of the object's description. More...
 
void SetDescription (const std::string &desc)
 Changes the object's description. More...
 
void AddChild (SceneNode &child)
 Add a child at the end of child list. More...
 
bool DetachChild (SceneNode *childPtr)
 Removes a child from the child list. More...
 
virtual bool DrawOGL () const
 Recursive drawing using OpenGL commands. More...
 
virtual TypeID GetID () const
 Returns type identification of the node. More...
 
void AutoDeleteChildren () const
 Deletes (dealocate memory) recursively all children marked as 'autoDelete'. More...
 
SceneNodeFindChildByName (const std::string &name) const
 Recusively searches its children for a given name. More...
 
std::list< SceneNode * > GetChilds ()
 
bool FindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const
 Search target among children. More...
 
bool FindPathTo (const std::string &targetName, SGPath *resultPtr) const
 Search target among children. More...
 
int GetNodeTypeList (TypeID type, std::list< SceneNode * > &nodeList)
 Find all the nodes of with typeID 'type'. More...
 
virtual void TraverseDepthFirst (SNOperator *operatorPtr) const
 Process all children in depth-first order. More...
 
virtual void TraverseBreadthFirst (SNOperator *operatorPtr) const
 Process all children in breadth-first order. More...
 
virtual void LocateDepthFirst (SNLocator *locatorPtr) const
 Seaches for a particular scene node (depth first) More...
 
virtual void LocateBreadthFirst (SNLocator *locatorPtr) const
 Seaches for a particular scene node (breadth first) More...
 
virtual void XmlPrintOn (std::ostream &os, unsigned int indent) const
 Recursively outputs XML representation of the scene node. More...
 
- Public Member Functions inherited from VART::MemoryObj
 MemoryObj ()
 Default constructor. More...
 
 MemoryObj (const VART::MemoryObj &obj)
 Copy constructor. More...
 

Additional Inherited Members

- Public Types inherited from VART::SceneNode
enum  TypeID {
  NONE, GRAPHIC_OBJ, BOX, CONE,
  CURVE, BEZIER, CYLINDER, IMAGE,
  IMAGE_2D, VOLUME, MESH_OBJECT, SPHERE,
  JOINT, BIAXIAL_JOINT, CONDYLAR_JOINT, ELLIPSOID_JOINT,
  SADDLE_JOINT, PLANE_JOINT, POLYAXIAL_JOINT, UNIAXIAL_JOINT,
  HINGE_JOINT, PIVOT_JOINT, TRANSFORM
}
 
- Static Public Member Functions inherited from VART::Light
static const LightSUN ()
 White directional light towards negative Y. Small ambient intensity. More...
 
static const LightBRIGHT_AMBIENT ()
 Strong, white ambient light. More...
 
- Public Attributes inherited from VART::MemoryObj
bool autoDelete
 
- Static Public Attributes inherited from VART::SceneNode
static bool recursivePrinting = true
 
- Protected Member Functions inherited from VART::Light
unsigned int getOpenGLID (unsigned int lightID) const
 
- Protected Member Functions inherited from VART::SceneNode
virtual bool DrawInstanceOGL () const
 Non-recursive drawing - should be overriden by every derived class. More...
 
bool RecursiveFindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const
 Recursive auxiliar method for FindPathTo. More...
 
bool RecursiveFindPathTo (const std::string &targetName, SGPath *resultPtr) const
 Recursive auxiliar method for FindPathTo. More...
 
- Protected Attributes inherited from VART::Light
Transformtransform
 
Point4D location
 
- Protected Attributes inherited from VART::SceneNode
std::list< SceneNode * > childList
 Child list. More...
 
std::string description
 Textual identification. More...
 

Detailed Description

Point light source.

This is a Light with attenuation.

Definition at line 14 of file pointlight.h.

Constructor & Destructor Documentation

VART::PointLight::PointLight ( )
VART::PointLight::PointLight ( Point4D  loc,
float  constantAtt = 1.0,
float  linearAtt = 0.0,
float  quadraticAtt = 0.0 
)

Definition at line 14 of file pointlight.cpp.

References SetAttenuation(), and SetLocation().

Member Function Documentation

bool VART::PointLight::DrawOGL ( unsigned int  oglLightID) const
virtual

Draws (sets up) a light using OpenGL commands.

Returns
false if V-ART was not compiled with OpenGL support.
Parameters
oglLightID[in] OpenGL ID for light in the range 0..7.

Reimplemented from VART::Light.

Definition at line 25 of file pointlight.cpp.

References VART::SceneNode::DrawOGL().

float VART::PointLight::GetConstantAttenuation ( ) const
inline

Definition at line 32 of file pointlight.h.

float VART::PointLight::GetLinearAttenuation ( ) const
inline

Definition at line 33 of file pointlight.h.

Point4D VART::PointLight::GetLocation ( ) const
inline

Definition at line 42 of file pointlight.h.

References VART::Light::location.

float VART::PointLight::GetQuadraticAttenuation ( ) const
inline

Definition at line 34 of file pointlight.h.

void VART::PointLight::SetAttenuation ( float  constant = 1.0,
float  linear = 0.0,
float  quadratic = 0.0 
)

Sets the three attenuation factors, described on OpenGL Red Book, Chapter 5: Lighting, section Creating Light Sources.

Parameters
constant[in] Constant attenuation factor.
linear[in] Linear attenuation factor.
quadratic[in] Quadratic attenuation factor.

Definition at line 19 of file pointlight.cpp.

Referenced by PointLight().

void VART::PointLight::SetLocation ( const Point4D newLocation)
inline

Definition at line 41 of file pointlight.h.

References VART::Light::location.

Referenced by PointLight().


The documentation for this class was generated from the following files: