Display of visual hints | |
bool | axisIsDrawn () const |
bool | gridIsDrawn () const |
bool | FPSIsDisplayed () const |
bool | textIsEnabled () const |
bool | zBufferIsDisplayed () const |
bool | cameraIsEdited () const |
void | setAxisIsDrawn (bool draw=true) |
void | setGridIsDrawn (bool draw=true) |
void | setFPSIsDisplayed (bool display=true) |
void | setTextIsEnabled (bool enable=true) |
void | setZBufferIsDisplayed (bool display=true) |
void | setCameraIsEdited (bool edit=true) |
void | toggleAxisIsDrawn () |
void | toggleGridIsDrawn () |
void | toggleFPSIsDisplayed () |
void | toggleTextIsEnabled () |
void | toggleZBufferIsDisplayed () |
void | toggleCameraIsEdited () |
Viewer's colors | |
QColor | backgroundColor () const |
QColor | foregroundColor () const |
void | setBackgroundColor (const QColor &color) |
void | setForegroundColor (const QColor &color) |
Scene dimensions | |
float | sceneRadius () const |
qglviewer::Vec | sceneCenter () const |
void | setSceneRadius (float radius) |
void | setSceneCenter (const qglviewer::Vec ¢er) |
void | setSceneBoundingBox (const qglviewer::Vec &min, const qglviewer::Vec &max) |
void | showEntireScene () |
Associated objects | |
qglviewer::Camera * | camera () const |
qglviewer::ManipulatedFrame * | manipulatedFrame () const |
void | setCamera (qglviewer::Camera *const camera) |
void | setManipulatedFrame (qglviewer::ManipulatedFrame *frame) |
Mouse grabbers | |
qglviewer::MouseGrabber * | mouseGrabber () const |
void | setMouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber, bool enabled=true) |
bool | mouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber) |
void | setMouseGrabber (qglviewer::MouseGrabber *mouseGrabber) |
State of the viewer | |
float | aspectRatio () const |
float | currentFPS () |
bool | isFullScreen () const |
bool | displaysInStereo () const |
virtual QSize | sizeHint () const |
void | setFullScreen (bool fullScreen=true) |
void | setStereoDisplay (bool stereo=true) |
void | toggleFullScreen () |
void | toggleStereoDisplay () |
void | toggleCameraMode () |
Display methods | |
virtual void | startScreenCoordinatesSystem (bool upward=false) const |
virtual void | stopScreenCoordinatesSystem () const |
void | drawText (int x, int y, const QString &text, const QFont &fnt=QFont()) |
void | displayMessage (const QString &message, int delay=2000) |
static void | drawArrow (float length=1.0f, float radius=-1.0f, int nbSubdivisions=12) |
static void | drawAxis (float length=1.0f) |
static void | drawGrid (float size=1.0f, int nbSubdivisions=10) |
virtual void | drawLight (GLenum light, float scale=1.0f) const |
Useful inherited methods | |
int | width () const |
int | height () const |
virtual void | updateGL () |
void | qglColor (const QColor &color) const |
void | qglClearColor (const QColor &color) const |
bool | isValid () const |
bool | isSharing () const |
virtual void | makeCurrent () |
bool | hasMouseTracking () const |
virtual void | resize (int width, int height) |
virtual void | setMouseTracking (bool enable) |
static QImage | convertToGLFormat (const QImage &image) |
bool | autoBufferSwap () const |
void | setAutoBufferSwap (bool on) |
Snapshots | |
const QString & | snapshotFilename () const |
const QString & | snapshotFormat () const |
int | snapshotCounter () const |
int | snapshotQuality () |
void | saveSnapshot (bool automatic=false, bool overwrite=false) |
void | saveSnapshot (const QString &filename, bool overwrite=false) |
void | setSnapshotFilename (const QString &name) |
void | setSnapshotFormat (const QString &format) |
void | setSnapshotCounter (int counter) |
void | setSnapshotQuality (int quality) |
void | openSnapshotFormatDialog () |
Buffer to texture | |
GLuint | bufferTextureId () const |
float | bufferTextureMaxU () const |
float | bufferTextureMaxV () const |
void | copyBufferToTexture (GLint internalFormat, GLenum format=GL_NONE) |
Animation | |
bool | animationIsStarted () const |
int | animationPeriod () const |
void | setAnimationPeriod (int period) |
virtual void | startAnimation () |
virtual void | stopAnimation () |
virtual void | animate () |
void | toggleAnimation () |
Help window | |
virtual QString | helpString () const |
virtual QString | mouseString () const |
virtual QString | keyboardString () const |
virtual void | help () |
virtual void | aboutQGLViewer () |
QTabWidget * | helpWidget () |
Object selection | |
int | selectedName () const |
int | selectBufferSize () const |
int | selectRegionWidth () const |
int | selectRegionHeight () const |
GLuint * | selectBuffer () |
virtual void | select (const QMouseEvent *event) |
virtual void | select (const QPoint &point) |
void | setSelectBufferSize (int size) |
void | setSelectRegionWidth (int width) |
void | setSelectRegionHeight (int height) |
void | setSelectedName (int id) |
virtual void | beginSelection (const QPoint &point) |
virtual void | drawWithNames () |
virtual void | endSelection (const QPoint &point) |
virtual void | postSelection (const QPoint &point) |
Keyboard customization | |
int | shortcut (KeyboardAction action) const |
Qt::Key | pathKey (int index) const |
Qt::ButtonState | addKeyFrameStateKey () const |
Qt::ButtonState | playPathStateKey () const |
void | setShortcut (KeyboardAction action, int key) |
void | setKeyDescription (int key, QString description) |
virtual void | setPathKey (int key, int index=0) |
virtual void | setPlayPathStateKey (int buttonState) |
virtual void | setAddKeyFrameStateKey (int buttonState) |
enum | KeyboardAction { DRAW_AXIS, DRAW_GRID, DISPLAY_FPS, DISPLAY_Z_BUFFER, 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 } |
Mouse customization | |
MouseAction | mouseAction (int buttonState) const |
int | mouseHandler (int buttonState) const |
Qt::ButtonState | mouseButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
ClickAction | clickAction (int buttonState, bool doubleClick, int buttonBefore) const |
void | getClickButtonState (ClickAction action, Qt::ButtonState &buttonState, bool &doubleClick, Qt::ButtonState &buttonBefore) const |
MouseAction | wheelAction (int buttonState) const |
int | wheelHandler (int buttonState) const |
int | wheelButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
void | setMouseBinding (int buttonState, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBinding (int buttonState, ClickAction action, bool doubleClick=false, int buttonBefore=Qt::NoButton) |
void | setWheelBinding (int buttonState, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBindingDescription (int buttonState, QString description, bool doubleClick=false) |
void | setHandlerStateKey (MouseHandler handler, int buttonState) |
enum | MouseHandler { CAMERA, FRAME } |
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 } |
enum | MouseAction { NO_MOUSE_ACTION, ROTATE, ZOOM, TRANSLATE, MOVE_FORWARD, LOOK_AROUND, MOVE_BACKWARD, SCREEN_ROTATE, ROLL, SCREEN_TRANSLATE, ZOOM_ON_REGION } |
State persistence | |
QString | stateFileName () const |
virtual QDomElement | domElement (const QString &name, QDomDocument &document) const |
virtual void | initFromDOMElement (const QDomElement &element) |
virtual void | saveStateToFile () |
virtual bool | restoreStateFromFile () |
void | setStateFileName (const QString &name) |
QGLViewer pool | |
static const QPtrList< QGLViewer > & | QGLViewerPool () |
static int | QGLViewerIndex (const QGLViewer *const viewer) |
Drawing methods | |
virtual void | resizeGL (int width, int height) |
virtual void | initializeGL () |
virtual void | init () |
virtual void | paintGL () |
virtual void | preDraw () |
virtual void | preDrawStereo (bool leftBuffer=true) |
virtual void | draw () |
virtual void | fastDraw () |
virtual void | postDraw () |
Mouse, keyboard and event handlers | |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseMoveEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
virtual void | mouseDoubleClickEvent (QMouseEvent *) |
virtual void | wheelEvent (QWheelEvent *) |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | timerEvent (QTimerEvent *) |
virtual void | closeEvent (QCloseEvent *) |
Signals | |
void | viewerInitialized () |
void | drawNeeded () |
void | drawFinished (bool dummy) |
void | animateNeeded () |
void | helpRequired () |
void | axisIsDrawnChanged (bool drawn) |
void | gridIsDrawnChanged (bool drawn) |
void | FPSIsDisplayedChanged (bool displayed) |
void | textIsEnabledChanged (bool enabled) |
void | cameraIsEditedChanged (bool edited) |
void | zBufferIsDisplayedChanged (bool displayed) |
void | stereoChanged (bool on) |
void | pointSelected (const QMouseEvent *e) |
void | mouseGrabberChanged (qglviewer::MouseGrabber *mouseGrabber) |
Public Member Functions | |
QGLViewer (QWidget *parent=NULL, const char *name=0, const QGLWidget *shareWidget=0, WFlags flags=0) | |
QGLViewer (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0, WFlags flags=0) | |
QGLViewer (QGLContext *context, QWidget *parent, const char *name=0, const QGLWidget *shareWidget=0, WFlags flags=0) | |
virtual | ~QGLViewer () |
It features many classical viewer functionalities, such as a camera trackball, manipulated objects, snapshot saving and much more. Its main goal is to enable the very fast development of new 3D applications.
New users should read the introduction page to get familiar with important notions such as sceneRadius(), sceneCenter() and the world coordinate system. Try the numerous simple examples to discover the possibilities and understand how it works.
To use a QGLViewer, derive you viewer class from the QGLViewer and overload its draw() virtual method. See the commented code of the simpleViewer example for details.
An other option is to connect your drawing methods to the signals emitted by the QGLViewer (clean callback mechanism). See the callback example for a complete implementation.
|
Defines the possible actions that can be binded to a mouse click using setMouseBinding(int,ClickAction,bool,int). See the mouse page for details. |
|
Defines the different actions that can be associated with a keyboard shortcut using setShortcut(). See the keyboard page for details. |
|
Defines the possible actions that can be binded to a mouse motion (a click, followed by a mouse displacement). These actions may be binded to the camera() or to the manipulatedFrame() (see QGLViewer::MouseHandler) using setMouseBinding(). |
|
Defines the different mouse handlers: camera() or manipulatedFrame(). Used by setMouseBinding(), setMouseBinding(int, ClickAction, bool, int) and setWheelBinding() to define which handler receives the mouse events. |
|
Implementation of the The display flags, scene parameters, associated objects... are all set to their default values. See documentation.
If the |
|
Implementation of the
Same as QGLViewer(), but a |
|
Implementation of the
Same as QGLViewer(), but a
|
|
Virtual destructor. Removes viewer from QGLViewerPool() and releases allocated memory. The camera() is deleted and should be copied before if it is shared. |
|
Opens an about dialog. Default implementation displays libQGLViewer version, copyright notice and web site. |
|
Returns the state key that must be pressed with a pathKey() to add the current camera position to a KeyFrame path.
It can be See also playPathStateKey(). |
|
Scene animation method. When animationIsStarted(), this method is in charge of the scene update before each draw(). Overload it to define how your scene evolves over time. The time should either be regularly incremented in this method (frame-rate independent animation) or computed from actual time (for instance using QTime::elapsed()) for real-time animations. Note that KeyFrameInterpolator (which regularly updates a Frame) do not use this method but rather rely on a QTimer signal-slot mechanism. See the animation example for an illustration. |
|
Signal emitted by the default animate() method. Connect this signal to your scene animation method or overload animate(). |
|
Return During animation, an infinite loop calls animate() and draw() and then waits for animationPeriod() milliseconds before calling animate() and draw() again. And again. Use startAnimation(), stopAnimation() or toggleAnimation() to change this value. See the animation example for illustration. |
|
The animation loop period, in milliseconds. When animationIsStarted(), this is delay waited after draw() to call animate() and draw() again. Default value is 40 milliseconds (25 Hz). This value will define the currentFPS() when animationIsStarted() (provided that your animate() and draw() methods are fast enough).
If you want to know the maximum possible frame rate of your machine on a given scene, setAnimationPeriod() to
|
|
Returns the aspect ratio of the viewer's widget (width() / height()). |
|
Returns |
|
Returns
Set by setAxisIsDrawn() or toggleAxisIsDrawn(). Default value is |
|
This signal is emitted whenever axisIsDrawn() changes value. |
|
Returns the background color of the viewer.
This method is provided for convenience since the background color is an OpenGL state variable set with Use setBackgroundColor() to define and activate a background color.
|
|
This method should prepare the selection. It is called by select() before drawWithNames().
The default implementation uses the
You should not need to redefine this method (if you use the |
|
Returns the texture id of the texture created by copyBufferToTexture(). Use glBindTexture() to use this texture. Note that this is already done by copyBufferToTexture().
Returns |
|
Returns the texture coordinate corresponding to the u extremum of the bufferTexture. The bufferTexture is created by copyBufferToTexture(). The texture size has powers of two dimensions and the buffer image hence only fills a part of it. This value corresponds to the u coordinate of the extremum right side of the buffer image. Use (0,0) to (bufferTextureMaxU(), bufferTextureMaxV()) texture coordinates to map the entire texture on a quad. |
|
Same as bufferTextureMaxU(), but for the v texture coordinate. |
|
Returns the associated qglviewer::Camera, never |
|
Returns
Set by setCameraIsEdited() or toggleCameraIsEdited(). Default value is The current implementation is limited: the defined camera() paths (see qglviewer::Camera::keyFrameInterpolator()) are simply displayed using qglviewer::Camera::drawAllPaths(). Actual camera and path edition will be implemented in the future. |
|
This signal is emitted whenever cameraIsEdited() changes value.. |
|
Same as mouseAction(), but for the ClickAction set using setMouseBinding(). |
|
Overloading of the Saves the viewer state using saveStateToFile() and then calls QGLWidget::closeEvent(). |
|
Converts |
|
|
|
Returns the current averaged viewer frame rate. This value is computed and averaged over 20 successive frames. It only changes every 20 draw() (previously computed value is otherwise returned). This method is useful for true real-time applications that may adapt their computational load accordingly in order to maintain a given frequency.
This value is meaningful only when draw() is regularly called, either using a |
|
Briefly displays a message in the lower left corner of the widget. Convenient to provide feedback to the user.
This method should not be called in draw(). If you want to display a text in each draw(), use drawText() instead. If this method is called when a message is already displayed, the new message replaces the old one. Use setTextIsEnabled() (default shortcut is '?') to enable or disable text (and hence messages) display. |
|
Returns The QGLViewer object must be created with a stereo format to handle stereovision: QGLFormat format; format.setStereoDisplay( TRUE ); QGLViewer viewer(format);
Set by setStereoDisplay() or toggleStereoDisplay(). Default value is The stereo parameters are defined by the camera(). See qglviewer::Camera::setIODistance(), qglviewer::Camera::setPhysicalDistanceToScreen(), qglviewer::Camera::setPhysicalScreenWidth() and qglviewer::Camera::setFocusDistance(). |
|
Returns an XML
Used by saveStateToFile(). restoreStateFromFile() uses initFromDOMElement() to restore the QGLViewer state from the resulting
The created QDomElement contains state values (axisIsDrawn(), FPSIsDisplayed(), isFullScreen()...), viewer geometry, as well as camera() (see qglviewer::Camera::domElement()) and manipulatedFrame() (if defined, see qglviewer::ManipulatedFrame::domElement()) states. Overload this method to add your own attributes to the state file: QDomElement Viewer::domElement(const QString& name, QDomDocument& document) const { QDomElement de = document.createElement("Light"); de.setAttribute("state", (lightIsOn()?"on":"off")); de.appendChild(lightManipulatedFrame()->domElement("LightFrame", document)); // Get default state domElement and append custom node QDomElement res = QGLViewer::domElement(name, document); res.appendChild(de); return res; }
|
|
The core method of the viewer, that draws the scene. If you build a class that inherits from QGLViewer, this is the method you want to overload. See the simpleViewer example for an illustration. The camera modelView matrix set in preDraw() converts from the world to the camera coordinate systems. Vertices given in draw() can then be considered as being given in the world coordinate system. The camera is moved in this world using the mouse. This representation is much more intuitive than the default camera-centric OpenGL standard.
|
|
Draws a 3D arrow along the positive Z axis.
Uses current color and does not modify the OpenGL state. Change the modelView to place the arrow in 3D (see qglviewer::Frame::matrix()). |
|
Draws an XYZ axis, with a given size (default is 1.0). The axis position and orientation depends on the current modelView matrix state. Use the following code to display the current position and orientation of a qglviewer::Frame: glPushMatrix(); glMultMatrixd(frame.matrix()); QGLViewer::drawAxis(sceneRadius() / 5.0); // Or any scale glPopMatrix();
The current color is used to draw the X, Y and Z characters at the extremities of the three arrows. The OpenGL state is modified: axisIsDrawn() uses this method to draw a representation of the world coordinate system. See also QGLViewer::drawArrow(). |
|
Signal emitted at the end of the QGLViewer::paintGL() method, when frame is drawn. Can be used to notify an image grabbing process that the image is ready. A typical example is to connect this signal to the saveSnapshot() method, so that a (numbered) snapshot is generated after each new display, in order to create a movie: connect(viewer, SIGNAL(drawFinished(bool)), SLOT(saveSnapshot(bool)));
The |
|
Draws a grid in the XY plane, centered on (0,0,0).
|
|
Draws a representation of Called in draw(), this method is useful to debug or display your light setup. Light drawing depends on the type of light (point, spot, directional).
The method retrieves the light setup using Light is drawn using its diffuse color. Disabled lights are not displayed.
Drawing size is proportional to sceneRadius(). Use See the drawLight example for an illustration.
|
|
Signal emitted by the default draw() method. Connect this signal to your main drawing method or overload draw(). See the callback example for an illustration. |
|
Draws
The default QApplication::font() is used to render the text when no
You should disable This method can be used in conjunction with the qglviewer::Camera::projectedCoordinatesOf() method to display a text attached to an object. In your draw() method use: qglviewer::Vec screenPos = camera()->projectedCoordinatesOf(myFrame.position()); drawText((int)screenPos[0], (int)screenPos[1], "My Object"); Text is displayed only when textIsEnabled() (default). This mechanism allows the user to conveniently remove all the displayed text with a single keyboard shortcut. Use displayMessage() to drawText() for only a short amount of time. Use the QGLWidget::renderText(x,y,z, text) method (Qt version >= 3.1) to draw a text (fixed size, facing the camera) located at a specific 3D position instead of 2D screen coordinates.
The
|
|
This method is called by select() and should draw selectable entities.
Default implementation is empty. Overload and draw the different elements of your scene you want to be able to select. The default select() implementation relies on the void Viewer::drawWithNames() { for (int i=0; i<nbObjects; ++i) { glPushName(i); object(i)->draw(); glPopName(); } } The resulting selected name is computed by endSelection(), which setSelectedName() to the integer id pushed by this method (a value of -1 means no selection). Use selectedName() to update your selection, probably in the postSelection() method. |
|
This method is called by select() after scene elements were drawn by drawWithNames(). It should analyze the selection result to determine which object is actually selected.
The default implementation relies on This default implementation, although sufficient for many cases is however limited and you may have to overload this method. This will be the case if drawWithNames() uses several push levels in the name heap. A more precise depth selection, for instance privileging points over edges and triangles to avoid z precision problems, will also require an overloading. A typical implementation will look like: glFlush(); // Get the number of objects that were seen through the pick matrix frustum. // Resets GL_RENDER mode. GLint nbHits = glRenderMode(GL_RENDER); if (nbHits <= 0) setSelectedName(-1); else { // Interpret results: each object created values in the selectBuffer(). // See the glSelectBuffer() man page for details on the buffer structure. // The following code depends on your selectBuffer() structure. for (int i=0; i<nbHits; ++i) if ((selectBuffer())[i*4+1] < zMin) setSelectedName((selectBuffer())[i*4+3]) } See the multiSelect example for a multi-object selection implementation of this method. |
|
Draws a simplified version of the scene to guarantee interactive camera displacements. This method is called instead of draw() when the qglviewer::Camera::frame() is qglviewer::ManipulatedCameraFrame::isManipulated(). Default implementation simply calls draw(). Overload this method if your scene is too complex to allow for interactive camera manipulation. See the fastDraw example for an illustration. |
|
Returns the foreground color used by the viewer. This color is used when FPSIsDisplayed(), gridIsDrawn(), to display the camera paths when the cameraIsEdited().
qglColor (foregroundColor()) to set the current OpenGL color to the foregroundColor().See also backgroundColor(). |
|
Returns Use QApplication::setFont() to define the display font (see drawText()).
Set by setFPSIsDisplayed() or toggleFPSIsDisplayed(). Use currentFPS() to get the current FPS. Default value is |
|
This signal is emitted whenever FPSIsDisplayed() changes value. |
|
Similar to mouseButtonState(), but for ClickAction.
The results of the query are returned in the |
|
Returns
Set by setGridIsDrawn() or toggleGridIsDrawn(). Default value is |
|
This signal is emitted whenever gridIsDrawn() changes value. |
|
Returns
You need to setMouseTracking() to |
|
Returns viewer's widget height (in pixels). See QGLWidget documentation. |
|
Opens a modal help window that includes three tabs, respectively filled with helpString(), keyboardString() and mouseString(). Rich html-like text can be used (see the QStyleSheet documentation). This method is called when the user presses the HELP (default is 'H'). Use helpWidget() to access to the help widget (to add/remove tabs, change layout...). The "About" button (helpWidget()->cornerWidget()) is connected to the aboutQGLViewer() slot. The helpRequired() signal is emitted. |
|
Signal emitted by the default QGLViewer::help() method. Connect this signal to your own help method or overload help(). |
|
Returns the QString displayed in the help() window main tab. Overload this method to define your own help string, which should shortly describe your application and explain how it works. Rich-text (HTML) tags can be used (see QStyleSheet() documentation for available tags): QString myViewer::helpString() const { QString text("<h2>M y V i e w e r</h2>"); text += "Displays a <b>Scene</b> using OpenGL. Move the camera using the mouse."; return text; } See also mouseString() and keyboardString(). |
|
Returns a pointer to the help widget. Use this only if you want to directly modify the help widget. Otherwise use helpString(), setKeyDescription() and setMouseBindingDescription() to customize the text displayed in the help window tabs. |
|
Initializes the viewer OpenGL context. This method is called before the first drawing and should be overloaded to initialize some of the OpenGL flags. The default implementation is empty. See initializeGL(). Typical usage include camera() initialization (showEntireScene()), previous viewer state restoration (restoreStateFromFile()), OpenGL state modification and display list creation. Note that initializeGL() modifies the standard OpenGL context. These values can be restored back in this method.
|
|
Restores the QGLViewer state from a Used by restoreStateFromFile() to restore the QGLViewer state from a file. Overload this method to retrieve custom attributes from the QGLViewer state file. This code corresponds to the one given in the domElement() documentation: void Viewer::initFromDOMElement(const QDomElement& element) { // Restore standard state QGLViewer::initFromDOMElement(element); QDomElement child=element.firstChild().toElement(); while (!child.isNull()) { if (child.tagName() == "Light") { if (child.hasAttribute("state")) setLightOn(child.attribute("state").lower() == "on"); // Assumes there is only one child. Otherwise you need to parse child's children recursively. QDomElement lf = child.firstChild().toElement(); if (!lf.isNull() && lf.tagName() == "LightFrame") lightManipulatedFrame()->initFromDomElement(lf); } child = child.nextSibling().toElement(); } } See also qglviewer::Camera::initFromDOMElement(), qglviewer::ManipulatedFrame::initFromDOMElement().
|
|
Initializes the QGLViewer OpenGL context and then calls user-defined init(). This method is automatically called once, before the first call to paintGL(). Overload init() instead of this method to modify viewer specific OpenGL state or to create display lists. To make beginners' life easier and to simplify the examples, this method slightly modifies the standard OpenGL state: glEnable(GL_LIGHT0); glEnable(GL_LIGHTING); glEnable(GL_DEPTH_TEST); glEnable(GL_COLOR_MATERIAL); If you port an existing application to QGLViewer and your display changes, you probably want to disable these flags in init() to get back to a standard OpenGL state. |
|
Returns
Default value is
Note that if the QGLViewer is embedded in an other QWidget, it returns |
|
Returns |
|
Returns |
|
Returns a QString that describes the application keyboard shortcut bindings, and that will be displayed in the help() window Default value is a table that describes the custom shortcuts defined using setKeyDescription() as well as the standard QGLViewer::KeyboardAction shortcuts (defined using setShortcut()). See the keyboard page for details on key customization. See also helpString() and mouseString(). |
|
Overloading of the Default keyboard shortcuts are defined using setShortcut(). Overload this method to implement a specific keyboard binding. Call the original method if you do not catch the event to preserve the viewer default key bindings: void Viewer::keyPressEvent(QKeyEvent *e) { // Retrieve state keys const Qt::ButtonState state = (Qt::ButtonState)(e->state() & Qt::KeyButtonMask); // Defines the Alt+R shortcut. Call updateGL to refresh display. if ((state == Qt::AltButton) && (e->key() == Qt::Key_R)) { myResetFunction(); updateGL(); } else QGLViewer::keyPressEvent(e); } See also QGLWidget::keyReleaseEvent(). |
|
Makes this widget's rendering context the current OpenGL rendering context. Useful with several viewers. See QGLWidget documentation. |
|
Returns the viewer's qglviewer::ManipulatedFrame.
This qglviewer::ManipulatedFrame can be moved with the mouse when the associated mouse bindings are used (default is when pressing the See the manipulatedFrame example for a complete implementation.
Default value is |
|
Returns the MouseAction associated with the Qt::ButtonState For instance, to know which motion corresponds to Alt-LeftButton, do: QGLViewer::MouseAction mm = mouseAction(Qt::AltButton | Qt::LeftButton); if (mm != NO_MOUSE_ACTION) ... Use mouseHandler() to know which object (CAMERA or FRAME) will perform this motion. |
|
Returns the Qt::ButtonState (if any) that has to be used to activate If no Qt::ButtonState is associated, returns Qt::NoButton which is an impossible case since at least one mouse button has to be specified in setMouseBinding(). To know which keys and mouse buttons have to be pressed to translate the camera, use tests like: Qt::ButtonState bs = mouseButtonState(CAMERA, TRANSLATE); if (bs & Qt::RightButton) ... // Right button needed to translate the camera if (bs & Qt::AltButton) ... // Alt key needed if (bs & Qt::KeyButtonMask == Qt::NoButton) ... // No state key needed Note that mouse bindings are displayed in the 'Mouse' help window tab (use the 'H' key). See also mouseAction() and mouseHandler(). |
|
Overloading of the The behavior of the mouse double click depends on the mouse binding. See setMouseBinding() and the mouse page. |
|
Returns the current qglviewer::MouseGrabber, or When qglviewer::MouseGrabber::grabsMouse(), the different mouse events are sent to the mouseGrabber() instead of their usual targets (camera() or manipulatedFrame()). See the qglviewer::MouseGrabber documentation for details on MouseGrabber's mode of operation. In order to use MouseGrabbers, you need to enable mouse tracking (so that mouseMoveEvent() is called even when no mouse button is pressed). Add this line in init() or in your viewer constructor: setMouseTracking(true); |
|
Signal emitted by setMouseGrabber() when the mouseGrabber() is changed.
|
|
Returns
Default value is You can also use qglviewer::MouseGrabber::removeFromMouseGrabberPool() to completely disable a MouseGrabber in all the QGLViewers. |
|
Returns the MouseHandler associated with the Qt::ButtonState For instance, to know which handler receives the Alt-LeftButton, do: int mh = mouseHandler(Qt::AltButton | Qt::LeftButton); if (mh == CAMERA) ... Use mouseAction() to know which action (see the MouseAction enum) will be perform on this handler. |
|
Overloading of the Mouse move event is sent to the mouseGrabber() (if any) or to the camera() or the manipulatedFrame(), depending on mouse bindings (see setMouseBinding()). If you want to define your own mouse behavior, do something like this: void Viewer::mousePressEvent(QMouseEvent* e) { // Qt::KeyButtonMask separates the Qt::ControlButton/Qt::AltButton/Qt::ShiftButton state key // from the Qt::LeftButton/Qt::MidButton/Qt::RightButton mouse buttons. if ((e->state() & Qt::KeyButtonMask) == myStateKeyCombo) myMouseBehavior = true; else QGLViewer::mousePressEvent(e); } void Viewer::mouseMoveEvent(QMouseEvent *e) { if (myMouseBehavior) // Use e->x() and e->y() as you want... else QGLViewer::mouseMoveEvent(e); } void Viewer::mouseReleaseEvent(QMouseEvent* e) { if (myMouseBehavior) myMouseBehavior = false; else QGLViewer::mouseReleaseEvent(e); } |
|
Overloading of the When the user clicks on the mouse:
See the mouseMoveEvent() documentation for an example of more complex mouse behavior customization using overloading.
|
|
Overloading of the
Calls the mouseGrabber(), camera() or manipulatedFrame See the mouseMoveEvent() documentation for an example of mouse behavior customization. |
|
Returns a QString that describes the application mouse bindings, displayed in the help() window Result is a table that describes custom application mouse binding descriptions defined using setMouseBindingDescription() as well as standard mouse bindings (defined using setMouseBinding() and setWheelBinding()). See the mouse page for details on mouse bindings. See also helpString() and keyboardString(). |
|
Opens a dialog that displays the different available snapshot formats. Then calls setSnapshotFormat() with the selected one (unless the user cancels). |
|
Main paint method, inherited from Calls the following methods, in that order:
|
|
Returns the keyboard key associated to camera Key Frame path Default values are F1..F12 for indexes 1..12. addKeyFrameStateKey() (resp. playPathStateKey()) define the state key(s) that must be pressed with this key to add a KeyFrame to (resp. to play) the associated Key Frame path. If you quickly press twice the pathKey(), the path is reset (resp. deleted).
Use camera()->keyFrameInterpolator(
If several keys are binded to a given See also the keyboard page. |
|
Returns the state key that must be pressed with a pathKey() to play a camera KeyFrame path.
It can be See also addKeyFrameStateKey(). |
|
Signal emitted by select(). Connect this signal to your selection method or overload select(), or more probably simply drawWithNames(). |
|
Called after draw() to draw viewer visual hints. Default implementation displays axis, grid, FPS... when the respective flags are sets. See the multiSelect and thumbnail examples for an overloading illustration. The GLContext (color, LIGHTING, BLEND...) should not be modified by this method, so that in draw(), the user can rely on the OpenGL context. Respect this convention (by pushing/popping the different attributes) if you overload this method. |
|
This method is called at the end of the select() procedure. It should finalize the selection process and update the data structure/interface/computation/display... according to the newly selected entity. The default implementation is empty. Overload this method if needed, and use selectedName() to retrieve the selected entity name (returns -1 if no object was selected). See the select example for an illustration. |
|
Sets OpenGL state before draw(). Default behavior clears screen and sets the projection and modelView matrices: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera()->loadProjectionMatrix(); camera()->loadModelViewMatrix(); Emits the drawNeeded() signal once this is done (see the callback example). |
|
Called before draw() (instead of preDraw()) when viewer displaysInStereo().
Same as preDraw() except that the glDrawBuffer() is set to |
|
Calls |
|
Calls |
|
Returns the index of the QGLViewer When a QGLViewer is deleted, the following QGLViewers' indexes are shifted down. Returns -1 if the QGLViewer could not be found (which should not be possible). |
|
Returns a Can be useful to apply a method or to connect a signal to all the viewers: QPtrListIterator<QGLViewer> it(QGLViewer::QGLViewerPool()); for (QGLViewer* viewer; (viewer = it.current()) != NULL; ++it) connect(myObject, SIGNAL(mySignal), viewer, SLOT(updateGL())); |
|
Resizes the widget to size |
|
Callback method used when the widget size is modified. If you overload this method, first call the inherited method. Also called when the widget is created, before its first display. |
|
Restores the QGLViewer state from the stateFileName() file using initFromDOMElement(). States are saved using saveStateToFile(), which is automatically called on viewer exit.
Returns A manipulatedFrame() should be defined before calling this method, so that its state can be restored. Initialization code put after this function will override saved values: void Viewer::init() { // Default initialization goes here (including the declaration of a possible manipulatedFrame). if (!restoreStateFromFile()) showEntireScene(); // Previous state cannot be restored: fit camera to scene. // Specific initialization that overrides file savings goes here. } |
|
Same as saveSnapshot(), except that it uses
If
Uses snapshotFormat() and snapshotQuality() for the snapshot. A correct file extension is added if not provided in
Asks for confirmation when the file already exists and |
|
Saves a snapshot of the current image displayed by the widget. Options are set using snapshotFormat(), snapshotFilename() and snapshotQuality(). For non vectorial image formats, the image size is equal to the current viewer's dimensions (see width() and height()). See snapshotFormat() for details on supported formats.
If
When void Viewer::init() { resize(720, 576); // PAL DV format (use 720x480 for NTSC DV) connect(this, SIGNAL(drawFinished(bool)), SLOT(saveSnapshot(bool))); } If you want to create a Quicktime VR panoramic sequence, simply use code like this: void Viewer::createQuicktime() { const int nbImages = 36; for (int i=0; i<nbImages; ++i) { camera()->setOrientation(2.0*M_PI/nbImages, 0.0); // Theta-Phi orientation showEntireScene(); updateGL(); // calls draw(), which emits drawFinished(), which calls saveSnapshot() } }
When Remove that anti-aliassing option to correctly display generated PS and EPS results. The VRender library was written by Cyril Soler (Cyril dot Soler at imag dot fr).
|
|
Saves in stateFileName() an XML representation of the QGLViewer state, obtained from domElement(). Use restoreStateFromFile() to restore this viewer state.
This method is automatically called when a viewer is closed (using Escape or using the window's upper right |
|
Returns the scene center, defined in world coordinates. See sceneRadius() for details. Default value is (0,0,0). Simply a wrapper for camera()->sceneCenter(). Set using setSceneCenter(). Do not mismatch this value (that only depends on the scene) with the qglviewer::Camera::revolveAroundPoint(). |
|
Returns the scene radius. The entire displayed scene should be included in a sphere of radius sceneRadius(), centered on sceneCenter(). This approximate value is used by the camera() to set qglviewer::Camera::zNear() and qglviewer::Camera::zFar(). It is also used to showEntireScene() or to scale the world axis display.. Default value is 1.0. This method is equivalent to camera()->sceneRadius(). See setSceneRadius(). |
|
This method performs a selection in the scene from pixel coordinates. It is called when the user clicks on the SELECT QGLViewer::ClickAction binded button(s) (default is Shift + LeftButton). This method successively calls four other methods: beginSelection(point); drawWithNames(); endSelection(point); postSelection(point); The default implementation of these methods is as follows (see the methods' documentation for more details):
glSelectBuffer() man page for details on this GL_SELECT mechanism.This default implementation is quite limited: only the closer object is selected, and only one level of names can be pushed. However, this reveals sufficient in many cases and you usually only have to overload drawWithNames() to implement a simple object selection process. See the select example for an illustration. If you need a more complex selection process (such as a point, edge or triangle selection, which is easier with a 2 or 3 levels selectBuffer() heap, and which requires a finer depth sorting to privilege point over edge and edges over triangles), overload the endSelection() method. Use setSelectRegionWidth(), setSelectRegionHeight() and setSelectBufferSize() to tune the select buffer configuration. See the multiSelect example for an illustration.
|
|
Simple wrapper method: calls
Emits
This method is called when you use the SELECT mouse binding(s) (default is Shift + left button). Overload to make the selection mechanism depend on the |
|
Returns a pointer to an array of
This buffer is used by the |
|
Returns the selectBuffer() size. See the select() documentation for details. Use setSelectBufferSize() to change this value. Default value is 4000 (i.e. 1000 objects in selection region, since each object pushes 4 values). This size should be over estimated to prevent a buffer overflow when many objects are drawn under the mouse cursor. |
|
Returns the name (an integer value) of the entity that was last selected by select(). This value is set by endSelection(). See the select() documentation for details. As a convention, this method returns -1 if the selectBuffer() was empty, meaning that no object was selected. Return value is -1 before the first call to select(). This value is modified using setSelectedName(). |
|
See the selectRegionWidth() documentation. Default value is 3 pixels. |
|
Returns the width (in pixels) of a selection frustum, centered on the mouse cursor, that is used to select objects. The height of the selection frustum is defined by selectRegionHeight(). The objects that will be drawn in this region by drawWithNames() will be recorded in the selectBuffer(). endSelection() then analyzes this buffer and setSelectedName() to the name of the closest object. See the gluPickMatrix() documentation for details. The default value is 3, which is adapted to standard applications. A smaller value results in a more precise selection but the user has to be careful for small feature selection. See the multiSelect example for an illustration. |
|
Sets the addKeyFrameStateKey(). |
|
Sets the animationPeriod(), in milliseconds. |
|
Sets the autoBufferSwap() value. |
|
Sets the state of axisIsDrawn(). Emits the axisIsDrawnChanged() signal. See also toggleAxisIsDrawn(). |
|
Sets the backgroundColor() of the viewer and calls |
|
Associates a new qglviewer::Camera to the viewer. You should only use this method when you derive a new class from qglviewer::Camera and want to use one of its instances instead of the original class. It you simply want to save and restore Camera positions, use qglviewer::Camera::addKeyFrameToPath() and qglviewer::Camera::playPath() instead.
This method silently ignores NULL
The sceneRadius() and sceneCenter() of
All the |
|
Starts ( Current implementation is limited to paths display. Get current state using cameraIsEdited().
|
|
Sets the foregroundColor() of the viewer, used to draw visual hints. See also setBackgroundColor(). |
|
Sets the state of FPSIsDisplayed(). Emits the FPSIsDisplayedChanged() signal. See also toggleFPSIsDisplayed(). |
|
Sets the isFullScreen() state. If the QGLViewer is embedded in an other QWidget (see QWidget::topLevelWidget()), this widget is displayed in full screen instead. |
|
Sets the state of gridIsDrawn(). Emits the gridIsDrawnChanged() signal. See also toggleGridIsDrawn(). |
|
Associates a given state key to a specific MouseHandler.
The
All the With this code, setHandlerStateKey(CAMERA, Qt::AltButton); setHandlerStateKey(FRAME, Qt::NoButton); Alt key while pressing mouse buttons in order to move the camera(), while no key will be needed to move the associated manipulatedFrame().
This method has a very basic implementation: every action binded to
The default binding associates
|
|
Defines a custom keyboard shortcut description, that will be displayed in the help() window
The setKeyDescription(Key_W, "Toggles wireframe display"); setKeyDescription(CTRL+Key_L, "Loads a new scene"); // Removes a description setKeyDescription(CTRL+Key_C, ""); See the keyboardAndMouse example for illustration and the keyboard page for details. |
|
Sets the viewer's manipulatedFrame(). Note that a qglviewer::ManipulatedCameraFrame can be set as the manipulatedFrame(): it is possible to manipulate the camera of a first viewer in a second viewer. Defining the own viewer's camera()->frame() as the manipulatedFrame() is possible and will result in a classical camera manipulation. See the luxo example for an illustration. |
|
Associates a ClickAction to any Qt::ButtonState mouse button and state key combination.
The parameters should read: when the
If The list of all possible ClickAction, some binding examples and default bindings are provided in the mouse page. See also the setMouseBinding() documentation. See the keyboardAndMouse example for an illustration.
The binding is ignored if no mouse button is specified in |
|
Associates a MouseAction to any Qt::ButtonState mouse button and state key combination. The receiver of the mouse events is a MouseHandler (CAMERA or FRAME).
The parameters should read: when the Use the '|' bitwise operator to combine keys and buttons: // Left and right buttons together make a camera zoom: emulates a mouse third button if needed. setMouseBinding(Qt::LeftButton | Qt::RightButton, CAMERA, ZOOM); // Alt + Shift + Left button rotates the manipulatedFrame(). setMouseBinding(Qt::AltButton | Qt::ShiftButton | Qt::LeftButton, FRAME, ROTATE); The list of all possible MouseAction, some binding examples and default bindings are provided in the mouse page. See the keyboardAndMouse example for an illustration.
If no mouse button is specified in To remove a specific mouse binding, use code like: setMouseBinding(myButtonStateKeyCombo, myHandler, NO_MOUSE_ACTION); See also setMouseBinding(int, ClickAction, bool, int) and setWheelBinding(). |
|
Provides a custom mouse binding description, displayed in the help() window Mouse tab.
// Left and Right button together simulate a middle button setMouseBindingDescription(Qt::LeftButton | Qt::RightButton, "Emulates a middle button"); // A left button double click toggles full screen setMouseBindingDescription(Qt::LeftButton, "Toggles full screen mode", true); // Remove the description of Ctrl+Right button setMouseBindingDescription(Qt::ControlButton | Qt::RightButton, ""); Overload mouseMoveEvent() and friends to implement your custom mouse behavior (see the mouseMoveEvent() documentation for an example). See the keyboardAndMouse example for an illustration. Use setMouseBinding() and setWheelBinding() to change the standard mouse action bindings. |
|
Directly defines the mouseGrabber(). You should not call this method directly as it bypasses the qglviewer::MouseGrabber::checkIfGrabsMouse() test performed by mouseMoveEvent(). If the MouseGrabber is disabled (see mouseGrabberIsEnabled()), this method silently does nothing. |
|
Sets the mouseGrabberIsEnabled() state. |
|
Sets the hasMouseTracking() value. |
|
Sets the pathKey() associated with the camera Key Frame path
Several keys can be binded to the same // Press 'space' to play/pause/add/delete camera path 0. setPathKey(Qt::Key_Space, 0); // Remove this binding setPathKey(-Qt::Key_Space); |
|
Sets the playPathStateKey(). |
|
Convenient way to call setSceneCenter() and setSceneRadius() from a (world axis aligned) bounding box of the scene. This is equivalent to: setSceneCenter((m+M)/2.0); setSceneRadius(0.5*(M-m).norm()); |
|
Sets the sceneCenter(), defined in world coordinates.
|
|
Sets the sceneRadius(). The camera() qglviewer::Camera::flySpeed() is set to 1% of this value by this method. Simple wrapper around camera()->setSceneRadius(). |
|
Sets the selectBufferSize(). The previous selectBuffer() is deleted and a new one is created. |
|
Set the selectedName() value. Used in endSelection() during a selection. You should only call this method if you overload the endSelection() method. |
|
Sets the selectRegionHeight(). |
|
Sets the selectRegionWidth(). |
|
Defines the shortcut() that triggers a given QGLViewer::KeyboardAction. Here are some examples: // Press 'Q' to exit application setShortcut(EXIT_VIEWER, Key_Q); // Alt+M toggles camera mode setShortcut(CAMERA_MODE, ALT+Key_M); // The DISPLAY_FPS action is disabled setShortcut(DISPLAY_FPS, 0); Only one shortcut can be assigned to a given QGLViewer::KeyboardAction (new bindings replace previous ones). If several KeyboardAction are binded to the same shortcut, only one of them is active. |
|
Sets the snapshotCounter(). |
|
Sets snapshotFilename(). |
|
Sets the snapshotFormat(). |
|
Sets the snapshotQuality(). |
|
Defines the stateFileName() used by saveStateToFile() and restoreStateFromFile(). The file name can have an optional prefix directory (no prefix meaning current directory). If the directory does not exist, it will be created by saveStateToFile().
// Name depends on the displayed 3D model. Saved in current directory. setStateFileName(displayedModelName() + ".xml"); // Files are stored in a dedicated directory under user's home directory. setStateFileName(QDir::homeDirPath + "/.config/myApp.xml"); |
|
Toggles the state of isFullScreen(). See also setFullScreen(). |
|
Sets the state of textIsEnabled(). Emits the textIsEnabledChanged() signal. See also toggleTextIsEnabled(). |
|
Associates a MouseAction and a MouseHandler to a mouse wheel event. This method is very similar to setMouseBinding(), but specific to the wheel. In the current implementation only ZOOM can be associated with FRAME, while CAMERA can receive ZOOM and MOVE_FORWARD. The difference between ZOOM and MOVE_FORWARD is that ZOOM speed depends on the distance to the object, while MOVE_FORWARD moves at a constant speed defined by qglviewer::Camera::flySpeed(). |
|
Sets the state of zBufferIsDisplayed(). Emits the zBufferIsDisplayedChanged() signal. See also toggleZBufferIsDisplayed(). |
|
Returns the keyboard shortcut associated to a given QGLViewer::KeyboardAction.
Result is an If you want to define keyboard shortcuts for custom actions (say, open a scene file), overload keyPressEvent() and then setKeyDescription().
These shortcuts and their descriptions are automatically included in the help() window See the keyboard page for details and default values and the keyboardAndMouse example for a practical illustration. |
|
Moves the camera so that the entire scene is visible. Simple wrapper around qglviewer::Camera::showEntireScene(). |
|
Returns the recommended size for the QGLViewer. Default value is 600x400 pixels. |
|
Returns the value of the counter used to name snapshots in saveSnapshot() when
Set using setSnapshotCounter(). Default value is 0, and it is incremented after each |
|
Returns the snapshot filename used by saveSnapshot().
This value is used in You can also directly provide a file name using saveSnapshot(const QString&, bool). If the filename is relative, the current working directory at the moment of the method call is used. Set using setSnapshotFilename(). |
|
Returns the snapshot file format used by saveSnapshot().
This value is used when saveSnapshot() is passed the
The available formats are those handled by Qt. Classical values are QStringList formatList = QImage::outputFormatList();
for (QStringList::Iterator it = formatList.begin(); it != formatList.end(); ++it)
qWarning(*it);
If the library was compiled with the vectorial rendering option (default), three additional vectorial formats are available:
Note that the VRender library has some limitations: vertex shader effects are not reproduced and Default value is the first supported among "JPEG, PNG, EPS, PS, PPM, BMP", in that order. This value is set using setSnapshotFormat() or with openSnapshotFormatDialog().
|
|
Defines the image quality of the snapshots produced with saveSnapshot(). Values must be in the range -1..100. Use 0 for lowest quality and 100 for highest quality (and larger files). -1 means use Qt default quality. Default value is 95. Set using setSnapshotQuality(). See also the QImage::save() documentation.
|
|
Starts the animation loop. See animationIsStarted(). |
|
Modify the projection matrix so that drawing can be done directly with 2D screen coordinates.
Once called, the You need to call stopScreenCoordinatesSystem() at the end of the drawing block to restore the previous camera matrix.
In practice, this method should be used in draw(). It sets an appropriate orthographic projection matrix and then sets See the screenCoordSystem, multiSelect and backgroundImage examples for an illustration.
You may want to disable If you want to link 2D drawings to 3D objects, use qglviewer::Camera::projectedCoordinatesOf() to compute the 2D projection on screen of a 3D point (see the screenCoordSystem example). See also drawText().
In this mode, you should use z values that are in the [0.0, 1.0[ range (0.0 corresponding to the near clipping plane and 1.0 being just beyond the far clipping plane). This interval matches the values that can be read from the z-buffer. Note that if you use the convenient |
|
Returns the state file name. Default value is This is the name of the XML file where saveStateToFile() saves the viewer state (camera state, widget geometry, display flags... see domElement()) on exit. Use restoreStateFromFile() to restore this state later (usually in your init() method).
Setting this value to If more than one viewer are created by the application, this function will return a numbered file name (as in ".qglviewer1.xml", ".qglviewer2.xml"... using QGLViewer::QGLViewerIndex()) for extra viewers. Each viewer will then read back its own information in restoreStateFromFile(), provided that the viewers are created in the same order, which is usually the case. |
|
This signal is emitted whenever displaysInStereo() changes value. |
|
Stops animation. See animationIsStarted(). |
|
Stops the pixel coordinate drawing block started by startScreenCoordinatesSystem().
The |
|
Returns
Set by setTextIsEnabled() or toggleTextIsEnabled(). This feature conveniently removes all the possibly displayed text, cleaning display. Default value is |
|
This signal is emitted whenever textIsEnabled() changes value. |
|
Overloading of the If animationIsStarted(), calls animate() and draw(). |
|
Calls startAnimation() or stopAnimation(), depending on animationIsStarted(). |
|
Toggles the state of axisIsDrawn(). See also setAxisIsDrawn(). |
|
Toggles the state of cameraIsEdited(). See also setCameraIsEdited(). |
|
Swaps between two predefined camera mouse bindings. The first mode makes the camera observe the scene while revolving around the qglviewer::Camera::revolveAroundPoint(). The second mode is designed for walkthrough applications and simulates a flying camera. Practically, the three mouse buttons are respectively binded to:
|
|
Toggles the state of FPSIsDisplayed(). See also setFPSIsDisplayed(). |
|
Toggles the state of displaysInStereo(). See setStereoDisplay(). |
|
Toggles the state of gridIsDrawn(). See also setGridIsDrawn(). |
|
|
|
Toggles the state of textIsEnabled(). See also setTextIsEnabled(). |
|
Toggles the state of zBufferIsDisplayed(). See also setZBufferIsDisplayed(). |
|
Updates the display. Do not call draw() directly, use this method instead. See QGLWidget documentation. |
|
Signal emitted by the default init() method. Connect this signal to the methods that need to be called to initialize your viewer or overload init(). |
|
Same as mouseAction(), but for the wheel action. |
|
Same as mouseButtonState(), but for the wheel.
|
|
Overloading of the If defined, the wheel event is sent to the mouseGrabber(). It is otherwise sent according to wheel bindings (see setWheelBinding()). |
|
Same as mouseHandler but for the wheel action. |
|
Returns viewer's widget width (in pixels). See QGLWidget documentation. |
|
|
|
This signal is emitted whenever zBufferIsDisplayed() changes value.. |