PalmPatchesTouchSensorGraphic Class Reference

The graphical representation of the touch sensors on the fingertip. More...

Inheritance diagram for PalmPatchesTouchSensorGraphic:

List of all members.

Public Member Functions

 PalmPatchesTouchSensorGraphic (PhyObject *handPalm, const QVector< iCubPalmPatchesTouchSensor::Triangle > &patches, bool isRight, QString name="unamed")
 Constructor.
 ~PalmPatchesTouchSensorGraphic ()
 Destructor.
void setActivations (const QVector< bool > activations)
 Sets whether the touch sensors are active or not.

Protected Member Functions

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

Protected Attributes

QVector< bool > m_activations
 The vector storing whether the sensor on each patch is in contact with something or not.
QMutex m_activationsMutex
 The mutex protecting the m_activations vector.
PhyBox *const m_handPalm
 The hand piece to which this graphical representation is attached.
const bool m_isRight
 True if the sensor is on the right hand, false if it is on the left one.
const QVector
< iCubPalmPatchesTouchSensor::Triangle
m_patches
 The list of the four triangles making up the sensor.
const float m_zAxisDirection
 This is 1.0 or -1.0 depending on the hand.

Detailed Description

The graphical representation of the touch sensors on the fingertip.

Definition at line 1164 of file icubsensors.cpp.


Constructor & Destructor Documentation

PalmPatchesTouchSensorGraphic ( PhyObject handPalm,
const QVector< iCubPalmPatchesTouchSensor::Triangle > &  patches,
bool  isRight,
QString  name = "unamed" 
) [inline]

Constructor.

This also sets a default color for the piece and sets handPiece to be our owner

Parameters:
handPalmthe hand palm to which this graphical representation is attached. This must be a PhyBox (the cast is done inside). As the iCubPalmPatchesTouchSensor class is supposed to work only with the iCub hand, the cast should never fail.
patchesthe list of the four triangles making up the sensor
isRightset to true if handPalm is the right palm, to false if it is the left one. We have to distinguish between the two hands because they have different fame of reference orientations
namethe name of this object

Definition at line 1186 of file icubsensors.cpp.

References GraphicalWObject::attachToObject(), PalmPatchesTouchSensorGraphic::m_handPalm, WObject::setColor(), WObject::setTexture(), and WObject::setUseColorTextureOfOwner().

Destructor.

Definition at line 1207 of file icubsensors.cpp.


Member Function Documentation

virtual void render ( RenderWObject renderer,
QGLContext *  gw 
) [inline, protected, virtual]
void setActivations ( const QVector< bool >  activations) [inline]

Sets whether the touch sensors are active or not.

This function is thread-safe

Parameters:
activationsthe vector with activation for each path

Definition at line 1217 of file icubsensors.cpp.

References PalmPatchesTouchSensorGraphic::m_activations, and PalmPatchesTouchSensorGraphic::m_activationsMutex.

Referenced by iCubPalmPatchesTouchSensor::update().


Member Data Documentation

QVector<bool> m_activations [protected]

The vector storing whether the sensor on each patch is in contact with something or not.

This changes the color with which each pathch of the sensor is drawn

Definition at line 1319 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::render(), and PalmPatchesTouchSensorGraphic::setActivations().

QMutex m_activationsMutex [protected]

The mutex protecting the m_activations vector.

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

Definition at line 1327 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::render(), and PalmPatchesTouchSensorGraphic::setActivations().

PhyBox* const m_handPalm [protected]

The hand piece to which this graphical representation is attached.

Definition at line 1290 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::PalmPatchesTouchSensorGraphic().

const bool m_isRight [protected]

True if the sensor is on the right hand, false if it is on the left one.

Definition at line 1301 of file icubsensors.cpp.

const QVector<iCubPalmPatchesTouchSensor::Triangle> m_patches [protected]

The list of the four triangles making up the sensor.

Definition at line 1295 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::render().

const float m_zAxisDirection [protected]

This is 1.0 or -1.0 depending on the hand.

For the right hand the palm is towards +z (and this constant is 1.0), for the left hand it is towards -z (and this constant is -1.0)

Definition at line 1310 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::render().


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