RenderWorld class. More...

Inheritance diagram for RenderWorld:

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 Slots inherited from QGLViewer
void setAxisIsDrawn (bool draw=true)
 Sets the state of axisIsDrawn().
 
void setGridIsDrawn (bool draw=true)
 Sets the state of gridIsDrawn().
 
void setFPSIsDisplayed (bool display=true)
 Sets the state of FPSIsDisplayed().
 
void setTextIsEnabled (bool enable=true)
 Sets the state of textIsEnabled().
 
void setCameraIsEdited (bool edit=true)
 Starts (edit = true, default) or stops (edit=false) the edition of the camera().
 
void toggleAxisIsDrawn ()
 Toggles the state of axisIsDrawn().
 
void toggleGridIsDrawn ()
 Toggles the state of gridIsDrawn().
 
void toggleFPSIsDisplayed ()
 Toggles the state of FPSIsDisplayed().
 
void toggleTextIsEnabled ()
 Toggles the state of textIsEnabled().
 
void toggleCameraIsEdited ()
 Toggles the state of cameraIsEdited().
 
void setBackgroundColor (const QColor &color)
 Sets the backgroundColor() of the viewer and calls qglClearColor().
 
void setForegroundColor (const QColor &color)
 Sets the foregroundColor() of the viewer, used to draw visual hints.
 
virtual void setSceneRadius (float radius)
 Sets the sceneRadius().
 
virtual void setSceneCenter (const qglviewer::Vec &center)
 Sets the sceneCenter(), defined in world coordinates.
 
void setSceneBoundingBox (const qglviewer::Vec &min, const qglviewer::Vec &max)
 Convenient way to call setSceneCenter() and setSceneRadius() from a (world axis aligned) bounding box of the scene.
 
void showEntireScene ()
 Moves the camera so that the entire scene is visible.
 
void setCamera (qglviewer::Camera *const camera)
 Associates a new qglviewer::Camera to the viewer.
 
void setManipulatedFrame (qglviewer::ManipulatedFrame *frame)
 Sets the viewer's manipulatedFrame().
 
void setMouseGrabber (qglviewer::MouseGrabber *mouseGrabber)
 Directly defines the mouseGrabber().
 
void setFullScreen (bool fullScreen=true)
 Sets the isFullScreen() state.
 
void setStereoDisplay (bool stereo=true)
 Sets the state of displaysInStereo().
 
void toggleFullScreen ()
 Toggles the state of isFullScreen().
 
void toggleStereoDisplay ()
 Toggles the state of displaysInStereo().
 
void toggleCameraMode ()
 Swaps between two predefined camera mouse bindings.
 
void saveSnapshot (bool automatic=true, bool overwrite=false)
 Saves a snapshot of the current image displayed by the widget.
 
void saveSnapshot (const QString &fileName, bool overwrite=false)
 Same as saveSnapshot(), except that it uses fileName instead of snapshotFileName().
 
void setSnapshotFileName (const QString &name)
 Sets snapshotFileName().
 
void setSnapshotFormat (const QString &format)
 Sets the snapshotFormat().
 
void setSnapshotCounter (int counter)
 Sets the snapshotCounter().
 
void setSnapshotQuality (int quality)
 Sets the snapshotQuality().
 
bool openSnapshotFormatDialog ()
 Opens a dialog that displays the different available snapshot formats.
 
void snapshotToClipboard ()
 Takes a snapshot of the current display and pastes it to the clipboard.
 
void copyBufferToTexture (GLint internalFormat, GLenum format=GL_NONE)
 Makes a copy of the current buffer into a texture.
 
void setAnimationPeriod (int period)
 Sets the animationPeriod(), in milliseconds.
 
virtual void startAnimation ()
 Starts the animation loop.
 
virtual void stopAnimation ()
 Stops animation.
 
virtual void animate ()
 Scene animation method.
 
void toggleAnimation ()
 Calls startAnimation() or stopAnimation(), depending on animationIsStarted().
 
virtual void help ()
 Opens a modal help window that includes four tabs, respectively filled with helpString(), keyboardString(), mouseString() and about libQGLViewer.
 
virtual void aboutQGLViewer ()
 Displays the help window "About" tab.
 
virtual void select (const QMouseEvent *event)
 Simple wrapper method: calls select(event->pos()).
 
