|
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 | setBackgroundColor (const QColor &color) |
|
virtual void | setSceneRadius (float 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 | 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 | copyBufferToTexture (GLint internalFormat, GLenum format=GL_NONE) |
|
void | setAnimationPeriod (int period) |
|
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 | setShortcut (KeyboardAction action, unsigned int key) |
|
void | setKeyboardAccelerator (KeyboardAction action, int key) |
|
void | setKeyDescription (int key, QString description) |
|
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) |
|
virtual void | setPlayPathKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
|
virtual void | setAddKeyFrameKeyboardModifiers (Qt::KeyboardModifiers modifiers) |
|
void | setMouseBinding (int state, MouseHandler handler, MouseAction action, bool withConstraint=true) |
|
void | setMouseBindingDescription (int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
|
void | setWheelBinding (Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true) |
|
void | setHandlerKeyboardModifiers (MouseHandler handler, Qt::KeyboardModifiers modifiers) |
|
void | setHandlerStateKey (MouseHandler handler, int buttonState) |
|
void | setMouseStateKey (MouseHandler handler, int buttonState) |
|
virtual void | initFromDOMElement (const QDomElement &element) |
|
virtual void | saveStateToFile () |
|
virtual bool | restoreStateFromFile () |
|
void | setStateFileName (const QString &name) |
|
virtual void | resetVisualHints () |
|
|
void | addSceneObject (SceneObject *obj) |
|
void | clearAll () |
|
void | removeSceneObject (SceneObject *obj) |
|
| ViewerWidget (QWidget *parent=NULL) |
|
| QGLViewer (QWidget *parent=NULL, const char *name=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) |
|
| QGLViewer (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) |
|
| QGLViewer (QGLContext *context, QWidget *parent, const char *name=0, const QGLWidget *shareWidget=0, Qt::WindowFlags flags=0) |
|
virtual | ~QGLViewer () |
|
bool | axisIsDrawn () const |
|
bool | gridIsDrawn () const |
|
bool | FPSIsDisplayed () const |
|
bool | textIsEnabled () const |
|
bool | cameraIsEdited () const |
|
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 () |
|
QColor | backgroundColor () const |
|
QColor | foregroundColor () const |
|
void | setForegroundColor (const QColor &color) |
|
float | 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) |
|
float | aspectRatio () const |
|
float | currentFPS () |
|
bool | isFullScreen () const |
|
bool | displaysInStereo () const |
|
virtual QSize | sizeHint () const |
|
void | toggleStereoDisplay () |
|
void | toggleCameraMode () |
|
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) |
|
virtual QImage | grabFrameBuffer (bool withAlpha=false) |
|
const QString & | snapshotFileName () const |
|
const QString & | snapshotFilename () const |
|
const QString & | snapshotFormat () const |
|
int | snapshotCounter () const |
|
int | snapshotQuality () |
|
void | setSnapshotCounter (int counter) |
|
void | setSnapshotQuality (int quality) |
|
bool | openSnapshotFormatDialog () |
|
void | snapshotToClipboard () |
|
QFont | scaledFont (const QFont &font) const |
|
GLuint | bufferTextureId () const |
|
float | bufferTextureMaxU () const |
|
float | bufferTextureMaxV () const |
|
bool | animationIsStarted () const |
|
int | animationPeriod () const |
|
virtual void | startAnimation () |
|
virtual void | stopAnimation () |
|
virtual void | animate () |
|
void | toggleAnimation () |
|
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 () |
|
void | setSelectRegionHeight (int height) |
|
void | setSelectedName (int id) |
|
unsigned int | shortcut (KeyboardAction action) const |
|
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 |
|
Qt::KeyboardModifiers | addKeyFrameKeyboardModifiers () const |
|
Qt::KeyboardModifiers | playPathKeyboardModifiers () const |
|
MouseAction | mouseAction (int state) const |
|
int | mouseHandler (int state) const |
|
int | mouseButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
|
ClickAction | clickAction (int state, bool doubleClick, Qt::MouseButtons buttonsBefore) const |
|
void | getClickButtonState (ClickAction action, int &state, bool &doubleClick, Qt::MouseButtons &buttonsBefore) const |
|
MouseAction | wheelAction (Qt::KeyboardModifiers modifiers) const |
|
int | wheelHandler (Qt::KeyboardModifiers modifiers) const |
|
int | wheelButtonState (MouseHandler handler, MouseAction action, bool withConstraint=true) const |
|
void | setMouseBinding (int state, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton) |
|
QString | stateFileName () const |
|
virtual QDomElement | domElement (const QString &name, QDomDocument &document) const |
|
void | saveToFile (const QString &fileName=QString::null) |
|
bool | restoreFromFile (const QString &fileName=QString::null) |
|
virtual void | setVisualHintsMask (int mask, int delay=2000) |
|
virtual void | drawVisualHints () |
|
|
enum | MouseAction {
NO_MOUSE_ACTION,
ROTATE,
ZOOM,
TRANSLATE,
MOVE_FORWARD,
LOOK_AROUND,
MOVE_BACKWARD,
SCREEN_ROTATE,
ROLL,
DRIVE,
SCREEN_TRANSLATE,
ZOOM_ON_REGION
} |
|
static void | drawArrow (float length=1.0f, float radius=-1.0f, int nbSubdivisions=12) |
|
static void | drawArrow (const qglviewer::Vec &from, const qglviewer::Vec &to, float radius=-1.0f, int nbSubdivisions=12) |
|
static void | drawAxis (float length=1.0f) |
|
static void | drawGrid (float size=1.0f, int nbSubdivisions=10) |
|
static const QPtrList< QGLViewer > & | QGLViewerPool () |
|
static int | QGLViewerIndex (const QGLViewer *const viewer) |
|
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
} |
|
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
} |
|
Definition at line 35 of file ViewerWidget.h.
void octomap::ViewerWidget::draw |
( |
| ) |
|
|
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.
- Attention
- The
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 317 of file ViewerWidget.cpp.
void octomap::ViewerWidget::drawWithNames |
( |
| ) |
|
|
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):
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.
\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 349 of file ViewerWidget.cpp.
QString octomap::ViewerWidget::helpString |
( |
| ) |
const |
|
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):
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().
Reimplemented from QGLViewer.
Definition at line 80 of file ViewerWidget.cpp.
void octomap::ViewerWidget::init |
( |
| ) |
|
|
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.
- Attention
- You should not call updateGL() (or any method that calls it) in this method, as it will result in an infinite loop. The different QGLViewer set methods (setAxisIsDrawn(), setFPSIsDisplayed()...) are protected against this problem and can safely be called.
- Note
- All the OpenGL specific initializations must be done in this method: the OpenGL context is not yet available in your viewer constructor.
Reimplemented from QGLViewer.
Definition at line 45 of file ViewerWidget.cpp.
void octomap::ViewerWidget::postSelection |
( |
const QPoint & |
point | ) |
|
|
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 392 of file ViewerWidget.cpp.