RenderWorld Class Reference
RenderWorld class. More...

Public Slots | |
void | contextMenu (const QPoint &) |
show the context menu | |
void | showAABBs (bool b) |
show/hide AABBs | |
void | showContacts (bool b) |
show/hide visualisation of contacts | |
void | showForces (bool b) |
show/hide visualisation of forces | |
void | showJoints (bool b) |
show/hide visualisation of joints | |
void | showObjects (bool b) |
show/hide visualisation of objects | |
void | showSkyGround (bool b) |
enable/disable SkyBox | |
void | wireframe (bool b) |
if true view object in wireframe mode | |
Public Member Functions | |
RenderWorld (QWidget *parent=NULL, QString wResName="world") | |
Constructor a visualizator of the World passed. | |
virtual | ~RenderWorld () |
Destructor. | |
void | drawArrow (const wVector &from, const wVector &to, float radius=-1, int nbSubdivisions=12, QColor c=Qt::red) |
draw arrow of libQGLViewer has a bug | |
Protected Member Functions | |
virtual void | draw () |
Draw the scene. | |
virtual void | drawWithNames () |
Tell to OpenGL what is selectable (all WObject) | |
virtual void | init () |
Init the renderWorld. | |
virtual void | keyPressEvent (QKeyEvent *e) |
Key bindings. | |
virtual void | postSelection (const QPoint &point) |
Update the association between OpenGL entity selected to corresponding WObject. | |
virtual void | resourceChanged (QString name, ResourceChangeType changeType) |
The function called when a resource you use is changed. |
Detailed Description
RenderWorld class.
\
- Motivation
- Show in a 3D picture what happen in the World
- Description
- Description
- Warnings
- Warnings
Definition at line 292 of file renderworld.h.
Constructor & Destructor Documentation
RenderWorld | ( | QWidget * | parent = NULL , |
QString | wResName = "world" |
||
) |
Constructor a visualizator of the World passed.
Definition at line 401 of file renderworld.cpp.
References QGLViewer::setCamera(), and QGLViewer::setStateFileName().
~RenderWorld | ( | ) | [virtual] |
Destructor.
Definition at line 419 of file renderworld.cpp.
References QGLViewer::saveStateToFile(), and QGLViewer::stateFileName().
Member Function Documentation
void contextMenu | ( | const QPoint & | pos | ) | [slot] |
show the context menu
Definition at line 490 of file renderworld.cpp.
References RenderWorld::showAABBs(), RenderWorld::showContacts(), RenderWorld::showForces(), RenderWorld::showJoints(), RenderWorld::showObjects(), RenderWorld::showSkyGround(), and RenderWorld::wireframe().
Referenced by RenderWorld::keyPressEvent().
void draw | ( | ) | [protected, virtual] |
Draw the scene.
Reimplemented from QGLViewer.
Definition at line 593 of file renderworld.cpp.
References RenderWObject::calculateOBB(), QGLViewer::camera(), RenderWorld::drawArrow(), RenderWObjectContainer::drawSkyGroundBox(), RenderWObjectContainer::drawSphere(), QGLViewer::drawText(), RenderWObjectContainer::drawWireBox(), Camera::frame(), Frame::getPosition(), RenderWObjectContainer::graphics(), WObject::isInvisible(), WObject::matrix(), RenderWObjectContainer::mutex, RenderWObject::object(), RenderWObject::renderAABB(), and RenderWObjectContainer::world().
void drawArrow | ( | const wVector & | from, |
const wVector & | to, | ||
float | radius = -1 , |
||
int | nbSubdivisions = 12 , |
||
QColor | c = Qt::red |
||
) |
draw arrow of libQGLViewer has a bug
Definition at line 1243 of file renderworld.cpp.
References wMatrix::grammSchmidt(), and wVectorT< Shared >::norm().
Referenced by RenderWorld::draw().
void drawWithNames | ( | ) | [protected, virtual] |
Tell to OpenGL what is selectable (all WObject)
Reimplemented from QGLViewer.
Definition at line 694 of file renderworld.cpp.
References RenderWObjectContainer::graphics(), and RenderWObjectContainer::mutex.
void init | ( | ) | [protected, virtual] |
Init the renderWorld.
Reimplemented from QGLViewer.
Definition at line 573 of file renderworld.cpp.
References QGLViewer::camera(), Camera::frame(), farsa::max(), farsa::min(), RenderWObjectContainer::mutex, QGLViewer::restoreStateFromFile(), Frame::setConstraint(), World::size(), QGLViewer::stateFileName(), and RenderWObjectContainer::world().
void keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Key bindings.
Reimplemented from QGLViewer.
Definition at line 716 of file renderworld.cpp.
References QGLViewer::camera(), RenderWorld::contextMenu(), RenderWObjectContainer::mutex, Camera::orientation(), and Camera::setOrientation().
void postSelection | ( | const QPoint & | point | ) | [protected, virtual] |
Update the association between OpenGL entity selected to corresponding WObject.
Reimplemented from QGLViewer.
Definition at line 704 of file renderworld.cpp.
References RenderWObjectContainer::graphics(), RenderWObjectContainer::mutex, and QGLViewer::selectedName().
void resourceChanged | ( | QString | name, |
ResourceChangeType | changeType | ||
) | [protected, virtual] |
The function called when a resource you use is changed.
When this function is called, the lock on the resource is acquired, so you can safely call getResource(). Note however that only the resource being changed is locked, a getResource() on other resources will fail because the lock on them is not acquired. Of course no lock is acquired if the resource was deleted. The default implementation of this function does nothing
- Parameters:
-
name the name of the resource that has changed. chageType the type of change the resource has gone through (whether it was created, modified or deleted)
- Note:
- In multithread applications this function could be called from a thread different from the one this object lives in
Reimplemented from RenderWObjectContainer.
Definition at line 772 of file renderworld.cpp.
References QGLViewer::camera(), Frame::constraint(), Camera::frame(), farsa::max(), farsa::min(), RenderWObjectContainer::mutex, QGLViewer::setSceneBoundingBox(), World::size(), and RenderWObjectContainer::world().
void showAABBs | ( | bool | b | ) | [slot] |
show/hide AABBs
Definition at line 475 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void showContacts | ( | bool | b | ) | [slot] |
show/hide visualisation of contacts
Definition at line 480 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void showForces | ( | bool | b | ) | [slot] |
show/hide visualisation of forces
Definition at line 485 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void showJoints | ( | bool | b | ) | [slot] |
show/hide visualisation of joints
Definition at line 470 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void showObjects | ( | bool | b | ) | [slot] |
show/hide visualisation of objects
Definition at line 465 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void showSkyGround | ( | bool | b | ) | [slot] |
enable/disable SkyBox
Definition at line 460 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
void wireframe | ( | bool | b | ) | [slot] |
if true view object in wireframe mode
Definition at line 455 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
The documentation for this class was generated from the following files:
- worldsim/include/renderworld.h
- worldsim/src/renderworld.cpp