virtual void select (const QPoint &point)
 This method performs a selection in the scene from pixel coordinates.
 
void setSelectBufferSize (int size)
 Sets the selectBufferSize().
 
void setSelectRegionWidth (int width)
 Sets the selectRegionWidth().
 
void setSelectRegionHeight (int height)
 Sets the selectRegionHeight().
 
void setSelectedName (int id)
 Set the selectedName() value.
 
void setShortcut (KeyboardAction action, int key)
 Defines the shortcut() that triggers a given QGLViewer::KeyboardAction.
 
void setKeyboardAccelerator (KeyboardAction action, int key)
 
void setKeyDescription (int key, QString description)
 Defines a custom keyboard shortcut description, that will be displayed in the help() window Keyboard tab.
 
virtual void setKeyFrameKey (int index, int key)
 
virtual void setPlayKeyFramePathStateKey (int buttonState)
 
virtual void setPlayPathStateKey (int buttonState)
 
virtual void setAddKeyFrameStateKey (int buttonState)
 
virtual void setPathKey (int key, int index=0)
 Sets the pathKey() associated with the camera Key Frame path index.
 
virtual void setPlayPathKeyboardModifiers (QtKeyboardModifiers modifiers)
 Sets the playPathKeyboardModifiers() value.
 
virtual void setAddKeyFrameKeyboardModifiers (QtKeyboardModifiers modifiers)
 Sets the addKeyFrameKeyboardModifiers() value.
 
void setMouseBinding (int state, MouseHandler handler, MouseAction action, bool withConstraint=true)
 Associates a MouseAction to any mouse button and keyboard modifiers state combination.
 
void setWheelBinding (QtKeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true)
 Associates a MouseAction and a MouseHandler to a mouse wheel event.
 
void setHandlerKeyboardModifiers (MouseHandler handler, QtKeyboardModifiers modifiers)
 Associates keyboard modifiers to MouseHandler handler.
 
void setHandlerStateKey (MouseHandler handler, int buttonState)
 
void setMouseStateKey (MouseHandler handler, int buttonState)
 
virtual void initFromDOMElement (const QDomElement &element)
 Restores the QGLViewer state from a QDomElement created by domElement().
 
virtual void saveStateToFile ()
 Saves in stateFileName() an XML representation of the QGLViewer state, obtained from domElement().
 
virtual bool restoreStateFromFile ()
 Restores the QGLViewer state from the stateFileName() file using initFromDOMElement().
 
void setStateFileName (const QString &name)
 Defines the stateFileName() used by saveStateToFile() and restoreStateFromFile().
 
void saveToFile (const QString &fileName=QString::null)
 This method is deprecated since version 1.3.9-5.
 
bool restoreFromFile (const QString &fileName=QString::null)
 This function is deprecated since version 1.3.9-5.
 
virtual void resetVisualHints ()
 Reset the mask used by drawVisualHints().
 

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
 
- Public Member Functions inherited from QGLViewer
 QGLViewer (QWidget *parent=NULL, const char *name=0, const QGLWidget *shareWidget=0, Qt::WFlags flags=0)
 
 QGLViewer (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0, Qt::WFlags flags=0)
 
 QGLViewer (QGLContext *context, QWidget *parent, const char *name=0, const QGLWidget *shareWidget=0, Qt::WFlags flags=0)
 
virtual ~QGLViewer ()
 Virtual destructor.
 
bool axisIsDrawn () const
 Returns true if the world axis is drawn by the viewer.
 
bool gridIsDrawn () const
 Returns true if a XY grid is drawn by the viewer.
 
bool FPSIsDisplayed () const
 Returns true if the viewer displays the current frame rate (Frames Per Second).
 
bool textIsEnabled () const
 Returns true if text display (see drawText()) is enabled.
 
bool cameraIsEdited () const
 Returns true if the camera() is being edited in the viewer.
 
QColor backgroundColor () const
 Returns the background color of the viewer.
 
QColor foregroundColor () const
 Returns the foreground color used by the viewer.
 
float sceneRadius () const
 Returns the scene radius.
 
qglviewer::Vec sceneCenter () const
 Returns the scene center, defined in world coordinates.
 
qglviewer::Cameracamera () const
 Returns the associated qglviewer::Camera, never NULL.
 
