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

Inheritance diagram for FingertipTouchSensorGraphic:

List of all members.

Public Member Functions

 FingertipTouchSensorGraphic (PhyObject *handPiece, double alpha, double h, bool isRight, bool isThumb, QString name="unamed")
 Constructor.
 ~FingertipTouchSensorGraphic ()
 Destructor.
void setActive (bool isActive)
 Sets whether the touch sensor is active or not.

Protected Member Functions

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

Static Protected Member Functions

static float computeAlphaOffset (bool isRight, bool isThumb)

Protected Attributes

const float m_alpha
 The aperture of the sensor area.
const float m_alphaOffset
 The offset to apply when drawing the sensor.
const float m_angularIncrement
 The angular increment when drawing the sensor.
const float m_endingAngle
 The ending angle when drawing the sensor.
const float m_h
 The height of the sensor area.
PhyCylinder *const m_handPiece
 The hand piece to which this graphical representation is attached.
bool m_isActive
 If true the sensor is in contact with something.
QMutex m_isActiveMutex
 The mutex protecting the m_isActive variable.
const float m_startingAngle
 The starting angle when drawing the sensor.

Detailed Description

The graphical representation of the touch sensors on the fingertip.

Definition at line 947 of file icubsensors.cpp.


Constructor & Destructor Documentation

FingertipTouchSensorGraphic ( PhyObject handPiece,
double  alpha,
double  h,
bool  isRight,
bool  isThumb,
QString  name = "unamed" 
) [inline]

Constructor.

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

Parameters:
handPiecethe hand piece to which this graphical representation is attached. This must be a PhyCylinder (the cast is done inside). As the iCubFingertipsTouchSensor class is supposed to work only with the iCub hand, the cast should never fail.
alphathe aperture of the sensor area (see the sensor class description)
hthe height of the sensor area (see the sensor class description)
isRightset to true if handPiece belongs to the right hand, to false if it belongs to the left one. We have to distinguish between the two hands because they have different fame of reference orientations
isThumbset to true if handPiece is the thumb (the thumb has a different orientation with respect to other fingers)
namethe name of this object

Definition at line 975 of file icubsensors.cpp.

References GraphicalWObject::attachToObject(), FingertipTouchSensorGraphic::m_handPiece, WObject::setColor(), WObject::setTexture(), and WObject::setUseColorTextureOfOwner().

Destructor.

Definition at line 999 of file icubsensors.cpp.


Member Function Documentation

void setActive ( bool  isActive) [inline]

Sets whether the touch sensor is active or not.

This function is thread-safe

Parameters:
isActiveset to true if the sensor is in touch with something

Definition at line 1010 of file icubsensors.cpp.

References FingertipTouchSensorGraphic::m_isActive, and FingertipTouchSensorGraphic::m_isActiveMutex.


Member Data Documentation

const float m_alpha [protected]

The aperture of the sensor area.

Definition at line 1110 of file icubsensors.cpp.

const float m_alphaOffset [protected]

The offset to apply when drawing the sensor.

This offset is 0.0 for all fingers except for the thumb, for which is M_PI/2.0. This is needed because the thumb has a different orientation respect to the other fingers

Definition at line 1124 of file icubsensors.cpp.

const float m_angularIncrement [protected]

The angular increment when drawing the sensor.

This depends on the sensor aperture and the number of divisions

Definition at line 1132 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

const float m_endingAngle [protected]

The ending angle when drawing the sensor.

Definition at line 1142 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

const float m_h [protected]

The height of the sensor area.

Definition at line 1115 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

PhyCylinder* const m_handPiece [protected]

The hand piece to which this graphical representation is attached.

Definition at line 1105 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::FingertipTouchSensorGraphic(), and FingertipTouchSensorGraphic::render().

bool m_isActive [protected]

If true the sensor is in contact with something.

This changes the color with which the sensor is drawn

Definition at line 1149 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render(), and FingertipTouchSensorGraphic::setActive().

QMutex m_isActiveMutex [protected]

The mutex protecting the m_isActive variable.

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

Definition at line 1157 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render(), and FingertipTouchSensorGraphic::setActive().

const float m_startingAngle [protected]

The starting angle when drawing the sensor.

Definition at line 1137 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().


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