Public Member Functions | |
WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true) | |
create the object and automatically put this into the world More... | |
virtual | ~WObject () |
destroy the Object and drop it from the world More... | |
QColor | color () const |
return the color of this object More... | |
void | drawLocalAxes (bool d) |
Sets whether the object local frame of reference should be drawn or not. More... | |
bool | isInvisible () const |
return if it is invisible More... | |
const QString & | label () const |
Returns the text label to render along with the object. More... | |
const QColor & | labelColor () const |
Returns the color of the label. More... | |
const wVector & | labelPosition () const |
Returns the label position relative to this object. More... | |
bool | labelShown () const |
Returns whether the label is shown or not. More... | |
bool | localAxesDrawn () const |
Returns true if the local frame of refecence of the object should be drawn. More... | |
const wMatrix & | matrix () const |
return a reference to the transformation matrix More... | |
QString | name () const |
Return the name of this object. More... | |
virtual void | postUpdate () |
postUpdate the WObject this method is called at each step of the world just after the physic update More... | |
virtual void | preUpdate () |
preUpdate the WObject this method is called at each step of the world just before the physic update More... | |
void | setAlpha (int alpha) |
set the value of alpha channel (the transparency) More... | |
void | setColor (QColor c) |
Set the color to use on rendering. More... | |
void | setInvisible (bool b) |
set invisibility More... | |
void | setLabel (QString label) |
Sets a text label to render along with the object. More... | |
void | setLabel (QString label, wVector pos) |
Sets a text label to render along with the object and its position. More... | |
void | setLabel (QString label, wVector pos, QColor color) |
Sets a text label to render along with the object and its position and color. More... | |
void | setLabelColor (const QColor &color) |
Sets the color of the label. More... | |
void | setLabelPosition (const wVector &pos) |
Sets the label position relative to this object. More... | |
void | setMatrix (const wMatrix &newm) |
set a new matrix More... | |
void | setPosition (const wVector &newpos) |
set the position specified in global coordinate frame More... | |
void | setPosition (real x, real y, real z) |
set the position specified in global coordinate frame More... | |
void | setTexture (QString textureName) |
Set the texture to use for this WObject when rendered. More... | |
void | setUseColorTextureOfOwner (bool b) |
set if the object will be rendered with the color and texture of our owner (if we have one) More... | |
void | showLabel (bool show) |
Sets whether to show the label or not. More... | |
QString | texture () const |
Return the texture name. More... | |
bool | useColorTextureOfOwner () const |
if true, we will use color and texture of our owner (if we have one) More... | |
World * | world () |
Return the world. More... | |
const World * | world () const |
Return the world (const version) More... | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. More... | |
virtual | ~Ownable () |
Destructor. More... | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. More... | |
Ownable * | owner () const |
Returns the owner of this object. More... | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. More... | |
Protected Member Functions | |
virtual void | changedMatrix () |
virtual function called when the transformation matrix change More... | |
Protected Attributes | |
QColor | colorv |
Color, it contains also alpha channel. More... | |
bool | invisible |
if TRUE it will not renderized More... | |
QColor | labelcol |
The color of the label. More... | |
bool | labeldrawn |
Whether the label should be rendered or not. More... | |
wVector | labelpos |
The position of the label in the object frame of reference. More... | |
QString | labelv |
The text label of the object. More... | |
bool | localFrameOfReferenceDrawn |
If true, the local frame of reference of the object is drawn. More... | |
QString | namev |
Name of the WObject. More... | |
QString | texturev |
Texture name. More... | |
wMatrix | tm |
Trasformation matrix. More... | |
bool | usecolortextureofowner |
if true, we will use color and texture of our owner (if we have one). More... | |
World * | worldv |
World. More... | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. More... | |
Detailed Description
Constructor & Destructor Documentation
WObject | ( | World * | world, |
QString | name = "unamed" , |
||
const wMatrix & | tm = wMatrix::identity() , |
||
bool | addToWorld = true |
||
) |
create the object and automatically put this into the world
- Parameters
-
world the world where object lives name the name of the object tm rotation and position in global coordinate frame addToWorld if true the object is added to the world, if false it is not. This parameter should be set to false when this constructor is called by the constructor of a subclass because otherwise RTTI in this moment (e.g. in RenderWorld) identifies the newly added object as a WObject instead of the actual type (as the subclasses have not been constructed yet when the object is added to the world)
Definition at line 25 of file wobject.cpp.
References WObject::colorv, WObject::invisible, WObject::labelcol, WObject::labeldrawn, WObject::labelpos, WObject::labelv, WObject::localFrameOfReferenceDrawn, WObject::name(), WObject::namev, WObject::texturev, WObject::tm, WObject::usecolortextureofowner, and WObject::worldv.
|
virtual |
destroy the Object and drop it from the world
Definition at line 43 of file wobject.cpp.
References WObject::worldv.
Member Function Documentation
|
protectedvirtual |
virtual function called when the transformation matrix change
Reimplemented in PhyMarXbot, PhyEpuck, PhyMarXbot, PhyKhepera, and PhyObject.
Definition at line 178 of file wobject.cpp.
Referenced by WObject::setMatrix(), and WObject::setPosition().
QColor color | ( | ) | const |
return the color of this object
Definition at line 89 of file wobject.cpp.
References WObject::colorv.
Referenced by PhyCylinder::graphicalRepresentationNeedsUpdate(), PhyMarXbot::ledColors(), PhyEpuck::ledColors(), PhyMarXbot::PhyMarXbot(), CircularGraphicalMarker::render(), PlanarArrowGraphicalMarker::render(), PhyMarXbot::segmentsColor(), PhyEpuck::segmentsColor(), WObject::setLabel(), WObject::setLabelColor(), PhyMarXbot::setLedColors(), PhyEpuck::setLedColors(), PhyCylinder::setLowerBaseColor(), PhyCylinder::setSegmentsColor(), RenderWObjectContainer::setupColorTexture(), PhyCylinder::setUpperBaseColor(), and RenderPhyCylinder::updateRepresentation().
void drawLocalAxes | ( | bool | d | ) |
Sets whether the object local frame of reference should be drawn or not.
By default the local frame of reference is not drawn. Note that some objects don't support drawing the local frame of reference. The X axis is drawn in red, the Y in green and the Z in blue.
- Parameters
-
d if true the local frame of reference should be drawn
Definition at line 122 of file wobject.cpp.
References WObject::localFrameOfReferenceDrawn.
Referenced by RenderWorld::draw().
bool isInvisible | ( | ) | const |
return if it is invisible
Definition at line 114 of file wobject.cpp.
References WObject::invisible.
Referenced by RenderWorld::draw().
const QString & label | ( | ) | const |
Returns the text label to render along with the object.
- Returns
- the label to show
Definition at line 143 of file wobject.cpp.
References WObject::labelv.
Referenced by WObject::setLabel().
const QColor & labelColor | ( | ) | const |
Returns the color of the label.
- Returns
- the color of the label
Definition at line 163 of file wobject.cpp.
References WObject::labelcol.
const wVector & labelPosition | ( | ) | const |
Returns the label position relative to this object.
- Returns
- the label position in the object frame of reference
Definition at line 153 of file wobject.cpp.
References WObject::labelpos.
bool labelShown | ( | ) | const |
Returns whether the label is shown or not.
- Returns
- true if the label is shown
Definition at line 173 of file wobject.cpp.
References WObject::labeldrawn.
Referenced by RenderWorld::draw().
bool localAxesDrawn | ( | ) | const |
Returns true if the local frame of refecence of the object should be drawn.
- Returns
- true if the local frame of reference should be drawn
Definition at line 126 of file wobject.cpp.
References WObject::localFrameOfReferenceDrawn.
Referenced by RenderWorld::draw().
const wMatrix & matrix | ( | ) | const |
return a reference to the transformation matrix
Definition at line 47 of file wobject.cpp.
References WObject::tm.
Referenced by PhyBallAndSocket::centre(), PhyFixed::centre(), PhySlider::centre(), PhySuspension::centre(), PhyUniversal::centre(), PhyHinge::centre(), PhyKhepera::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), World::checkContacts(), World::closestPoints(), World::collisionRayCast(), RenderWorld::draw(), PhyMarXbot::enableAttachmentDevice(), PhyBallAndSocket::PhyBallAndSocket(), PhyEpuck::PhyEpuck(), PhyFixed::PhyFixed(), PhyHinge::PhyHinge(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhySlider::PhySlider(), PhySuspension::PhySuspension(), PhyUniversal::PhyUniversal(), PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), PhyEpuck::postUpdate(), PhyMarXbot::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), SingleIR::update(), PhyBallAndSocket::updateJointInfo(), PhyFixed::updateJointInfo(), PhySlider::updateJointInfo(), PhySuspension::updateJointInfo(), PhyUniversal::updateJointInfo(), PhyHinge::updateJointInfo(), and GraphicalWObject::updateMatrixFromAttachedObject().
QString name | ( | ) | const |
Return the name of this object.
Definition at line 69 of file wobject.cpp.
References WObject::namev.
Referenced by World::getObject(), and WObject::WObject().
|
virtual |
postUpdate the WObject this method is called at each step of the world just after the physic update
Reimplemented in PhyMarXbot, PhyEpuck, PhyKhepera, and PhyMarXbot.
Definition at line 105 of file wobject.cpp.
|
virtual |
preUpdate the WObject this method is called at each step of the world just before the physic update
Reimplemented in PhyMarXbot, PhyEpuck, PhyKhepera, and PhyMarXbot.
Definition at line 101 of file wobject.cpp.
void setAlpha | ( | int | alpha | ) |
set the value of alpha channel (the transparency)
Definition at line 85 of file wobject.cpp.
References WObject::colorv.
Referenced by RenderWorld::draw().
void setColor | ( | QColor | c | ) |
Set the color to use on rendering.
When the texture is setted, then the color is behind the texture. To display the object with only color set the texture to "none" - setTexture("none")
Definition at line 81 of file wobject.cpp.
References WObject::colorv.
Referenced by PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), and SingleIRGraphic::SingleIRGraphic().
void setInvisible | ( | bool | b | ) |
set invisibility
Invisible means that the object will be never rendered on widgets
Definition at line 118 of file wobject.cpp.
References WObject::invisible.
void setLabel | ( | QString | label | ) |
Sets a text label to render along with the object.
- Parameters
-
label the label to show
Definition at line 131 of file wobject.cpp.
References WObject::label(), and WObject::labelv.
void setLabel | ( | QString | label, |
wVector | pos | ||
) |
Sets a text label to render along with the object and its position.
- Parameters
-
label the label to show pos the position of the label in the object frame of reference
void setLabel | ( | QString | label, |
wVector | pos, | ||
QColor | color | ||
) |
Sets a text label to render along with the object and its position and color.
- Parameters
-
label the label to show pos the position of the label in the object frame of reference color the color of the label
Definition at line 136 of file wobject.cpp.
References WObject::color(), WObject::label(), WObject::labelcol, WObject::labelpos, and WObject::labelv.
void setLabelColor | ( | const QColor & | color | ) |
Sets the color of the label.
- Parameters
-
color the color of the label
Definition at line 158 of file wobject.cpp.
References WObject::color(), and WObject::labelcol.
void setLabelPosition | ( | const wVector & | pos | ) |
Sets the label position relative to this object.
- Parameters
-
pos the label position in the object frame of reference
Definition at line 148 of file wobject.cpp.
References WObject::labelpos.
void setMatrix | ( | const wMatrix & | newm | ) |
set a new matrix
Definition at line 109 of file wobject.cpp.
References WObject::changedMatrix(), and WObject::tm.
Referenced by PhyKhepera::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), PhyMarXbot::enableAttachmentDevice(), PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), and GraphicalWObject::updateMatrixFromAttachedObject().
void setPosition | ( | const wVector & | newpos | ) |
set the position specified in global coordinate frame
Definition at line 51 of file wobject.cpp.
References WObject::changedMatrix(), and WObject::tm.
set the position specified in global coordinate frame
Definition at line 56 of file wobject.cpp.
References WObject::changedMatrix(), and WObject::tm.
void setTexture | ( | QString | textureName | ) |
Set the texture to use for this WObject when rendered.
Definition at line 73 of file wobject.cpp.
References WObject::texturev.
Referenced by PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), and SingleIRGraphic::SingleIRGraphic().
void setUseColorTextureOfOwner | ( | bool | b | ) |
set if the object will be rendered with the color and texture of our owner (if we have one)
Definition at line 97 of file wobject.cpp.
References WObject::usecolortextureofowner.
Referenced by PhyMarXbot::PhyMarXbot(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), PhyMarXbot::setLedColors(), PhyEpuck::setLedColors(), and SingleIRGraphic::SingleIRGraphic().
void showLabel | ( | bool | show | ) |
Sets whether to show the label or not.
- Parameters
-
show if true shows the label
Definition at line 168 of file wobject.cpp.
References WObject::labeldrawn.
Referenced by RenderWorld::draw().
QString texture | ( | ) | const |
Return the texture name.
Definition at line 77 of file wobject.cpp.
References WObject::texturev.
Referenced by RenderWObjectContainer::setupColorTexture().
bool useColorTextureOfOwner | ( | ) | const |
if true, we will use color and texture of our owner (if we have one)
Definition at line 93 of file wobject.cpp.
References WObject::usecolortextureofowner.
Referenced by PhyCylinder::graphicalRepresentationNeedsUpdate(), RenderWObjectContainer::setupColorTexture(), and RenderPhyCylinder::updateRepresentation().
World * world | ( | ) |
Return the world.
Definition at line 61 of file wobject.cpp.
References WObject::worldv.
Referenced by PhyCompoundObject::createPrivateObject(), PhyMarXbot::enableAttachmentDevice(), PhyJoint::PhyJoint(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), and SingleIR::update().
const World * world | ( | ) | const |
Return the world (const version)
Definition at line 65 of file wobject.cpp.
References WObject::worldv.
Member Data Documentation
|
protected |
Color, it contains also alpha channel.
Definition at line 199 of file wobject.h.
Referenced by WObject::color(), PhyCylinder::PhyCylinder(), WObject::setAlpha(), WObject::setColor(), PhyCylinder::setLowerBaseColor(), PhyCylinder::setSegmentsColor(), PhyCylinder::setUpperBaseColor(), and WObject::WObject().
|
protected |
if TRUE it will not renderized
Definition at line 201 of file wobject.h.
Referenced by WObject::isInvisible(), WObject::setInvisible(), and WObject::WObject().
|
protected |
The color of the label.
Definition at line 211 of file wobject.h.
Referenced by WObject::labelColor(), WObject::setLabel(), WObject::setLabelColor(), and WObject::WObject().
|
protected |
Whether the label should be rendered or not.
Definition at line 213 of file wobject.h.
Referenced by WObject::labelShown(), WObject::showLabel(), and WObject::WObject().
|
protected |
The position of the label in the object frame of reference.
Definition at line 209 of file wobject.h.
Referenced by WObject::labelPosition(), WObject::setLabel(), WObject::setLabelPosition(), and WObject::WObject().
|
protected |
The text label of the object.
Definition at line 207 of file wobject.h.
Referenced by WObject::label(), WObject::setLabel(), and WObject::WObject().
|
protected |
If true, the local frame of reference of the object is drawn.
Definition at line 205 of file wobject.h.
Referenced by WObject::drawLocalAxes(), WObject::localAxesDrawn(), and WObject::WObject().
|
protected |
Name of the WObject.
Definition at line 195 of file wobject.h.
Referenced by WObject::name(), and WObject::WObject().
|
protected |
Texture name.
Definition at line 197 of file wobject.h.
Referenced by WObject::setTexture(), WObject::texture(), and WObject::WObject().
|
protected |
Trasformation matrix.
Definition at line 193 of file wobject.h.
Referenced by PhyObject::changedMatrix(), PhyKhepera::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), WObject::matrix(), PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), PhyEpuck::postUpdate(), CircularGraphicalMarker::render(), PlanarArrowGraphicalMarker::render(), SingleIRGraphic::render(), PhyObject::setKinematic(), WObject::setMatrix(), WObject::setPosition(), and WObject::WObject().
|
protected |
if true, we will use color and texture of our owner (if we have one).
True by default
Definition at line 203 of file wobject.h.
Referenced by WObject::setUseColorTextureOfOwner(), WObject::useColorTextureOfOwner(), and WObject::WObject().
|
protected |
Definition at line 191 of file wobject.h.
Referenced by WObject::WObject(), WObject::world(), and WObject::~WObject().
The documentation for this class was generated from the following files:
- worldsim/include/wobject.h
- worldsim/src/wobject.cpp