qglviewer::ManipulatedFramemanipulatedFrame () const
 Returns the viewer's qglviewer::ManipulatedFrame.
 
qglviewer::MouseGrabbermouseGrabber () const
 Returns the current qglviewer::MouseGrabber, or NULL if no qglviewer::MouseGrabber currently grabs mouse events.
 
void setMouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber, bool enabled=true)
 Sets the mouseGrabberIsEnabled() state.
 
bool mouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber)
 Returns true if mouseGrabber is enabled.
 
float aspectRatio () const
 Returns the aspect ratio of the viewer's widget (width() / height()).
 
float currentFPS ()
 Returns the current averaged viewer frame rate.
 
bool isFullScreen () const
 Returns true if the viewer is in fullScreen mode.
 
bool displaysInStereo () const
 Returns true if the viewer displays in stereo.
 
virtual QSize sizeHint () const
 Returns the recommended size for the QGLViewer.
 
virtual void startScreenCoordinatesSystem (bool upward=false) const
 Modify the projection matrix so that drawing can be done directly with 2D screen coordinates.
 
virtual void stopScreenCoordinatesSystem () const
 Stops the pixel coordinate drawing block started by startScreenCoordinatesSystem().
 
void drawText (int x, int y, const QString &text, const QFont &fnt=QFont())
 Draws text at position x, y (expressed in screen coordinates pixels, origin in the upper left corner of the widget).
 
void displayMessage (const QString &message, int delay=2000)
 Briefly displays a message in the lower left corner of the widget.
 
virtual QImage grabFrameBuffer (bool withAlpha=false)
 
const QString & snapshotFileName () const
 Returns the snapshot file name used by saveSnapshot().
 
const QString & snapshotFilename () const
 
const QString & snapshotFormat () const
 Returns the snapshot file format used by saveSnapshot().
 
int snapshotCounter () const
 Returns the value of the counter used to name snapshots in saveSnapshot() when automatic is true.
 
int snapshotQuality ()
 Defines the image quality of the snapshots produced with saveSnapshot().
 
QFont scaledFont (const QFont &font) const
 Return a possibly scaled version of font, used for snapshot rendering.
 
GLuint bufferTextureId () const
 Returns the texture id of the texture created by copyBufferToTexture().
 
float bufferTextureMaxU () const
 Returns the texture coordinate corresponding to the u extremum of the bufferTexture.
 
float bufferTextureMaxV () const
 Same as bufferTextureMaxU(), but for the v texture coordinate.
 
bool animationIsStarted () const
 Return true when the animation loop is started.
 
int animationPeriod () const
 The animation loop period, in milliseconds.
 
virtual QString helpString () const
 Returns the QString displayed in the help() window main tab.
 
virtual QString mouseString () const
 Returns a QString that describes the application mouse bindings, displayed in the help() window Mouse tab.
 
virtual QString keyboardString () const
 Returns a QString that describes the application keyboard shortcut bindings, and that will be displayed in the help() window Keyboard tab.
 
virtual QString mouseBindingsString () const
 This method is deprecated, use mouseString() instead.
 
virtual QString shortcutBindingsString () const
 This method is deprecated, use keyboardString() instead.
 
int selectedName () const
 Returns the name (an integer value) of the entity that was last selected by select().
 
int selectBufferSize () const
 Returns the selectBuffer() size.
 
int selectRegionWidth () const
 Returns the width (in pixels) of a selection frustum, centered on the mouse cursor, that is used to select objects.
 
int selectRegionHeight () const
 See the selectRegionWidth() documentation.
 
GLuint * selectBuffer ()
 Returns a pointer to an array of GLuint.
 
int shortcut (KeyboardAction action) const
 Returns the keyboard shortcut associated to a given QGLViewer::KeyboardAction.
 
int keyboardAccelerator (KeyboardAction action) const
 
Qt::Key keyFrameKey (int index) const
 
QtKeyboardModifiers playKeyFramePathStateKey () const
 
QtKeyboardModifiers addKeyFrameStateKey () const
 
QtKeyboardModifiers playPathStateKey () const
 
Qt::Key pathKey (int index) const
 Returns the keyboard key associated to camera Key Frame path index.
 
QtKeyboardModifiers addKeyFrameKeyboardModifiers () const
 Returns the keyboard modifiers that must be pressed with a pathKey() to add the current camera position to a KeyFrame path.
 
