The graphical representation of the linear camera. More...

Inheritance diagram for LinearCameraGraphic:

Public Member Functions

 LinearCameraGraphic (WObject *object, const wMatrix &transformation, double minAngle, double maxAngle, unsigned int numReceptors, QString name="unamed")
 Constructor.
 
 ~LinearCameraGraphic ()
 Destructor.
 
void setPerceivedColors (const QVector< QColor > &receptors)
 Sets the colors perceived by the camera.
 
- Public Member Functions inherited from GraphicalWObject
 GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
 
WObjectattachedObject () const
 
void attachToObject (WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity())
 
QColor color () const
 
const wMatrixgetDisplacement () const
 
bool isInvisible ()
 
const wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () const
 
virtual void postUpdate ()
 
virtual void preUpdate ()
 
void setAlpha (int alpha)
 
void setColor (QColor c)
 
void setDisplacement (const wMatrix &displacement)
 
void setInvisible (bool b)
 
void setMatrix (const wMatrix &newm)
 
void setOwner (Ownable *owner, bool destroy=true)
 
void setPosition (const wVector &newpos)
 
void setPosition (real x, real y, real z)
 
void setTexture (QString textureName)
 
void setUseColorTextureOfOwner (bool b)
 
QString texture () const
 
void updateAndCalculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm)
 
void updateAndCalculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint)
 
void updateAndRender (RenderWObject *renderer, QGLContext *gw)
 
void updateAndRenderAABB (RenderWObject *renderer, RenderWorld *gw)
 
bool useColorTextureOfOwner () const
 
 WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true)
 
Worldworld ()
 
const Worldworld () const
 
- Public Member Functions inherited from WObject
 WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true)
 
QColor color () const
 
bool isInvisible ()
 
const wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () const
 
void setAlpha (int alpha)
 
void setColor (QColor c)
 
void setInvisible (bool b)
 
void setMatrix (const wMatrix &newm)
 
void setOwner (Ownable *owner, bool destroy=true)
 
void setPosition (const wVector &newpos)
 
void setPosition (real x, real y, real z)
 
void setTexture (QString textureName)
 
void setUseColorTextureOfOwner (bool b)
 
QString texture () const
 
bool useColorTextureOfOwner () const
 
Worldworld ()
 
const Worldworld () const
 
- Public Member Functions inherited from Ownable
const QList< Owned > & owned () const
 
Ownableowner () const
 
void setOwner (Ownable *owner, bool destroy=true)
 

Protected Member Functions

virtual void render (RenderWObject *renderer, QGLContext *gw)
 Performs the actual drawing.
 
- Protected Member Functions inherited from GraphicalWObject
virtual void calculateAABB (wVector &minPoint, wVector &maxPoint, const wMatrix tm)
 
virtual void calculateOBB (wVector &dimension, wVector &minPoint, wVector &maxPoint)
 
virtual void changedMatrix ()
 
virtual void renderAABB (RenderWObject *renderer, RenderWorld *gw)
 
void updateMatrixFromAttachedObject ()
 

Protected Attributes

const double m_maxAngle
 The maximum angle of the camera.
 
const double m_minAngle
 The minimum angle of the camera.
 
const unsigned int m_numReceptors
 The number of receptors.
 
WObject *const m_object
 The object to which we are attached.
 
const double m_receptorRange
 The range of each receptor.
 
QVector< QColor > m_receptors
 The vector with perceived colors.
 
QMutex m_receptorsMutex
 The mutex protecting the m_receptors variable.
 
- Protected Attributes inherited from GraphicalWObject
QColor colorv
 
bool invisible
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 
- Protected Attributes inherited from WObject
QColor colorv
 
bool invisible
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 

Additional Inherited Members

- Public Types inherited from GraphicalWObject
typedef QList< OwnedOwnedList
 

Detailed Description

The graphical representation of the linear camera.

Definition at line 243 of file sensors.cpp.

Constructor & Destructor Documentation

LinearCameraGraphic ( WObject object,
const wMatrix transformation,
double  minAngle,
double  maxAngle,
unsigned int  numReceptors,
QString  name = "unamed" 
)
inline

Constructor.

This also sets the object to be our owner

Parameters
objectthe object to which we are attached.
transformationthe transformation matrix relative the one of the object to which we are attached
minAnglethe minimum angle of the camera
maxAnglethe maximum angle of the camera
numReceptorsthe number of receptors
namethe name of this object

Definition at line 259 of file sensors.cpp.

References GraphicalWObject::attachToObject(), LinearCameraGraphic::m_object, GraphicalWObject::setColor(), GraphicalWObject::setTexture(), and GraphicalWObject::setUseColorTextureOfOwner().

~LinearCameraGraphic ( )
inline

Destructor.

Definition at line 280 of file sensors.cpp.

Member Function Documentation

virtual void render ( RenderWObject renderer,
QGLContext *  gw 
)
inlineprotectedvirtual

Performs the actual drawing.

Parameters
rendererthe RenderWObject object associated with this one. Use it e.g. to access the container
gwthe OpenGL context

Implements GraphicalWObject.

Definition at line 305 of file sensors.cpp.

References RenderWObject::container(), LinearCameraGraphic::m_minAngle, LinearCameraGraphic::m_numReceptors, LinearCameraGraphic::m_receptorRange, LinearCameraGraphic::m_receptors, LinearCameraGraphic::m_receptorsMutex, RenderWObjectContainer::setupColorTexture(), and GraphicalWObject::tm.

void setPerceivedColors ( const QVector< QColor > &  receptors)
inline

Sets the colors perceived by the camera.

This function is thread-safe

Parameters
receptorsthe colors perceived by receptors

Definition at line 290 of file sensors.cpp.

References LinearCameraGraphic::m_receptors, and LinearCameraGraphic::m_receptorsMutex.

Referenced by LinearCamera::update().

Member Data Documentation

const double m_maxAngle
protected

The maximum angle of the camera.

Definition at line 457 of file sensors.cpp.

const double m_minAngle
protected

The minimum angle of the camera.

Definition at line 452 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

const unsigned int m_numReceptors
protected

The number of receptors.

Definition at line 462 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

WObject* const m_object
protected

The object to which we are attached.

Definition at line 447 of file sensors.cpp.

Referenced by LinearCameraGraphic::LinearCameraGraphic().

const double m_receptorRange
protected

The range of each receptor.

This is computed in the constructor.

Definition at line 469 of file sensors.cpp.

Referenced by LinearCameraGraphic::render().

QVector<QColor> m_receptors
protected

The vector with perceived colors.

Definition at line 474 of file sensors.cpp.

Referenced by LinearCameraGraphic::render(), and LinearCameraGraphic::setPerceivedColors().

QMutex m_receptorsMutex
protected

The mutex protecting the m_receptors variable.

The variable could be accessed by multiple threads concurrently, so we protect it with a mutex

Definition at line 482 of file sensors.cpp.

Referenced by LinearCameraGraphic::render(), and LinearCameraGraphic::setPerceivedColors().


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