FingertipTouchSensorGraphic Class Reference
The graphical representation of the touch sensors on the fingertip. More...

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:
-
handPiece the 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. alpha the aperture of the sensor area (see the sensor class description) h the height of the sensor area (see the sensor class description) isRight set 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 isThumb set to true if handPiece is the thumb (the thumb has a different orientation with respect to other fingers) name the 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().
~FingertipTouchSensorGraphic | ( | ) | [inline] |
Destructor.
Definition at line 999 of file icubsensors.cpp.
Member Function Documentation
virtual void render | ( | RenderWObject * | renderer, |
QGLContext * | gw | ||
) | [inline, protected, virtual] |
Performs the actual drawing.
Draws the fingertip
- Parameters:
-
renderer the RenderWObject object associated with this one. Use it e.g. to access the container gw the OpenGL context
Implements GraphicalWObject.
Definition at line 1026 of file icubsensors.cpp.
References RenderWObject::container(), PhyCylinder::height(), FingertipTouchSensorGraphic::m_angularIncrement, FingertipTouchSensorGraphic::m_endingAngle, FingertipTouchSensorGraphic::m_h, FingertipTouchSensorGraphic::m_handPiece, FingertipTouchSensorGraphic::m_isActive, FingertipTouchSensorGraphic::m_isActiveMutex, FingertipTouchSensorGraphic::m_startingAngle, PhyCylinder::radius(), wVectorT< Shared >::scale(), WObject::setColor(), RenderWObjectContainer::setupColorTexture(), WObject::tm, wMatrix::w_pos, and wMatrix::x_ax.
void setActive | ( | bool | isActive | ) | [inline] |
Sets whether the touch sensor is active or not.
This function is thread-safe
- Parameters:
-
isActive set 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:
- experiments/src/icubsensors.cpp