QtKeyboardModifiers playPathKeyboardModifiers () const
 Returns the keyboard modifiers that must be pressed with a pathKey() to play a camera KeyFrame path.
 
MouseAction mouseAction (int state) const
 Returns the MouseAction associated with the state mouse button(s) and keyboard modifiers.
 
int mouseHandler (int state) const
 Returns the MouseHandler associated with the state.
 
int mouseButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const
 Returns the mouse buttons and keyboard modifiers (if any) that have to be used to activate action on handler (with constraint or not).
 
ClickAction clickAction (int state, bool doubleClick, QtMouseButtons buttonsBefore) const
 Same as mouseAction(), but for the ClickAction set using setMouseBinding().
 
void getClickButtonState (ClickAction action, int &state, bool &doubleClick, QtMouseButtons &buttonsBefore) const
 Similar to mouseButtonState(), but for ClickAction.
 
MouseAction wheelAction (QtKeyboardModifiers modifiers) const
 Same as mouseAction(), but for the wheel action.
 
int wheelHandler (QtKeyboardModifiers modifiers) const
 Same as mouseHandler() but for the wheel action.
 
int wheelButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const
 Same as mouseButtonState(), but for the wheel.
 
void setMouseBinding (int state, ClickAction action, bool doubleClick=false, QtMouseButtons buttonsBefore=Qt::NoButton)
 Associates a ClickAction to any mouse buttons and keyboard modifiers combination.
 
void setMouseBindingDescription (int state, QString description, bool doubleClick=false, QtMouseButtons buttonsBefore=Qt::NoButton)
 Provides a custom mouse binding description, displayed in the help() window Mouse tab.
 
QString stateFileName () const
 Returns the state file name.
 
virtual QDomElement domElement (const QString &name, QDomDocument &document) const
 Returns an XML QDomElement that represents the QGLViewer.
 
virtual void setVisualHintsMask (int mask, int delay=2000)
 Defines the mask that will be used to drawVisualHints().
 
virtual void drawVisualHints ()
 Draws viewer related visual hints.
 
- Public Member Functions inherited from RenderWObjectContainer
 RenderWObjectContainer (QString wResName="world")
 Constructor.
 
virtual ~RenderWObjectContainer ()
 Destructor.
 
bool addTextureImage (QString filename, QString texturename)
 Add a new texture image associating with it the name specified.
 
void applyTexture (QGLContext *gw, QString texts)
 Setup only the Texture.
 
void drawSkyGroundBox (QGLContext *)
 Draw a Sky and a Ground (not static because it uses world dimensions)
 
const QVector< RenderWObject * > graphics ()
 return all RenderWObject presents
 
RenderWObjectoperator[] (const WObject *)
 This operator return the RenderWObject associate with WObject passed.
 
void setupColorTexture (QGLContext *, RenderWObject *obj)
 Setup the Color and Texture into the OpenGL Context for RenderWObject passed.
 
void setWorld (World *newworld)
 Set the World to render.
 
QImage textureImage (QString texture)
 Return the corresponding QImage for the texture name passed.
 
- Public Member Functions inherited from ConcurrentResourcesUser
void addUsableResource (QString resource)
 
void addUsableResources (QStringList resources)
 
void declareResource (QString name, T *resource, QString lockBuddy="")
 
void deleteResource (QString name)
 
T * getResource (QString name, bool *resourceExists=NULL)
 
bool hasResource (QString name) const
 
void removeAllUsableResources ()
 
void removeUsableResource (QString resource)
 
void removeUsableResources (QStringList resources)
 
virtual void shareResourcesWith (ResourcesUser *buddy)
 
void usableResources (QStringList resources)
 
bool usedResourcesExist (QStringList *nonExistingResources=NULL) const
 

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.
 
- Protected Member Functions inherited from QGLViewer
virtual void drawLight (GLenum light, float scale=1.0f) const
 Draws a representation of light.
 
QTabWidget * helpWidget ()
 Returns a pointer to the help widget.
 
virtual void resizeGL (int width, int height)
 Callback method used when the widget size is modified.
 
virtual void initializeGL ()
 Initializes the QGLViewer OpenGL context and then calls user-defined init().
 
