The graphical representation of the MarXbot traction sensor. More...

Public Member Functions | |
TractionSensorGraphic (WObject *object, const wVector &offset, real radius, real scale=1.0, real maxLength=1.0, QString name="unamed") | |
Constructor. | |
~TractionSensorGraphic () | |
Destructor. | |
void | setVector (const wVector vector) |
Sets the vector to draw. The vector must be in the object frame of reference. | |
![]() | |
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 | |
const real | m_maxLength |
The maximum length of the vector. | |
WObject *const | m_object |
The object to which this representation is attached. | |
const real | m_radius |
The radius of the arrow. The length depends on the vector intensity. | |
const real | m_scale |
The scaling factor for the vector length. | |
wVector | m_vector |
The vector to represent. | |
QMutex | m_vectorMutex |
The mutex protecting the m_vector vector. | |
![]() | |
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 MarXbot traction sensor.
The arrow is drawn as a cylinder with a cone on top
Definition at line 489 of file marxbotsensors.cpp.
Constructor & Destructor Documentation
|
inline |
Constructor.
This also sets a default color for the piece and sets handPiece to be our owner. This draws an arrow representing a vector
- Parameters
-
object the object to which this representation is attached. This must not be NULL offset the offset relative to object. The arrow starts from the offset in the frame of reference of the object radius the radius of the arrow. The length depends on the vector intensity scale the scaling factor for the vector length maxLength the maximum length of the vector. If the vector is longer than this, the arrow is drawn this length with a different color. This is the length BEFORE scaling name the name of this object
Definition at line 512 of file marxbotsensors.cpp.
References GraphicalWObject::attachToObject(), wMatrix::identity(), TractionSensorGraphic::m_object, GraphicalWObject::setTexture(), GraphicalWObject::setUseColorTextureOfOwner(), and wMatrix::w_pos.
|
inline |
Destructor.
Definition at line 534 of file marxbotsensors.cpp.
Member Function Documentation
|
inlineprotectedvirtual |
Performs the actual drawing.
Draws the vector
- 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 562 of file marxbotsensors.cpp.
References GraphicalWObject::color(), RenderWObject::container(), RenderWObjectContainer::drawCylinder(), wMatrix::grammSchmidt(), TractionSensorGraphic::m_maxLength, TractionSensorGraphic::m_radius, TractionSensorGraphic::m_scale, TractionSensorGraphic::m_vector, TractionSensorGraphic::m_vectorMutex, GraphicalWObject::matrix(), min(), GraphicalWObject::setColor(), RenderWObjectContainer::setupColorTexture(), GraphicalWObject::tm, and wMatrix::w_pos.
|
inline |
Sets the vector to draw. The vector must be in the object frame of reference.
This function is thread-safe
- Parameters
-
vector the vector to draw. The vector must be in the object frame of reference
Definition at line 546 of file marxbotsensors.cpp.
References TractionSensorGraphic::m_vector, and TractionSensorGraphic::m_vectorMutex.
Referenced by MarXbotTractionSensor::update().
Member Data Documentation
|
protected |
The maximum length of the vector.
If the vector is longer than this, the arrow is drawn this length with a different color. This is the length BEFORE scaling
Definition at line 651 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::render().
|
protected |
The object to which this representation is attached.
Definition at line 631 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::TractionSensorGraphic().
|
protected |
The radius of the arrow. The length depends on the vector intensity.
Definition at line 637 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::render().
|
protected |
The scaling factor for the vector length.
Definition at line 642 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::render().
|
protected |
The vector to represent.
The vector is in the object frame of reference
Definition at line 658 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::render(), and TractionSensorGraphic::setVector().
|
protected |
The mutex protecting the m_vector vector.
The vector could be accessed by multiple threads concurrently, so we protect it with a mutex
Definition at line 666 of file marxbotsensors.cpp.
Referenced by TractionSensorGraphic::render(), and TractionSensorGraphic::setVector().
The documentation for this class was generated from the following file:
- experiments/src/marxbotsensors.cpp