RenderWorld class. More...
Public Slots | |
void | contextMenu (const QPoint &) |
show the context menu More... | |
void | showAABBs (bool b) |
show/hide AABBs More... | |
void | showContacts (bool b) |
show/hide visualisation of contacts More... | |
void | showForces (bool b) |
show/hide visualisation of forces More... | |
void | showJoints (bool b) |
show/hide visualisation of joints More... | |
void | showLabels (bool b) |
show/hide visualisation of labels for all objects More... | |
void | showLocalAxes (bool b) |
show/hide visualisation of local axes for all objects More... | |
void | showObjects (bool b) |
show/hide visualisation of objects More... | |
void | showSkyGround (bool b) |
enable/disable SkyBox More... | |
void | showTimeAndStep (bool b) |
show/hide the time and step More... | |
void | wireframe (bool b) |
if true view object in wireframe mode More... | |
Public Slots inherited from QGLViewer | |
void | setAxisIsDrawn (bool draw=true) |
Sets the state of axisIsDrawn(). More... | |
void | setGridIsDrawn (bool draw=true) |
Sets the state of gridIsDrawn(). More... | |
void | setFPSIsDisplayed (bool display=true) |
Sets the state of FPSIsDisplayed(). More... | |
void | setTextIsEnabled (bool enable=true) |
Sets the state of textIsEnabled(). More... | |
void | setCameraIsEdited (bool edit=true) |
Starts (edit = true , default) or stops (edit= the edition of the camera(). More... | |
void | toggleAxisIsDrawn () |
Toggles the state of axisIsDrawn(). More... | |
void | toggleGridIsDrawn () |
Toggles the state of gridIsDrawn(). More... | |
void | toggleFPSIsDisplayed () |
Toggles the state of FPSIsDisplayed(). More... | |
void | toggleTextIsEnabled () |
Toggles the state of textIsEnabled(). More... | |
void | toggleCameraIsEdited () |
Toggles the state of cameraIsEdited(). More... | |
void | setBackgroundColor (const QColor &color) |
Sets the backgroundColor() of the viewer and calls qglClearColor() . More... | |
void | setForegroundColor (const QColor &color) |
Sets the foregroundColor() of the viewer, used to draw visual hints. More... | |
virtual void | setSceneRadius (float radius) |
Sets the sceneRadius(). More... | |
virtual void | setSceneCenter (const qglviewer::Vec ¢er) |
Sets the sceneCenter(), defined in world coordinates. More... | |
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. More... | |
void | showEntireScene () |
Moves the camera so that the entire scene is visible. More... | |
void | setCamera (qglviewer::Camera *const camera) |
Associates a new qglviewer::Camera to the viewer. More... | |
void | setManipulatedFrame (qglviewer::ManipulatedFrame *frame) |
Sets the viewer's manipulatedFrame(). More... | |
void | setMouseGrabber (qglviewer::MouseGrabber *mouseGrabber) |
Directly defines the mouseGrabber(). More... | |
void | setFullScreen (bool fullScreen=true) |
Sets the isFullScreen() state. More... | |
void | setStereoDisplay (bool stereo=true) |
Sets the state of displaysInStereo(). More... | |
void | toggleFullScreen () |
Toggles the state of isFullScreen(). More... | |
void | toggleStereoDisplay () |
Toggles the state of displaysInStereo(). More... | |
void | toggleCameraMode () |
Swaps between two predefined camera mouse bindings. More... | |
void | saveSnapshot (bool automatic=true, bool overwrite=false) |
Saves a snapshot of the current image displayed by the widget. More... | |
void | saveSnapshot (const QString &fileName, bool overwrite=false) |
Same as saveSnapshot(), except that it uses fileName instead of snapshotFileName(). More... | |
void | setSnapshotFileName (const QString &name) |
Sets snapshotFileName(). More... | |
void | setSnapshotFormat (const QString &format) |
Sets the snapshotFormat(). More... | |
void | setSnapshotCounter (int counter) |
Sets the snapshotCounter(). More... | |
void | setSnapshotQuality (int quality) |
Sets the snapshotQuality(). More... | |
bool | openSnapshotFormatDialog () |
Opens a dialog that displays the different available snapshot formats. More... | |
void | snapshotToClipboard () |
Takes a snapshot of the current display and pastes it to the clipboard. More... | |
void | copyBufferToTexture (GLint internalFormat, GLenum format=GL_NONE) |
Makes a copy of the current buffer into a texture. More... | |
void | setAnimationPeriod (int period) |
Sets the animationPeriod(), in milliseconds. More... | |
virtual void | startAnimation () |
Starts the animation loop. More... | |
virtual void | stopAnimation () |
Stops animation. More... | |
virtual void | animate () |
Scene animation method. More... | |
void | toggleAnimation () |
Calls startAnimation() or stopAnimation(), depending on animationIsStarted(). More... | |
virtual void | help () |
Opens a modal help window that includes four tabs, respectively filled with helpString(), keyboardString(), mouseString() and about libQGLViewer. More... | |
virtual void | aboutQGLViewer () |
Displays the help window "About" tab. More... | |
virtual void | select (const QMouseEvent *event) |
Simple wrapper method: calls select (event->pos()). More... | |
virtual void | select (const QPoint &point) |
This method performs a selection in the scene from pixel coordinates. More... | |
void | setSelectBufferSize (int size) |
Sets the selectBufferSize(). More... | |
void | setSelectRegionWidth (int width) |
Sets the selectRegionWidth(). More... | |
void | setSelectRegionHeight (int height) |
Sets the selectRegionHeight(). More... | |
void | setSelectedName (int id) |
Set the selectedName() value. More... | |
void | setShortcut (KeyboardAction action, unsigned int key) |
Defines the shortcut() that triggers a given QGLViewer::KeyboardAction. More... | |
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. More... | |
void | clearShortcuts () |
Clears all the default keyboard shortcuts. More... | |
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 . More... | |
virtual void | setPlayPathKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
Sets the playPathKeyboardModifiers() value. More... | |
virtual void | setAddKeyFrameKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
Sets the addKeyFrameKeyboardModifiers() value. More... | |
void | setMouseBinding (int state, MouseHandler handler, MouseAction action, bool withConstraint=true) |
This method is deprecated since version 2.5.0. More... | |
void | setMouseBinding (int state, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
This method is deprecated since version 2.5.0. More... | |
void | setMouseBindingDescription (int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
This method is deprecated since version 2.5.0. More... | |
void | setMouseBinding (Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true) |
Defines a MouseAction binding. More... | |
void | setMouseBinding (Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
Defines a ClickAction binding. More... | |
void | setWheelBinding (Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true) |
Defines a mouse wheel binding. More... | |
void | setMouseBindingDescription (Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
Defines a custom mouse binding description, displayed in the help() window's Mouse tab. More... | |
void | setMouseBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true) |
Associates a MouseAction to any mouse button , while keyboard modifiers and key are pressed. More... | |
void | setMouseBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
Associates a ClickAction to a button and keyboard key and modifier(s) combination. More... | |
void | setWheelBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true) |
Associates a MouseAction and a MouseHandler to a mouse wheel event. More... | |
void | setMouseBindingDescription (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
Defines a custom mouse binding description, displayed in the help() window's Mouse tab. More... | |
void | clearMouseBindings () |
Clears all the default mouse bindings. More... | |
MouseAction | wheelAction (Qt::KeyboardModifiers modifiers) const |
This method is deprecated since version 2.5.0. More... | |
int | wheelHandler (Qt::KeyboardModifiers modifiers) const |
This method is deprecated since version 2.5.0. More... | |
void | setHandlerKeyboardModifiers (MouseHandler handler, Qt::KeyboardModifiers modifiers) |
This method has been deprecated since version 2.5.0. More... | |
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(). More... | |
virtual void | saveStateToFile () |
Saves in stateFileName() an XML representation of the QGLViewer state, obtained from domElement(). More... | |
virtual bool | restoreStateFromFile () |
Restores the QGLViewer state from the stateFileName() file using initFromDOMElement(). More... | |
void | setStateFileName (const QString &name) |
Defines the stateFileName() used by saveStateToFile() and restoreStateFromFile(). More... | |
void | saveToFile (const QString &fileName=QString::null) |
This method is deprecated since version 1.3.9-5. More... | |
bool | restoreFromFile (const QString &fileName=QString::null) |
This function is deprecated since version 1.3.9-5. More... | |
virtual void | resetVisualHints () |
Reset the mask used by drawVisualHints(). More... | |
Public Member Functions | |
RenderWorld (QWidget *parent=NULL, QString wResName="world") | |
Constructor a visualizator of the World passed. More... | |
virtual | ~RenderWorld () |
Destructor. More... | |
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 More... | |
bool | viewerStateRestoredFromFile () const |
Returns true if viewer state has been restored from file. More... | |
Public Member Functions inherited from QGLViewer | |
QGLViewer (QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) | |
Constructor. More... | |
QGLViewer (QGLContext *context, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) | |
Same as QGLViewer(), but a QGLContext can be provided so that viewers share GL contexts, even with QGLContext sub-classes (use shareWidget otherwise). More... | |
QGLViewer (const QGLFormat &format, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) | |
Same as QGLViewer(), but a specific QGLFormat can be provided. More... | |
virtual | ~QGLViewer () |
Virtual destructor. More... | |
bool | axisIsDrawn () const |
Returns true if the world axis is drawn by the viewer. More... | |
bool | gridIsDrawn () const |
Returns true if a XY grid is drawn by the viewer. More... | |
bool | FPSIsDisplayed () const |
Returns true if the viewer displays the current frame rate (Frames Per Second). More... | |
bool | textIsEnabled () const |
Returns true if text display (see drawText()) is enabled. More... | |
bool | cameraIsEdited () const |
Returns true if the camera() is being edited in the viewer. More... | |
QColor | backgroundColor () const |
Returns the background color of the viewer. More... | |
QColor | foregroundColor () const |
Returns the foreground color used by the viewer. More... | |
float | sceneRadius () const |
Returns the scene radius. More... | |
qglviewer::Vec | sceneCenter () const |
Returns the scene center, defined in world coordinates. More... | |
qglviewer::Camera * | camera () const |
Returns the associated qglviewer::Camera, never NULL . More... | |
qglviewer::ManipulatedFrame * | manipulatedFrame () const |
Returns the viewer's qglviewer::ManipulatedFrame. More... | |
qglviewer::MouseGrabber * | mouseGrabber () const |
Returns the current qglviewer::MouseGrabber, or NULL if no qglviewer::MouseGrabber currently grabs mouse events. More... | |
void | setMouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber, bool enabled=true) |
Sets the mouseGrabberIsEnabled() state. More... | |
bool | mouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber) |
Returns true if mouseGrabber is enabled. More... | |
float | aspectRatio () const |
Returns the aspect ratio of the viewer's widget (width() / height()). More... | |
float | currentFPS () |
Returns the current averaged viewer frame rate. More... | |
bool | isFullScreen () const |
Returns true if the viewer is in fullScreen mode. More... | |
bool | displaysInStereo () const |
Returns true if the viewer displays in stereo. More... | |
virtual QSize | sizeHint () const |
Returns the recommended size for the QGLViewer. More... | |
virtual void | startScreenCoordinatesSystem (bool upward=false) const |
Modify the projection matrix so that drawing can be done directly with 2D screen coordinates. More... | |
virtual void | stopScreenCoordinatesSystem () const |
Stops the pixel coordinate drawing block started by startScreenCoordinatesSystem(). More... | |
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). More... | |
void | displayMessage (const QString &message, int delay=2000) |
Briefly displays a message in the lower left corner of the widget. More... | |
const QString & | snapshotFileName () const |
Returns the snapshot file name used by saveSnapshot(). More... | |
const QString & | snapshotFilename () const |
const QString & | snapshotFormat () const |
Returns the snapshot file format used by saveSnapshot(). More... | |
int | snapshotCounter () const |
Returns the value of the counter used to name snapshots in saveSnapshot() when automatic is true . More... | |
int | snapshotQuality () |
Defines the image quality of the snapshots produced with saveSnapshot(). More... | |
QFont | scaledFont (const QFont &font) const |
Return a possibly scaled version of font , used for snapshot rendering. More... | |
GLuint | bufferTextureId () const |
Returns the texture id of the texture created by copyBufferToTexture(). More... | |
float | bufferTextureMaxU () const |
Returns the texture coordinate corresponding to the u extremum of the bufferTexture. More... | |
float | bufferTextureMaxV () const |
Same as bufferTextureMaxU(), but for the v texture coordinate. More... | |
bool | animationIsStarted () const |
Return true when the animation loop is started. More... | |
int | animationPeriod () const |
The animation loop period, in milliseconds. More... | |
virtual QString | helpString () const |
Returns the QString displayed in the help() window main tab. More... | |
virtual QString | mouseString () const |
Returns a QString that describes the application mouse bindings, displayed in the help() window Mouse tab. More... | |
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. More... | |
virtual QString | mouseBindingsString () const |
This method is deprecated, use mouseString() instead. More... | |
virtual QString | shortcutBindingsString () const |
This method is deprecated, use keyboardString() instead. More... | |
int | selectedName () const |
Returns the name (an integer value) of the entity that was last selected by select(). More... | |
int | selectBufferSize () const |
Returns the selectBuffer() size. More... | |
int | selectRegionWidth () const |
Returns the width (in pixels) of a selection frustum, centered on the mouse cursor, that is used to select objects. More... | |
int | selectRegionHeight () const |
See the selectRegionWidth() documentation. More... | |
GLuint * | selectBuffer () |
Returns a pointer to an array of GLuint . More... | |
unsigned int | shortcut (KeyboardAction action) const |
Returns the keyboard shortcut associated to a given QGLViewer::KeyboardAction. More... | |
int | keyboardAccelerator (KeyboardAction action) const |
Qt::Key | keyFrameKey (int index) const |
Qt::KeyboardModifiers | playKeyFramePathStateKey () const |
Qt::KeyboardModifiers | addKeyFrameStateKey () const |
Qt::KeyboardModifiers | playPathStateKey () const |
Qt::Key | pathKey (int index) const |
Returns the keyboard key associated to camera Key Frame path index . More... | |
Qt::KeyboardModifiers | addKeyFrameKeyboardModifiers () const |
Returns the keyboard modifiers that must be pressed with a pathKey() to add the current camera position to a KeyFrame path. More... | |
Qt::KeyboardModifiers | playPathKeyboardModifiers () const |
Returns the keyboard modifiers that must be pressed with a pathKey() to play a camera KeyFrame path. More... | |
MouseAction | mouseAction (int state) const |
This method is deprecated since version 2.5.0. More... | |
int | mouseHandler (int state) const |
This method is deprecated since version 2.5.0. More... | |
int | mouseButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
This method is deprecated since version 2.5.0. More... | |
ClickAction | clickAction (int state, bool doubleClick, Qt::MouseButtons buttonsBefore) const |
This method is deprecated since version 2.5.0. More... | |
void | getClickButtonState (ClickAction action, int &state, bool &doubleClick, Qt::MouseButtons &buttonsBefore) const |
This method is deprecated since version 2.5.0. More... | |
int | wheelButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
This method is deprecated since version 2.5.0. More... | |
MouseAction | mouseAction (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) const |
Returns the MouseAction the will be triggered when the mouse button is pressed, while the keyboard modifiers and key are pressed. More... | |
int | mouseHandler (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) const |
Returns the MouseHandler which will be activated when the mouse button is pressed, while the modifiers and key are pressed. More... | |
void | getMouseActionBinding (MouseHandler handler, MouseAction action, bool withConstraint, Qt::Key &key, Qt::KeyboardModifiers &modifiers, Qt::MouseButton &button) const |
Returns the mouse and keyboard state that triggers action on handler withConstraint . More... | |
ClickAction | clickAction (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) const |
Same as mouseAction(), but for the ClickAction set using setMouseBinding(). More... | |
void | getClickActionBinding (ClickAction action, Qt::Key &key, Qt::KeyboardModifiers &modifiers, Qt::MouseButton &button, bool &doubleClick, Qt::MouseButtons &buttonsBefore) const |
Returns the mouse and keyboard state that triggers action . More... | |
MouseAction | wheelAction (Qt::Key key, Qt::KeyboardModifiers modifiers) const |
Returns the MouseAction (if any) that is performed when using the wheel, when the modifiers and key keyboard keys are pressed. More... | |
int | wheelHandler (Qt::Key key, Qt::KeyboardModifiers modifiers) const |
Returns the MouseHandler (if any) that receives wheel events when the modifiers and key keyboard keys are pressed. More... | |
void | getWheelActionBinding (MouseHandler handler, MouseAction action, bool withConstraint, Qt::Key &key, Qt::KeyboardModifiers &modifiers) const |
Returns the keyboard state that triggers action on handler withConstraint using the mouse wheel. More... | |
QString | stateFileName () const |
Returns the state file name. More... | |
virtual QDomElement | domElement (const QString &name, QDomDocument &document) const |
Returns an XML QDomElement that represents the QGLViewer. More... | |
virtual void | setVisualHintsMask (int mask, int delay=2000) |
Defines the mask that will be used to drawVisualHints(). More... | |
virtual void | drawVisualHints () |
Draws viewer related visual hints. More... | |
Public Member Functions inherited from RenderWObjectContainer | |
RenderWObjectContainer (QString wResName="world") | |
Constructor. More... | |
virtual | ~RenderWObjectContainer () |
Destructor. More... | |
void | applyTexture (QGLContext *gw, QString texts) |
Setup only the Texture. More... | |
void | drawSkyGroundBox (QGLContext *) |
Draw a Sky and a Ground (not static because it uses world dimensions) More... | |
const QVector< RenderWObject * > | graphics () |
return all RenderWObject presents More... | |
RenderWObject * | operator[] (const WObject *) |
This operator return the RenderWObject associate with WObject passed. More... | |
void | setupColorTexture (QGLContext *, RenderWObject *obj) |
Setup the Color and Texture into the OpenGL Context for RenderWObject passed. More... | |
void | setWorld (World *newworld) |
Set the World to render. More... | |
QImage | textureImage (QString texture) |
Return the corresponding QImage for the texture name passed. More... | |
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. More... | |
virtual void | drawWithNames () |
Tell to OpenGL what is selectable (all WObject) More... | |
virtual void | init () |
Init the renderWorld. More... | |
virtual void | keyPressEvent (QKeyEvent *e) |
Key bindings. More... | |
virtual void | postSelection (const QPoint &point) |
Update the association between OpenGL entity selected to corresponding WObject. More... | |
virtual void | resourceChanged (QString name, ResourceChangeType changeType) |
The function called when a resource you use is changed. More... | |
Protected Member Functions inherited from QGLViewer | |
virtual void | drawLight (GLenum light, float scale=1.0f) const |
Draws a representation of light . More... | |
QTabWidget * | helpWidget () |
Returns a pointer to the help widget. More... | |
virtual void | resizeGL (int width, int height) |
Callback method used when the widget size is modified. More... | |
virtual void | initializeGL () |
Initializes the QGLViewer OpenGL context and then calls user-defined init(). More... | |
virtual void | paintGL () |
Main paint method, inherited from QGLWidget . More... | |
virtual void | preDraw () |
Sets OpenGL state before draw(). More... | |
virtual void | preDrawStereo (bool leftBuffer=true) |
Called before draw() (instead of preDraw()) when viewer displaysInStereo(). More... | |
virtual void | fastDraw () |
Draws a simplified version of the scene to guarantee interactive camera displacements. More... | |
virtual void | postDraw () |
Called after draw() to draw viewer visual hints. More... | |
virtual void | mousePressEvent (QMouseEvent *) |
Overloading of the QWidget method. More... | |
virtual void | mouseMoveEvent (QMouseEvent *) |
Overloading of the QWidget method. More... | |
virtual void | mouseReleaseEvent (QMouseEvent *) |
Overloading of the QWidget method. More... | |
virtual void | mouseDoubleClickEvent (QMouseEvent *) |
Overloading of the QWidget method. More... | |
virtual void | wheelEvent (QWheelEvent *) |
Overloading of the QWidget method. More... | |
virtual void | keyReleaseEvent (QKeyEvent *) |
virtual void | timerEvent (QTimerEvent *) |
Overloading of the QObject method. More... | |
virtual void | closeEvent (QCloseEvent *) |
Overloading of the QWidget method. More... | |
virtual void | beginSelection (const QPoint &point) |
This method should prepare the selection. More... | |
virtual void | endSelection (const QPoint &point) |
This method is called by select() after scene elements were drawn by drawWithNames(). More... | |
Protected Member Functions inherited from RenderWObjectContainer | |
void | addObject (WObject *) |
add an Object More... | |
void | removeObject (WObject *) |
remove an Object More... | |
World * | world () |
return the World. More... | |
Protected Member Functions inherited from ConcurrentResourcesUser | |
T * | getResource () |
Protected Member Functions inherited from ResourcesUser | |
ResourcesUser (const ResourcesUser &other) | |
virtual void | notifyResourceChange (ResourceHandler *resource, ResourceChangeType changeType)=0 |
ResourcesUser & | operator= (const ResourcesUser &other) |
Additional Inherited Members | |
Public 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(Qt::KeyboardModifiers, Qt::MouseButtons, ClickAction, bool, int). More... | |
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 action (a click, followed by a mouse displacement). More... | |
Public Types inherited from ResourcesUser | |
typedef Resource::ResourceChangeType | ResourceChangeType |
Public Types inherited from Resource | |
enum | ResourceChangeType |
Signals inherited from QGLViewer | |
void | animateNeeded () |
Signal emitted by the default animate() method. More... | |
void | axisIsDrawnChanged (bool drawn) |
This signal is emitted whenever axisIsDrawn() changes value. More... | |
void | cameraIsEditedChanged (bool edited) |
This signal is emitted whenever cameraIsEdited() changes value. More... | |
void | drawFinished (bool automatic) |
Signal emitted at the end of the QGLViewer::paintGL() method, when frame is drawn. More... | |
void | drawNeeded () |
Signal emitted by the default draw() method. More... | |
void | FPSIsDisplayedChanged (bool displayed) |
This signal is emitted whenever FPSIsDisplayed() changes value. More... | |
void | gridIsDrawnChanged (bool drawn) |
This signal is emitted whenever gridIsDrawn() changes value. More... | |
void | helpRequired () |
Signal emitted by the default QGLViewer::help() method. More... | |
void | mouseGrabberChanged (qglviewer::MouseGrabber *mouseGrabber) |
Signal emitted by setMouseGrabber() when the mouseGrabber() is changed. More... | |
void | pointSelected (const QMouseEvent *e) |
Signal emitted by select(). More... | |
void | stereoChanged (bool on) |
This signal is emitted whenever displaysInStereo() changes value. More... | |
void | textIsEnabledChanged (bool enabled) |
This signal is emitted whenever textIsEnabled() changes value. More... | |
void | viewerInitialized () |
Signal emitted by the default init() method. More... | |
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. More... | |
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. More... | |
static void | drawAxis (float length=1.0f) |
Draws an XYZ axis, with a given size (default is 1.0). More... | |
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). More... | |
static const QList< QGLViewer * > & | QGLViewerPool () |
Returns a QList that contains pointers to all the created QGLViewers. More... | |
static int | QGLViewerIndex (const QGLViewer *const viewer) |
Returns the index of the QGLViewer viewer in the QGLViewerPool(). More... | |
Static Public Member Functions inherited from RenderWObjectContainer | |
static bool | addTextureImage (QString filename, QString texturename) |
Add a new texture image associating with it the name specified. More... | |
static RenderWObject * | createRenderWObjectFor (const WObject *, RenderWObjectContainer *) |
Create a suitable RenderWObject to render the WObject passed. More... | |
static void | drawArrow (const wVector &direction, const wVector &start, float radius, float tipRadius, float tipLength, QColor c=Qt::green) |
draw an arrow More... | |
static void | drawCone (const wMatrix &mat, float len, float radius, QColor c=Qt::green) |
draw a cone (the main axis is z, mat center is on the base) More... | |
static void | drawCylinder (wVector axis, wVector centre, float len, float radius, QColor c=Qt::green) |
draw a cylinder with aligned with axis given More... | |
static void | drawCylinder (wVector start, wVector end, float radius, QColor c=Qt::green) |
draw a cylinder from start to end More... | |
static void | drawCylinder (const wMatrix &mat, float len, float radius, QColor c=Qt::green) |
draw a cylinder (the main axis is z, mat center is on the lower base) More... | |
static void | drawSphere (wVector pos, real radius) |
draw a sphere in position indicate with radius specified More... | |
static void | drawTorus (real outRad, real innRad, const wMatrix &mat, real angle=2.0 *PI_GRECO, QColor c=Qt::red) |
draw a Torus More... | |
static void | drawTorus (wVector axis, wVector centre, real outRad, real innRad, real angle=2.0 *PI_GRECO) |
draw a Torus More... | |
static void | drawWireBox (wVector dims, wMatrix matrix) |
draw a wireframe Box More... | |
static void | drawWireBox (wVector min, wVector max, const wMatrix &tm) |
draw a wireframe Box More... | |
static void | drawWireBox (wVector min, wVector max) |
draw a wireframe Box More... | |
template<class renderwobject > | |
static void | registerRenderWObjectFor (QString classname) |
template method for register new RenderWObject classes for new WObject More... | |
Protected Attributes inherited from RenderWObjectContainer | |
QMutex | mutex |
The mutex protecting accesses to members of this class. More... | |
Protected Attributes inherited from ResourcesUser | |
ResourceCollectionHolder | m_resources |
Detailed Description
RenderWorld class.
\
- Motivation
- Show in a 3D picture what happen in the World
- Description
- Description
- Warnings
- Warnings
Definition at line 308 of file renderworld.h.
Constructor & Destructor Documentation
RenderWorld | ( | QWidget * | parent = NULL , |
QString | wResName = "world" |
||
) |
Constructor a visualizator of the World passed.
Definition at line 444 of file renderworld.cpp.
References QGLViewer::setCamera(), and QGLViewer::setStateFileName().
|
virtual |
Destructor.
Definition at line 466 of file renderworld.cpp.
References QGLViewer::saveStateToFile(), and QGLViewer::stateFileName().
Member Function Documentation
|
slot |
show the context menu
Definition at line 552 of file renderworld.cpp.
References RenderWorld::showAABBs(), RenderWorld::showContacts(), RenderWorld::showForces(), RenderWorld::showJoints(), RenderWorld::showLabels(), RenderWorld::showLocalAxes(), RenderWorld::showObjects(), RenderWorld::showSkyGround(), and RenderWorld::wireframe().
Referenced by RenderWorld::keyPressEvent().
|
protectedvirtual |
Draw the scene.
Reimplemented from QGLViewer.
Definition at line 676 of file renderworld.cpp.
References RenderWObject::calculateOBB(), QGLViewer::camera(), RenderWorld::drawArrow(), WObject::drawLocalAxes(), RenderWObjectContainer::drawSkyGroundBox(), RenderWObjectContainer::drawSphere(), QGLViewer::drawText(), RenderWObjectContainer::drawWireBox(), Camera::frame(), Frame::getPosition(), RenderWObjectContainer::graphics(), WObject::isInvisible(), WObject::labelShown(), WObject::localAxesDrawn(), WObject::matrix(), RenderWObjectContainer::mutex, RenderWObject::object(), RenderWObject::renderAABB(), WObject::setAlpha(), WObject::showLabel(), 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 1396 of file renderworld.cpp.
References QGLViewer::drawArrow(), wMatrix::grammSchmidt(), and wVectorT< Shared >::norm().
Referenced by RenderWorld::draw().
|
protectedvirtual |
Tell to OpenGL what is selectable (all WObject)
Reimplemented from QGLViewer.
Definition at line 790 of file renderworld.cpp.
References RenderWObjectContainer::graphics(), and RenderWObjectContainer::mutex.
|
protectedvirtual |
Init the renderWorld.
Reimplemented from QGLViewer.
Definition at line 657 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().
|
protectedvirtual |
Key bindings.
Reimplemented from QGLViewer.
Definition at line 812 of file renderworld.cpp.
References QGLViewer::camera(), RenderWorld::contextMenu(), QGLViewer::keyPressEvent(), RenderWObjectContainer::mutex, Camera::orientation(), and Camera::setOrientation().
|
protectedvirtual |
Update the association between OpenGL entity selected to corresponding WObject.
Reimplemented from QGLViewer.
Definition at line 800 of file renderworld.cpp.
References RenderWObjectContainer::graphics(), RenderWObjectContainer::mutex, QGLViewer::selectedName(), and UNUSED_PARAM.
|
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
-
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 868 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().
|
slot |
show/hide AABBs
Definition at line 522 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of contacts
Definition at line 527 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of forces
Definition at line 532 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of joints
Definition at line 517 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of labels for all objects
Definition at line 542 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of local axes for all objects
Definition at line 537 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide visualisation of objects
Definition at line 512 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
enable/disable SkyBox
Definition at line 507 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
Referenced by RenderWorld::contextMenu().
|
slot |
show/hide the time and step
Definition at line 547 of file renderworld.cpp.
References RenderWObjectContainer::mutex.
|
inline |
Returns true if viewer state has been restored from file.
Definition at line 318 of file renderworld.h.
|
slot |
if true view object in wireframe mode
Definition at line 502 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