virtual void paintGL ()
 Main paint method, inherited from QGLWidget.
 
virtual void preDraw ()
 Sets OpenGL state before draw().
 
virtual void preDrawStereo (bool leftBuffer=true)
 Called before draw() (instead of preDraw()) when viewer displaysInStereo().
 
virtual void fastDraw ()
 Draws a simplified version of the scene to guarantee interactive camera displacements.
 
virtual void postDraw ()
 Called after draw() to draw viewer visual hints.
 
virtual void mousePressEvent (QMouseEvent *)
 Overloading of the QWidget method.
 
virtual void mouseMoveEvent (QMouseEvent *)
 Overloading of the QWidget method.
 
virtual void mouseReleaseEvent (QMouseEvent *)
 Overloading of the QWidget method.
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 Overloading of the QWidget method.
 
virtual void wheelEvent (QWheelEvent *)
 Overloading of the QWidget method.
 
virtual void timerEvent (QTimerEvent *)
 Overloading of the QObject method.
 
virtual void closeEvent (QCloseEvent *)
 Overloading of the QWidget method.
 
virtual void beginSelection (const QPoint &point)
 This method should prepare the selection.
 
virtual void endSelection (const QPoint &point)
 This method is called by select() after scene elements were drawn by drawWithNames().
 
- Protected Member Functions inherited from RenderWObjectContainer
void addObject (WObject *)
 add an Object
 
void removeObject (WObject *)
 remove an Object
 
Worldworld ()
 return the World.
 
- Protected Member Functions inherited from ConcurrentResourcesUser
T * getResource ()
 
ResourcesUseroperator= (const ResourcesUser &other)
 
 ResourcesUser ()
 
 ResourcesUser (const ResourcesUser &other)
 
- Protected Member Functions inherited from ResourcesUser
 ResourcesUser (const ResourcesUser &other)
 
virtual void notifyResourceChange (ResourceHandler *resource, ResourceChangeType changeType)=0
 
ResourcesUseroperator= (const ResourcesUser &other)
 

Additional Inherited Members

- Public Types inherited from QGLViewer
enum  MouseAction {
  NO_MOUSE_ACTION, ROTATE, ZOOM, TRANSLATE,
  MOVE_FORWARD, LOOK_AROUND, MOVE_BACKWARD, SCREEN_ROTATE,
  ROLL, DRIVE, SCREEN_TRANSLATE, ZOOM_ON_REGION
}
 Defines the possible actions that can be binded to a mouse motion (a click, followed by a mouse displacement). More...
 
- Public Types inherited from ConcurrentResourcesUser
typedef
Resource::ResourceChangeType 
ResourceChangeType
 
- Signals inherited from QGLViewer
void animateNeeded ()
 Signal emitted by the default animate() method.
 
void axisIsDrawnChanged (bool drawn)
 This signal is emitted whenever axisIsDrawn() changes value.
 
void cameraIsEditedChanged (bool edited)
 This signal is emitted whenever cameraIsEdited() changes value.
 
void drawFinished (bool automatic)
 Signal emitted at the end of the QGLViewer::paintGL() method, when frame is drawn.
 
void drawNeeded ()
 Signal emitted by the default draw() method.
 
void FPSIsDisplayedChanged (bool displayed)
 This signal is emitted whenever FPSIsDisplayed() changes value.
 
void gridIsDrawnChanged (bool drawn)
 This signal is emitted whenever gridIsDrawn() changes value.
 
void helpRequired ()
 Signal emitted by the default QGLViewer::help() method.
 
void mouseGrabberChanged (qglviewer::MouseGrabber *mouseGrabber)
 Signal emitted by setMouseGrabber() when the mouseGrabber() is changed.
 
void pointSelected (const QMouseEvent *e)
 Signal emitted by select().
 
void stereoChanged (bool on)
 This signal is emitted whenever displaysInStereo() changes value.
 
void textIsEnabledChanged (bool enabled)
 This signal is emitted whenever textIsEnabled() changes value.
 
void viewerInitialized ()
 Signal emitted by the default init() method.
 
- Static Public Member Functions inherited from QGLViewer
static void drawArrow (float length=1.0f, float radius=-1.0f, int nbSubdivisions=12)
 Draws a 3D arrow along the positive Z axis.
 
