#include <ViewerWidget.h>
Public Slots | |
void | addCurrentToCameraPath (int id, int frame) |
void | appendCurrentToCameraPath (int id) |
void | appendToCameraPath (int id, const octomath::Pose6D &pose) |
void | deleteCameraPath (int id) |
void | enableHeightColorMode (bool enabled=true) |
void | enablePrintoutMode (bool enabled=true) |
void | enableSelectionBox (bool enabled=true) |
void | enableSemanticColoring (bool enabled=true) |
void | jumpToCamFrame (int id, int frame) |
void | playCameraPath (int id, int start_frame) |
void | removeFromCameraPath (int id, int frame) |
void | resetView () |
const SelectionBox & | selectionBox () const |
void | setCamPose (const octomath::Pose6D &pose) |
void | setCamPosition (double x, double y, double z, double lookX, double lookY, double lookZ) |
virtual void | setSceneBoundingBox (const qglviewer::Vec &min, const qglviewer::Vec &max) |
void | stopCameraPath (int id) |
void | updateCameraPath (int id, int frame) |
![]() | |
void | setAxisIsDrawn (bool draw=true) |
void | setGridIsDrawn (bool draw=true) |
void | setFPSIsDisplayed (bool display=true) |
void | setTextIsEnabled (bool enable=true) |
void | setCameraIsEdited (bool edit=true) |
void | toggleAxisIsDrawn () |
void | toggleGridIsDrawn () |
void | toggleFPSIsDisplayed () |
void | toggleTextIsEnabled () |
void | toggleCameraIsEdited () |
void | setBackgroundColor (const QColor &color) |
void | setForegroundColor (const QColor &color) |
virtual void | setSceneRadius (qreal radius) |
virtual void | setSceneCenter (const qglviewer::Vec ¢er) |
void | setSceneBoundingBox (const qglviewer::Vec &min, const qglviewer::Vec &max) |
void | showEntireScene () |
void | setCamera (qglviewer::Camera *const camera) |
void | setManipulatedFrame (qglviewer::ManipulatedFrame *frame) |
void | setMouseGrabber (qglviewer::MouseGrabber *mouseGrabber) |
void | setFullScreen (bool fullScreen=true) |
void | setStereoDisplay (bool stereo=true) |
void | toggleFullScreen () |
void | toggleStereoDisplay () |
void | toggleCameraMode () |
void | saveSnapshot (bool automatic=true, 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) |
bool | openSnapshotFormatDialog () |
void | snapshotToClipboard () |
void | copyBufferToTexture (GLint internalFormat, GLenum format=GL_NONE) |
void | setAnimationPeriod (int period) |
virtual void | startAnimation () |
virtual void | stopAnimation () |
virtual void | animate () |
void | toggleAnimation () |
virtual void | help () |
virtual void | aboutQGLViewer () |
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) |
void | setShortcut (KeyboardAction action, unsigned int key) |
void | setKeyboardAccelerator (KeyboardAction action, unsigned int key) |
void | setKeyDescription (unsigned int key, QString description) |
void | clearShortcuts () |
virtual void | setKeyFrameKey (unsigned int index, int key) |
virtual void | setPlayKeyFramePathStateKey (unsigned int buttonState) |
virtual void | setPlayPathStateKey (unsigned int buttonState) |
virtual void | setAddKeyFrameStateKey (unsigned int buttonState) |
virtual void | setPathKey (int key, unsigned int index=0) |
virtual void | setPlayPathKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
virtual void | setAddKeyFrameKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
void | setMouseBinding (unsigned int state, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBinding (unsigned int state, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | setMouseBindingDescription (unsigned int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | setMouseBinding (Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBinding (Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | setWheelBinding (Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBindingDescription (Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | setMouseBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | setWheelBinding (Qt::Key key, Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true) |
void | setMouseBindingDescription (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
void | clearMouseBindings () |
MouseAction | wheelAction (Qt::KeyboardModifiers modifiers) const |
int | wheelHandler (Qt::KeyboardModifiers modifiers) const |
void | setHandlerKeyboardModifiers (MouseHandler handler, Qt::KeyboardModifiers modifiers) |
void | setHandlerStateKey (MouseHandler handler, unsigned int buttonState) |
void | setMouseStateKey (MouseHandler handler, unsigned int buttonState) |
virtual void | initFromDOMElement (const QDomElement &element) |
virtual void | saveStateToFile () |
virtual bool | restoreStateFromFile () |
void | setStateFileName (const QString &name) |
void | saveToFile (const QString &fileName=QString()) |
bool | restoreFromFile (const QString &fileName=QString()) |
virtual void | resetVisualHints () |
Signals | |
void | cameraPathFrameChanged (int id, int current_camera_frame) |
void | cameraPathStopped (int id) |
void | select (const QMouseEvent *e) |
![]() | |
void | viewerInitialized () |
void | drawNeeded () |
void | drawFinished (bool automatic) |
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 | stereoChanged (bool on) |
void | pointSelected (const QMouseEvent *e) |
void | mouseGrabberChanged (qglviewer::MouseGrabber *mouseGrabber) |
Public Member Functions | |
void | addSceneObject (SceneObject *obj) |
void | clearAll () |
void | removeSceneObject (SceneObject *obj) |
ViewerWidget (QWidget *parent=NULL) | |
![]() | |
QGLViewer (const QGLFormat &format, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=Qt::WindowFlags()) | |
QGLViewer (QGLContext *context, QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=Qt::WindowFlags()) | |
QGLViewer (QWidget *parent=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=Qt::WindowFlags()) | |
virtual | ~QGLViewer () |
bool | axisIsDrawn () const |
bool | gridIsDrawn () const |
bool | FPSIsDisplayed () const |
bool | textIsEnabled () const |
bool | cameraIsEdited () const |
QColor | backgroundColor () const |
QColor | foregroundColor () const |
qreal | sceneRadius () const |
qglviewer::Vec | sceneCenter () const |
qglviewer::Camera * | camera () const |
qglviewer::ManipulatedFrame * | manipulatedFrame () const |
qglviewer::MouseGrabber * | mouseGrabber () const |
void | setMouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber, bool enabled=true) |
bool | mouseGrabberIsEnabled (const qglviewer::MouseGrabber *const mouseGrabber) |
qreal | aspectRatio () const |
qreal | currentFPS () |
bool | isFullScreen () const |
bool | displaysInStereo () const |
virtual QSize | sizeHint () const |
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) |
const QString & | snapshotFileName () const |
const QString & | snapshotFilename () const |
const QString & | snapshotFormat () const |
int | snapshotCounter () const |
int | snapshotQuality () |
QFont | scaledFont (const QFont &font) const |
GLuint | bufferTextureId () const |
qreal | bufferTextureMaxU () const |
qreal | bufferTextureMaxV () const |
bool | animationIsStarted () const |
int | animationPeriod () const |
virtual QString | mouseString () const |
virtual QString | keyboardString () const |
virtual QString | mouseBindingsString () const |
virtual QString | shortcutBindingsString () const |
int | selectedName () const |
int | selectBufferSize () const |
int | selectRegionWidth () const |
int | selectRegionHeight () const |
GLuint * | selectBuffer () |
unsigned int | shortcut (KeyboardAction action) const |
unsigned int | keyboardAccelerator (KeyboardAction action) const |
Qt::Key | keyFrameKey (unsigned int index) const |
Qt::KeyboardModifiers | playKeyFramePathStateKey () const |
Qt::KeyboardModifiers | addKeyFrameStateKey () const |
Qt::KeyboardModifiers | playPathStateKey () const |
Qt::Key | pathKey (unsigned int index) const |
Qt::KeyboardModifiers | addKeyFrameKeyboardModifiers () const |
Qt::KeyboardModifiers | playPathKeyboardModifiers () const |
MouseAction | mouseAction (unsigned int state) const |
int | mouseHandler (unsigned int state) const |
int | mouseButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
ClickAction | clickAction (unsigned int state, bool doubleClick, Qt::MouseButtons buttonsBefore) const |
void | getClickButtonState (ClickAction action, unsigned int &state, bool &doubleClick, Qt::MouseButtons &buttonsBefore) const |
unsigned int | wheelButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
MouseAction | mouseAction (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) const |
int | mouseHandler (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) const |
void | getMouseActionBinding (MouseHandler handler, MouseAction action, bool withConstraint, Qt::Key &key, Qt::KeyboardModifiers &modifiers, Qt::MouseButton &button) const |
ClickAction | clickAction (Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) const |
void | getClickActionBinding (ClickAction action, Qt::Key &key, Qt::KeyboardModifiers &modifiers, Qt::MouseButton &button, bool &doubleClick, Qt::MouseButtons &buttonsBefore) const |
MouseAction | wheelAction (Qt::Key key, Qt::KeyboardModifiers modifiers) const |
int | wheelHandler (Qt::Key key, Qt::KeyboardModifiers modifiers) const |
void | getWheelActionBinding (MouseHandler handler, MouseAction action, bool withConstraint, Qt::Key &key, Qt::KeyboardModifiers &modifiers) const |
QString | stateFileName () const |
virtual QDomElement | domElement (const QString &name, QDomDocument &document) const |
virtual void | setVisualHintsMask (int mask, int delay=2000) |
virtual void | drawVisualHints () |
Protected Member Functions | |
virtual void | draw () |
virtual void | drawWithNames () |
virtual QString | helpString () const |
virtual void | init () |
qglviewer::Quaternion | poseToQGLQuaternion (const octomath::Pose6D &pose) |
virtual void | postDraw () |
virtual void | postSelection (const QPoint &) |
![]() | |
virtual void | drawLight (GLenum light, qreal scale=1.0) const |
QTabWidget * | helpWidget () |
virtual void | resizeGL (int width, int height) |
virtual void | initializeGL () |
virtual void | paintGL () |
virtual void | preDraw () |
virtual void | preDrawStereo (bool leftBuffer=true) |
virtual void | fastDraw () |
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 | keyReleaseEvent (QKeyEvent *) |
virtual void | timerEvent (QTimerEvent *) |
virtual void | closeEvent (QCloseEvent *) |
virtual void | beginSelection (const QPoint &point) |
virtual void | endSelection (const QPoint &point) |
Protected Attributes | |
int | m_current_camera_frame |
int | m_current_camera_path |
bool | m_drawAxis |
bool | m_drawGrid |
bool | m_drawSelectionBox |
bool | m_heightColorMode |
bool | m_printoutMode |
std::vector< SceneObject * > | m_sceneObjects |
SelectionBox | m_selectionBox |
bool | m_semantic_coloring |
double | m_zMax |
double | m_zMin |
Private Slots | |
void | cameraPathFinished () |
void | cameraPathInterpolated () |
Definition at line 35 of file ViewerWidget.h.
octomap::ViewerWidget::ViewerWidget | ( | QWidget * | parent = NULL | ) |
Definition at line 36 of file ViewerWidget.cpp.
|
slot |
Definition at line 221 of file ViewerWidget.cpp.
void octomap::ViewerWidget::addSceneObject | ( | SceneObject * | obj | ) |
Adds an object to the scene that can be drawn
obj | SceneObject to be added |
Definition at line 291 of file ViewerWidget.cpp.
|
slot |
Definition at line 215 of file ViewerWidget.cpp.
|
slot |
Definition at line 175 of file ViewerWidget.cpp.
|
privateslot |
Definition at line 261 of file ViewerWidget.cpp.
|
signal |
|
privateslot |
Definition at line 270 of file ViewerWidget.cpp.
|
signal |
void octomap::ViewerWidget::clearAll | ( | ) |
Definition at line 309 of file ViewerWidget.cpp.
|
slot |
Definition at line 166 of file ViewerWidget.cpp.
|
protectedvirtual |
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.
GL_PROJECTION
matrix should not be modified by this method, to correctly display visual hints (axis, grid, FPS...) in postDraw(). Use push/pop or call camera()->loadProjectionMatrix() at the end of draw() if you need to change the projection matrix (unlikely). On the other hand, the GL_MODELVIEW
matrix can be modified and left in a arbitrary state. Reimplemented from QGLViewer.
Definition at line 316 of file ViewerWidget.cpp.
|
protectedvirtual |
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 GL_SELECT
, and requires that each selectable element is drawn within a glPushName()
- glPopName()
block. A typical usage would be (see the select example):
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. \attention If your selected objects are points, do not use \c glBegin(GL_POINTS); and \c glVertex3fv() in the above \c draw() method (not compatible with raster mode): use \c glRasterPos3fv() instead.
Reimplemented from QGLViewer.
Definition at line 348 of file ViewerWidget.cpp.
|
slot |
Definition at line 95 of file ViewerWidget.cpp.
|
slot |
Definition at line 103 of file ViewerWidget.cpp.
|
slot |
Definition at line 119 of file ViewerWidget.cpp.
|
slot |
Definition at line 111 of file ViewerWidget.cpp.
|
protectedvirtual |
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):
See also mouseString() and keyboardString().
Reimplemented from QGLViewer.
Definition at line 79 of file ViewerWidget.cpp.
|
protectedvirtual |
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.
Reimplemented from QGLViewer.
Definition at line 45 of file ViewerWidget.cpp.
|
slot |
Definition at line 155 of file ViewerWidget.cpp.
|
slot |
Definition at line 238 of file ViewerWidget.cpp.
|
protected |
Definition at line 125 of file ViewerWidget.cpp.
|
protectedvirtual |
Overloaded from QGLViewer. Draws own axis and grid in scale, then calls QGLViewer::postDraw().
Reimplemented from QGLViewer.
Definition at line 354 of file ViewerWidget.cpp.
|
protectedvirtual |
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.
Reimplemented from QGLViewer.
Definition at line 390 of file ViewerWidget.cpp.
|
slot |
Definition at line 185 of file ViewerWidget.cpp.
void octomap::ViewerWidget::removeSceneObject | ( | SceneObject * | obj | ) |
Removes a SceneObject from the list of drawable objects if it has been added previously. Does nothing otherwise.
obj | SceneObject to be removed |
Definition at line 297 of file ViewerWidget.cpp.
|
slot |
Resets the 3D viewpoint to the initial value
Definition at line 72 of file ViewerWidget.cpp.
|
signal |
|
inlineslot |
Definition at line 75 of file ViewerWidget.h.
|
slot |
Definition at line 150 of file ViewerWidget.cpp.
|
slot |
Definition at line 142 of file ViewerWidget.cpp.
|
virtualslot |
Definition at line 285 of file ViewerWidget.cpp.
|
slot |
Definition at line 252 of file ViewerWidget.cpp.
|
slot |
Definition at line 199 of file ViewerWidget.cpp.
|
protected |
Definition at line 120 of file ViewerWidget.h.
|
protected |
Definition at line 119 of file ViewerWidget.h.
|
protected |
Definition at line 112 of file ViewerWidget.h.
|
protected |
Definition at line 113 of file ViewerWidget.h.
|
protected |
Definition at line 114 of file ViewerWidget.h.
|
protected |
Definition at line 109 of file ViewerWidget.h.
|
protected |
Definition at line 108 of file ViewerWidget.h.
|
protected |
Definition at line 105 of file ViewerWidget.h.
|
protected |
Definition at line 106 of file ViewerWidget.h.
|
protected |
Definition at line 110 of file ViewerWidget.h.
|
protected |
Definition at line 117 of file ViewerWidget.h.
|
protected |
Definition at line 116 of file ViewerWidget.h.