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

Inheritance diagram for FingertipTouchSensorGraphic:

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())
 
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 ()
 

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
 
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 1219 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 1247 of file icubsensors.cpp.

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

Destructor.

Definition at line 1273 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 1284 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 1394 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 1408 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 1416 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

const float m_endingAngle
protected

The ending angle when drawing the sensor.

Definition at line 1426 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

const float m_h
protected

The height of the sensor area.

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

Referenced by FingertipTouchSensorGraphic::FingertipTouchSensorGraphic().

const real m_handPieceHeight
protected

The height of the hand piece.

Definition at line 1384 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().

const real m_handPieceRadius
protected

The radius of the hand piece.

Definition at line 1389 of file icubsensors.cpp.

Referenced by 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 1433 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 1441 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 1421 of file icubsensors.cpp.

Referenced by FingertipTouchSensorGraphic::render().


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