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

Inheritance diagram for PalmPatchesTouchSensorGraphic:

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.
 
- Public Member Functions inherited from GraphicalWObject
 GraphicalWObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
 
WObjectattachedObject () const
 
void attachToObject (WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity())
 
QColor color () const
 
const wMatrixgetDisplacement () const
 
bool isInvisible ()
 
const wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () 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)
 
Worldworld ()
 
const Worldworld () 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 wMatrixmatrix () const
 
QString name () const
 
 Ownable ()
 
const QList< Owned > & owned () const
 
Ownableowner () 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
 
Worldworld ()
 
const Worldworld () const
 
- Public Member Functions inherited from Ownable
const QList< Owned > & owned () const
 
Ownableowner () 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 ()
 

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.
 
- Protected Attributes inherited from GraphicalWObject
QColor colorv
 
bool invisible
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 
- Protected Attributes inherited from WObject
QColor colorv
 
bool invisible
 
QString namev
 
QString texturev
 
wMatrix tm
 
bool usecolortextureofowner
 
Worldworldv
 

Additional Inherited Members

- Public Types inherited from GraphicalWObject
typedef QList< OwnedOwnedList
 

Detailed Description

The graphical representation of the touch sensors on the fingertip.

Definition at line 1450 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 1472 of file icubsensors.cpp.

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

Destructor.

Definition at line 1493 of file icubsensors.cpp.

Member Function Documentation

virtual void render ( RenderWObject renderer,
QGLContext *  gw 
)
inlineprotectedvirtual
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 1503 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 1605 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 1613 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 1576 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 1587 of file icubsensors.cpp.

const QVector<iCubPalmPatchesTouchSensor::Triangle> m_patches
protected

The list of the four triangles making up the sensor.

Definition at line 1581 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 1596 of file icubsensors.cpp.

Referenced by PalmPatchesTouchSensorGraphic::render().


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