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

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. | |
![]() | |
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 |
![]() | |
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 |
![]() | |
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. | |
![]() | |
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 () |
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. | |
![]() | |
QColor | colorv |
bool | invisible |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
![]() | |
QColor | colorv |
bool | invisible |
QString | namev |
QString | texturev |
wMatrix | tm |
bool | usecolortextureofowner |
World * | worldv |
Additional Inherited Members | |
![]() | |
typedef QList< Owned > | OwnedList |
Detailed Description
The graphical representation of the touch sensors on the fingertip.
Definition at line 1450 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
-
handPalm the 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. patches the list of the four triangles making up the sensor isRight set 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 name the name of this object
Definition at line 1472 of file icubsensors.cpp.
References GraphicalWObject::attachToObject(), PalmPatchesTouchSensorGraphic::m_handPalm, GraphicalWObject::setColor(), GraphicalWObject::setTexture(), and GraphicalWObject::setUseColorTextureOfOwner().
|
inline |
Destructor.
Definition at line 1493 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 1519 of file icubsensors.cpp.
References iCubPalmPatchesTouchSensor::Triangle::a, iCubPalmPatchesTouchSensor::Triangle::b, iCubPalmPatchesTouchSensor::Triangle::c, RenderWObject::container(), PalmPatchesTouchSensorGraphic::m_activations, PalmPatchesTouchSensorGraphic::m_activationsMutex, PalmPatchesTouchSensorGraphic::m_patches, PalmPatchesTouchSensorGraphic::m_zAxisDirection, RenderWObjectContainer::setupColorTexture(), and GraphicalWObject::tm.
|
inline |
Sets whether the touch sensors are active or not.
This function is thread-safe
- Parameters
-
activations the vector with activation for each path
Definition at line 1503 of file icubsensors.cpp.
References PalmPatchesTouchSensorGraphic::m_activations, and PalmPatchesTouchSensorGraphic::m_activationsMutex.
Referenced by iCubPalmPatchesTouchSensor::update().
Member Data Documentation
|
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 1605 of file icubsensors.cpp.
Referenced by PalmPatchesTouchSensorGraphic::render(), and PalmPatchesTouchSensorGraphic::setActivations().
|
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 1613 of file icubsensors.cpp.
Referenced by PalmPatchesTouchSensorGraphic::render(), and PalmPatchesTouchSensorGraphic::setActivations().
|
protected |
The hand piece to which this graphical representation is attached.
Definition at line 1576 of file icubsensors.cpp.
Referenced by PalmPatchesTouchSensorGraphic::PalmPatchesTouchSensorGraphic().
|
protected |
True if the sensor is on the right hand, false if it is on the left one.
Definition at line 1587 of file icubsensors.cpp.
|
protected |
The list of the four triangles making up the sensor.
Definition at line 1581 of file icubsensors.cpp.
Referenced by PalmPatchesTouchSensorGraphic::render().
|
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 1596 of file icubsensors.cpp.
Referenced by PalmPatchesTouchSensorGraphic::render().
The documentation for this class was generated from the following file:
- experiments/src/icubsensors.cpp