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 | |
virtual | ~WObject () |
destroy the Object and drop it from the world | |
QColor | color () const |
return the color of this object | |
bool | isInvisible () |
return if it is invisible | |
const wMatrix & | matrix () const |
return a reference to the transformation matrix | |
QString | name () const |
Return the name of this object. | |
virtual void | postUpdate () |
postUpdate the WObject this method is called at each step of the world just after the physic update | |
virtual void | preUpdate () |
preUpdate the WObject this method is called at each step of the world just before the physic update | |
void | setAlpha (int alpha) |
set the value of alpha channel (the transparency) | |
void | setColor (QColor c) |
Set the color to use on rendering. | |
void | setInvisible (bool b) |
set invisibility | |
void | setMatrix (const wMatrix &newm) |
set a new matrix | |
void | setPosition (const wVector &newpos) |
set the position specified in global coordinate frame | |
void | setPosition (real x, real y, real z) |
set the position specified in global coordinate frame | |
void | setTexture (QString textureName) |
Set the texture to use for this WObject when rendered. | |
void | setUseColorTextureOfOwner (bool b) |
set if the object will be rendered with the color and texture of our owner (if we have one) | |
QString | texture () const |
Return the texture name. | |
bool | useColorTextureOfOwner () const |
if true, we will use color and texture of our owner (if we have one) | |
World * | world () |
Return the world. | |
const World * | world () const |
Return the world (const version) | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
Protected Member Functions | |
virtual void | changedMatrix () |
virtual function called when the transformation matrix change | |
Protected Attributes | |
QColor | colorv |
Color, it contains also alpha channel. | |
bool | invisible |
if TRUE it will not renderized | |
QString | namev |
Name of the WObject. | |
QString | texturev |
Texture name. | |
wMatrix | tm |
Trasformation matrix. | |
bool | usecolortextureofowner |
if true, we will use color and texture of our owner (if we have one). | |
World * | worldv |
World. | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
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::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 38 of file wobject.cpp.
References WObject::worldv.
Member Function Documentation
|
protectedvirtual |
virtual function called when the transformation matrix change
Reimplemented in PhyMarXbot, PhyiCub, PhyEpuck, PhyMarXbot, PhyKhepera, and PhyObject.
Definition at line 117 of file wobject.cpp.
Referenced by WObject::setMatrix(), and WObject::setPosition().
QColor color | ( | ) | const |
return the color of this object
Definition at line 84 of file wobject.cpp.
References WObject::colorv.
Referenced by CircularGraphicalMarker::render(), PlanarArrowGraphicalMarker::render(), PhyCylinder::setLowerBaseColor(), RenderWObjectContainer::setupColorTexture(), and PhyCylinder::setUpperBaseColor().
bool isInvisible | ( | ) |
return if it is invisible
Definition at line 109 of file wobject.cpp.
References WObject::invisible.
Referenced by RenderWorld::draw(), and RenderCamera::paintGL().
const wMatrix & matrix | ( | ) | const |
return a reference to the transformation matrix
Definition at line 42 of file wobject.cpp.
References WObject::tm.
Referenced by PhyObjectsGroup::addObject(), PhyBallAndSocket::centre(), PhyFixed::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(), PhyiCub::PhyiCub(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), PhySuspension::PhySuspension(), PhyUniversal::PhyUniversal(), PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), PhyEpuck::postUpdate(), PhyMarXbot::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), PhyObjectsGroup::setDOFPosition(), SingleIR::update(), PhyBallAndSocket::updateJointInfo(), PhyFixed::updateJointInfo(), PhySuspension::updateJointInfo(), PhyUniversal::updateJointInfo(), PhyHinge::updateJointInfo(), GraphicalWObject::updateMatrixFromAttachedObject(), PhyObjectsGroup::updateRelativePositions(), and WCamera::WCamera().
QString name | ( | ) | const |
Return the name of this object.
Definition at line 64 of file wobject.cpp.
References WObject::namev.
Referenced by PhyiCub::enableCameras(), PhyiCub::enableRightArmCartesianController(), World::getObject(), YarpObject::registerServerControlBoard(), YarpObject::registerServerFrameGrabber(), YarpObject::removeServerControlBoard(), WCamera::WCamera(), WObject::WObject(), and WorldController::WorldController().
|
virtual |
postUpdate the WObject this method is called at each step of the world just after the physic update
Reimplemented in PhyMarXbot, PhyObjectsGroup, PhyiCub, PhyEpuck, PhyKhepera, WCamera, and PhyMarXbot.
Definition at line 100 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, PhyObjectsGroup, PhyiCub, PhyEpuck, PhyKhepera, WCamera, and PhyMarXbot.
Definition at line 96 of file wobject.cpp.
void setAlpha | ( | int | alpha | ) |
set the value of alpha channel (the transparency)
Definition at line 80 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 76 of file wobject.cpp.
References WObject::colorv.
Referenced by PhyEpuck::PhyEpuck(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), SingleIRGraphic::SingleIRGraphic(), and WCamera::WCamera().
void setInvisible | ( | bool | b | ) |
set invisibility
Invisible means that the object will be never rendered on widgets
Definition at line 113 of file wobject.cpp.
References WObject::invisible.
void setMatrix | ( | const wMatrix & | newm | ) |
set a new matrix
Definition at line 104 of file wobject.cpp.
References WObject::changedMatrix(), and WObject::tm.
Referenced by PhyKhepera::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), PhyMarXbot::enableAttachmentDevice(), PhyEpuck::PhyEpuck(), PhyiCub::PhyiCub(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), WCamera::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), GraphicalWObject::updateMatrixFromAttachedObject(), and WCamera::WCamera().
void setPosition | ( | const wVector & | newpos | ) |
set the position specified in global coordinate frame
Definition at line 46 of file wobject.cpp.
References WObject::changedMatrix(), and WObject::tm.
Referenced by PhyiCub::PhyiCub().
void setPosition | ( | real | x, |
real | y, | ||
real | z | ||
) |
set the position specified in global coordinate frame
Definition at line 51 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 68 of file wobject.cpp.
References WObject::texturev.
Referenced by PhyiCub::PhyiCub(), 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 92 of file wobject.cpp.
References WObject::usecolortextureofowner.
Referenced by PhyMarXbot::PhyMarXbot(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), and SingleIRGraphic::SingleIRGraphic().
QString texture | ( | ) | const |
Return the texture name.
Definition at line 72 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 88 of file wobject.cpp.
References WObject::usecolortextureofowner.
Referenced by RenderWObjectContainer::setupColorTexture().
World * world | ( | ) |
Return the world.
Definition at line 56 of file wobject.cpp.
References WObject::worldv.
Referenced by PhyCompoundObject::createPrivateObject(), PhyMarXbot::enableAttachmentDevice(), PhyiCub::enableCameras(), PhyiCub::enableRightArmCartesianController(), PhyJoint::PhyJoint(), PhyMarXbot::PhyMarXbot(), PhyMarXbot::preUpdate(), PhyKhepera::preUpdate(), PhyEpuck::preUpdate(), YarpObject::registerServerControlBoard(), YarpObject::registerServerFrameGrabber(), YarpObject::removeServerControlBoard(), PhyMarXbot::setDrawFrontMarker(), PhyKhepera::setDrawFrontMarker(), PhyEpuck::setDrawFrontMarker(), SingleIR::update(), WCamera::WCamera(), and WorldController::WorldController().
const World * world | ( | ) | const |
Return the world (const version)
Definition at line 60 of file wobject.cpp.
References WObject::worldv.
Member Data Documentation
|
protected |
Color, it contains also alpha channel.
Definition at line 117 of file wobject.h.
Referenced by WObject::color(), PhyCylinder::graphicalRepresentationNeedsUpdate(), WObject::setAlpha(), WObject::setColor(), PhyCylinder::setLowerBaseColor(), PhyCylinder::setSegmentsColor(), PhyCylinder::setUpperBaseColor(), and WObject::WObject().
|
protected |
if TRUE it will not renderized
Definition at line 119 of file wobject.h.
Referenced by WObject::isInvisible(), WObject::setInvisible(), and WObject::WObject().
|
protected |
Name of the WObject.
Definition at line 113 of file wobject.h.
Referenced by WObject::name(), and WObject::WObject().
|
protected |
Texture name.
Definition at line 115 of file wobject.h.
Referenced by WObject::setTexture(), WObject::texture(), and WObject::WObject().
|
protected |
Trasformation matrix.
Definition at line 111 of file wobject.h.
Referenced by PhyObject::changedMatrix(), PhyKhepera::changedMatrix(), PhyMarXbot::changedMatrix(), PhyEpuck::changedMatrix(), WObject::matrix(), PhyEpuck::PhyEpuck(), PhyiCub::PhyiCub(), PhyKhepera::PhyKhepera(), PhyMarXbot::PhyMarXbot(), PhyObjectsGroup::PhyObjectsGroup(), PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), PhyEpuck::postUpdate(), CircularGraphicalMarker::render(), PlanarArrowGraphicalMarker::render(), SingleIRGraphic::render(), PhyObject::setKinematic(), WObject::setMatrix(), WObject::setPosition(), PhyiCub::setTorso0Matrix(), 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 121 of file wobject.h.
Referenced by WObject::setUseColorTextureOfOwner(), WObject::useColorTextureOfOwner(), and WObject::WObject().
|
protected |
Definition at line 109 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