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. | |
Public Member Functions inherited from GraphicalWObject | |
GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity()) | |
WObject * | attachedObject () const |
void | attachToObject (WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity()) |
QColor | color () const |
const wMatrix & | getDisplacement () const |
bool | isInvisible () |
const wMatrix & | matrix () const |
QString | name () const |
Ownable () | |
const QList< Owned > & | owned () const |
Ownable * | owner () 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) | |
World * | world () |
const World * | world () 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 wMatrix & | matrix () const |
QString | name () const |
Ownable () | |
const QList< Owned > & | owned () const |
Ownable * | owner () 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 |
World * | world () |
const World * | world () const |
Public Member Functions inherited from Ownable | |
const QList< Owned > & | owned () const |
Ownable * | owner () 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 () |
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. | |
const real | m_handPieceHeight |
The height of the hand piece. | |
const real | m_handPieceRadius |
The radius of the hand piece. | |
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. | |
Protected Attributes inherited from GraphicalWObject | |
QColor | colorv |
bool | invisible |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
Protected Attributes inherited from WObject | |
QColor | colorv |
bool | invisible |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
Additional Inherited Members | |
Public Types inherited from GraphicalWObject | |
typedef QList< Owned > | OwnedList |
Detailed Description
The graphical representation of the touch sensors on the fingertip.
Definition at line 1219 of file icubsensors.cpp.
Constructor & Destructor Documentation
|
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 1247 of file icubsensors.cpp.
References GraphicalWObject::attachToObject(), FingertipTouchSensorGraphic::m_handPiece, GraphicalWObject::setColor(), GraphicalWObject::setTexture(), and GraphicalWObject::setUseColorTextureOfOwner().
|
inline |
Destructor.
Definition at line 1273 of file icubsensors.cpp.
Member Function Documentation
|
inlineprotectedvirtual |
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 1300 of file icubsensors.cpp.
References RenderWObject::container(), FingertipTouchSensorGraphic::m_angularIncrement, FingertipTouchSensorGraphic::m_endingAngle, FingertipTouchSensorGraphic::m_h, FingertipTouchSensorGraphic::m_handPieceHeight, FingertipTouchSensorGraphic::m_handPieceRadius, FingertipTouchSensorGraphic::m_isActive, FingertipTouchSensorGraphic::m_isActiveMutex, FingertipTouchSensorGraphic::m_startingAngle, wVectorT< Shared >::scale(), GraphicalWObject::setColor(), RenderWObjectContainer::setupColorTexture(), GraphicalWObject::tm, wMatrix::w_pos, and wMatrix::x_ax.
|
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 1284 of file icubsensors.cpp.
References FingertipTouchSensorGraphic::m_isActive, and FingertipTouchSensorGraphic::m_isActiveMutex.
Member Data Documentation
|
protected |
The aperture of the sensor area.
Definition at line 1394 of file icubsensors.cpp.
|
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 1408 of file icubsensors.cpp.
|
protected |
The angular increment when drawing the sensor.
This depends on the sensor aperture and the number of divisions
Definition at line 1416 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
|
protected |
The ending angle when drawing the sensor.
Definition at line 1426 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
|
protected |
The height of the sensor area.
Definition at line 1399 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
|
protected |
The hand piece to which this graphical representation is attached.
Definition at line 1379 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::FingertipTouchSensorGraphic().
|
protected |
The height of the hand piece.
Definition at line 1384 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
|
protected |
The radius of the hand piece.
Definition at line 1389 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
|
protected |
If true the sensor is in contact with something.
This changes the color with which the sensor is drawn
Definition at line 1433 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render(), and FingertipTouchSensorGraphic::setActive().
|
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 1441 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render(), and FingertipTouchSensorGraphic::setActive().
|
protected |
The starting angle when drawing the sensor.
Definition at line 1421 of file icubsensors.cpp.
Referenced by FingertipTouchSensorGraphic::render().
The documentation for this class was generated from the following file:
- experiments/src/icubsensors.cpp