The graphical representation of the single IR sensor. More...

Inheritance diagram for SingleIRGraphic:

List of all members.

Public Member Functions

 SingleIRGraphic (WObject *object, const wMatrix &offset, const QVector< wVector > &startingRayPoints, const QVector< wVector > &endingRayPoints, bool drawRay, bool drawRealRay, QString name="unamed")
 Constructor.
 ~SingleIRGraphic ()
 Destructor.

Protected Member Functions

virtual void render (RenderWObject *renderer, QGLContext *gw)
 Performs the actual drawing.

Protected Attributes

const bool m_drawRay
 If true a red segments giving the direction of the sensor rays are drawn.
const bool m_drawRealRay
 Whether to draw the actual ray lengths or not.
const QVector< wVectorm_endingRayPoints
 The vector with ending points of the rays.
WObject *const m_object
 The object to which this graphicalc representation is attached.
const wMatrix m_offset
 The displacement matrix relative to the object to which we are attached.
const QVector< wVectorm_startingRayPoints
 The vector with starting points of the rays.

Detailed Description

The graphical representation of the single IR sensor.

Definition at line 69 of file sensorcontrollers.cpp.


Constructor & Destructor Documentation

SingleIRGraphic ( WObject object,
const wMatrix offset,
const QVector< wVector > &  startingRayPoints,
const QVector< wVector > &  endingRayPoints,
bool  drawRay,
bool  drawRealRay,
QString  name = "unamed" 
) [inline]

Constructor.

This also sets a default color for the piece and sets the object to which the sensor is attached to be our owner

Parameters:
objectthe object to which this graphical representation is attached
offsetthe displacement matrix relative to the object to which we are attached
startingRayPointsThe vector with starting points of the rays. The points are in the frame of reference of the solid to which the sensor is attached
endingRayPointsThe vector with ending points of the rays. The points are in the frame of reference of the solid to which the sensor is attached
drawRayif true a red segment giving the direction of the sensor is drawn. The red segment is along the local Z axis and its length is fixed
drawRealRayIf true the rays are drawn using their actual range (from the starting point to the ending point), otherwise only fixed length rays are drawn which only give the direction
namethe name of this object

Definition at line 99 of file sensorcontrollers.cpp.

References GraphicalWObject::attachToObject(), SingleIRGraphic::m_object, WObject::setTexture(), and WObject::setUseColorTextureOfOwner().

~SingleIRGraphic ( ) [inline]

Destructor.

Definition at line 120 of file sensorcontrollers.cpp.


Member Function Documentation

virtual void render ( RenderWObject renderer,
QGLContext *  gw 
) [inline, protected, virtual]

Performs the actual drawing.

Draws the fingertip

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

Implements GraphicalWObject.

Definition at line 133 of file sensorcontrollers.cpp.

References RenderWObject::container(), SingleIRGraphic::m_drawRay, SingleIRGraphic::m_drawRealRay, SingleIRGraphic::m_endingRayPoints, SingleIRGraphic::m_offset, SingleIRGraphic::m_startingRayPoints, wVectorT< Shared >::scale(), RenderWObjectContainer::setupColorTexture(), and WObject::tm.


Member Data Documentation

const bool m_drawRay [protected]

If true a red segments giving the direction of the sensor rays are drawn.

Definition at line 273 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::render().

const bool m_drawRealRay [protected]

Whether to draw the actual ray lengths or not.

If true the rays are drawn using their actual range (from the starting point to the ending point), otherwise only fixed length rays are drawn which only give the direction

Definition at line 282 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::render().

const QVector<wVector> m_endingRayPoints [protected]

The vector with ending points of the rays.

The points are in the frame of reference of the solid to which the sensor is attached

Definition at line 267 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::render().

WObject* const m_object [protected]

The object to which this graphicalc representation is attached.

Definition at line 245 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::SingleIRGraphic().

const wMatrix m_offset [protected]

The displacement matrix relative to the object to which we are attached.

Definition at line 251 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::render().

const QVector<wVector> m_startingRayPoints [protected]

The vector with starting points of the rays.

The points are in the frame of reference of the solid to which the sensor is attached

Definition at line 259 of file sensorcontrollers.cpp.

Referenced by SingleIRGraphic::render().


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