static void drawArrow (const qglviewer::Vec &from, const qglviewer::Vec &to, float radius=-1.0f, int nbSubdivisions=12)
 Draws a 3D arrow between the 3D point from and the 3D point to, both defined in the current ModelView coordinates system.
 
static void drawAxis (float length=1.0f)
 Draws an XYZ axis, with a given size (default is 1.0).
 
static void drawGrid (float size=1.0f, int nbSubdivisions=10)
 Draws a grid in the XY plane, centered on (0,0,0) (defined in the current coordinate system).
 
static const QPtrList
< QGLViewer > & 
QGLViewerPool ()
 Returns a QList that contains pointers to all the created QGLViewers.
 
static int QGLViewerIndex (const QGLViewer *const viewer)
 Returns the index of the QGLViewer viewer in the QGLViewerPool().
 
- Static Public Member Functions inherited from RenderWObjectContainer
static RenderWObjectcreateRenderWObjectFor (const WObject *, RenderWObjectContainer *)
 Create a suitable RenderWObject to render the WObject passed.
 
static void drawCylinder (wVector axis, wVector centre, float len, float radius, QColor c=Qt::green)
 draw a cylinder with aligned with axis given
 
static void drawCylinder (wVector start, wVector end, float radius, QColor c=Qt::green)
 draw a cylinder from start to end
 
static void drawCylinder (const wMatrix &mat, float len, float radius, QColor c=Qt::green)
 draw a cylinder
 
static void drawSphere (wVector pos, real radius)
 draw a sphere in position indicate with radius specified
 
static void drawTorus (real outRad, real innRad, const wMatrix &mat, real angle=2.0 *PI_GRECO, QColor c=Qt::red)
 draw a Torus
 
static void drawTorus (wVector axis, wVector centre, real outRad, real innRad, real angle=2.0 *PI_GRECO)
 draw a Torus
 
static void drawWireBox (wVector dims, wMatrix matrix)
 draw a wireframe Box
 
static void drawWireBox (wVector min, wVector max, const wMatrix &tm)
 draw a wireframe Box
 
static void drawWireBox (wVector min, wVector max)
 draw a wireframe Box
 
template<class renderwobject >
static void registerRenderWObjectFor (QString classname)
 template method for register new RenderWObject classes for new WObject
 
- Protected Types inherited from QGLViewer
enum  KeyboardAction {
  DRAW_AXIS, DRAW_GRID, DISPLAY_FPS, ENABLE_TEXT,
  EXIT_VIEWER, SAVE_SCREENSHOT, CAMERA_MODE, FULL_SCREEN,
  STEREO, ANIMATION, HELP, EDIT_CAMERA,
  MOVE_CAMERA_LEFT, MOVE_CAMERA_RIGHT, MOVE_CAMERA_UP, MOVE_CAMERA_DOWN,
  INCREASE_FLYSPEED, DECREASE_FLYSPEED, SNAPSHOT_TO_CLIPBOARD
}
 Defines the different actions that can be associated with a keyboard shortcut using setShortcut(). More...
 
enum  MouseHandler { CAMERA, FRAME }
 Defines the different mouse handlers: camera() or manipulatedFrame(). More...
 
enum  ClickAction {
  NO_CLICK_ACTION, ZOOM_ON_PIXEL, ZOOM_TO_FIT, SELECT,
  RAP_FROM_PIXEL, RAP_IS_CENTER, CENTER_FRAME, CENTER_SCENE,
  SHOW_ENTIRE_SCENE, ALIGN_FRAME, ALIGN_CAMERA
}
 Defines the possible actions that can be binded to a mouse click using setMouseBinding(int,ClickAction,bool,int). More...
 
- Protected Attributes inherited from RenderWObjectContainer
QMutex mutex
 The mutex protecting accesses to members of this class.
 
- Friends inherited from QGLViewer

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 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 1245 of file renderworld.cpp.

References QGLViewer::drawArrow(), wMatrix::grammSchmidt(), and wVectorT< Shared >::norm().

Referenced by RenderWorld::draw().

void drawWithNames ( )
protectedvirtual

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 keyPressEvent ( QKeyEvent *  e)
protectedvirtual
void postSelection ( const QPoint &  point)
protectedvirtual

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

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
namethe name of the resource that has changed.
chageTypethe 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, RenderWObjectContainer::resourceChanged(), 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: