qglviewer.h
67 // Complete implementation is provided so that the constructor is defined with QT3_SUPPORT when .h is included.
70 explicit QGLViewer(QWidget* parent=NULL, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0)
74 explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const char* name=0, const QGLWidget* shareWidget=0,Qt::WindowFlags flags=0)
78 QGLViewer(QGLContext* context, QWidget* parent, const char* name=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0)
85 explicit QGLViewer(QGLContext *context, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0);
86 explicit QGLViewer(const QGLFormat& format, QWidget* parent=0, const QGLWidget* shareWidget=0, Qt::WindowFlags flags=0);
128 void setAxisIsDrawn(bool draw=true) { axisIsDrawn_ = draw; Q_EMIT axisIsDrawnChanged(draw); update(); }
130 void setGridIsDrawn(bool draw=true) { gridIsDrawn_ = draw; Q_EMIT gridIsDrawnChanged(draw); update(); }
132 void setFPSIsDisplayed(bool display=true) { FPSIsDisplayed_ = display; Q_EMIT FPSIsDisplayedChanged(display); update(); }
134 void setTextIsEnabled(bool enable=true) { textIsEnabled_ = enable; Q_EMIT textIsEnabledChanged(enable); update(); }
237 void setSceneBoundingBox(const qglviewer::Vec& min, const qglviewer::Vec& max) { camera()->setSceneBoundingBox(min,max); }
291 void setMouseGrabberIsEnabled(const qglviewer::MouseGrabber* const mouseGrabber, bool enabled=true);
301 bool mouseGrabberIsEnabled(const qglviewer::MouseGrabber* const mouseGrabber) { return !disabledMouseGrabbers_.contains(reinterpret_cast<size_t>(mouseGrabber)); }
371 static void drawArrow(const qglviewer::Vec& from, const qglviewer::Vec& to, float radius=-1.0f, int nbSubdivisions=12);
380 // void draw3DText(const qglviewer::Vec& pos, const qglviewer::Vec& normal, const QString& string, GLfloat height=0.1f);
960 enum ClickAction { NO_CLICK_ACTION, ZOOM_ON_PIXEL, ZOOM_TO_FIT, SELECT, RAP_FROM_PIXEL, RAP_IS_CENTER,
980 void getClickButtonState(ClickAction action, int& state, bool& doubleClick, Qt::MouseButtons& buttonsBefore) const;
984 MouseAction mouseAction(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button) const;
1004 void setMouseBinding(int state, MouseHandler handler, MouseAction action, bool withConstraint=true);
1005 void setMouseBinding(int state, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1006 void setMouseBindingDescription(int state, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1009 void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true);
1010 void setMouseBinding(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1011 void setWheelBinding(Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true);
1012 void setMouseBindingDescription(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1014 void setMouseBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton buttons, MouseHandler handler, MouseAction action, bool withConstraint=true);
1015 void setMouseBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, ClickAction action, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1016 void setWheelBinding(Qt::Key key, Qt::KeyboardModifiers modifiers, MouseHandler handler, MouseAction action, bool withConstraint=true);
1017 void setMouseBindingDescription(Qt::Key key, Qt::KeyboardModifiers modifiers, Qt::MouseButton button, QString description, bool doubleClick=false, Qt::MouseButtons buttonsBefore=Qt::NoButton);
1095 static int QGLViewerIndex(const QGLViewer* const viewer) { return QGLViewer::QGLViewerPool_.indexOf(const_cast<QGLViewer*>(viewer)); }
1251 ClickBindingPrivate(Qt::KeyboardModifiers m, Qt::MouseButton b, bool dc, Qt::MouseButtons bb, Qt::Key k)
QColor foregroundColor() const
Returns the foreground color used by the viewer.
Definition: qglviewer.h:182
QColor backgroundColor() const
Returns the background color of the viewer.
Definition: qglviewer.h:168
void setSceneBoundingBox(const qglviewer::Vec &min, const qglviewer::Vec &max)
Convenient way to call setSceneCenter() and setSceneRadius() from a (world axis aligned) bounding box...
Definition: qglviewer.h:237
float bufferTextureMaxV() const
Same as bufferTextureMaxU(), but for the v texture coordinate.
Definition: qglviewer.h:581
virtual void drawWithNames()
This method is called by select() and should draw selectable entities.
Definition: qglviewer.h:885
Definition: camera.h:29
A ManipulatedFrame is a Frame that can be rotated and translated using the mouse. ...
Definition: manipulatedFrame.h:95
void setForegroundColor(const QColor &color)
Sets the foregroundColor() of the viewer, used to draw visual hints.
Definition: qglviewer.h:188
MouseAction
Defines the possible actions that can be binded to a mouse action (a click, followed by a mouse displ...
Definition: qglviewer.h:969
QFont scaledFont(const QFont &font) const
Return a possibly scaled version of font, used for snapshot rendering.
Definition: qglviewer.h:552
void setStateFileName(const QString &name)
Defines the stateFileName() used by saveStateToFile() and restoreStateFromFile(). ...
Definition: qglviewer.h:1059
qglviewer::ManipulatedFrame * manipulatedFrame() const
Returns the viewer's qglviewer::ManipulatedFrame.
Definition: qglviewer.h:262
int snapshotCounter() const
Returns the value of the counter used to name snapshots in saveSnapshot() when automatic is true...
Definition: qglviewer.h:493
FARSA_UTIL_TEMPLATE const T max(const T &t1, const U &t2)
KeyboardAction
Defines the different actions that can be associated with a keyboard shortcut using setShortcut()...
Definition: qglviewer.h:905
bool axisIsDrawn() const
Returns true if the world axis is drawn by the viewer.
Definition: qglviewer.h:97
virtual void setSceneCenter(const qglviewer::Vec ¢er)
Sets the sceneCenter(), defined in world coordinates.
Definition: qglviewer.h:228
Abstract class for objects that grab mouse focus in a QGLViewer.
Definition: mouseGrabber.h:130
bool textIsEnabled() const
Returns true if text display (see drawText()) is enabled.
Definition: qglviewer.h:113
bool isFullScreen() const
Returns true if the viewer is in fullScreen mode.
Definition: qglviewer.h:329
bool gridIsDrawn() const
Returns true if a XY grid is drawn by the viewer.
Definition: qglviewer.h:101
float bufferTextureMaxU() const
Returns the texture coordinate corresponding to the u extremum of the bufferTexture.
Definition: qglviewer.h:579
virtual QString shortcutBindingsString() const
This method is deprecated, use keyboardString() instead.
Definition: qglviewer.h:722
bool displaysInStereo() const
Returns true if the viewer displays in stereo.
Definition: qglviewer.h:349
void setTextIsEnabled(bool enable=true)
Sets the state of textIsEnabled().
Definition: qglviewer.h:134
int selectRegionHeight() const
See the selectRegionWidth() documentation.
Definition: qglviewer.h:837
float aspectRatio() const
Returns the aspect ratio of the viewer's widget (width() / height()).
Definition: qglviewer.h:311
virtual QString mouseBindingsString() const
This method is deprecated, use mouseString() instead.
Definition: qglviewer.h:720
int selectedName() const
Returns the name (an integer value) of the entity that was last selected by select().
Definition: qglviewer.h:812
void setBackgroundColor(const QColor &color)
Sets the backgroundColor() of the viewer and calls qglClearColor().
Definition: qglviewer.h:186
virtual void postSelection(const QPoint &point)
This method is called at the end of the select() procedure.
Definition: qglviewer.h:894
const QString & snapshotFileName() const
Returns the snapshot file name used by saveSnapshot().
Definition: qglviewer.h:455
MouseHandler
Defines the different mouse handlers: camera() or manipulatedFrame().
Definition: qglviewer.h:954
qglviewer::Camera * camera() const
Returns the associated qglviewer::Camera, never NULL.
Definition: qglviewer.h:250
bool FPSIsDisplayed() const
Returns true if the viewer displays the current frame rate (Frames Per Second).
Definition: qglviewer.h:108
ClickAction
Defines the possible actions that can be binded to a mouse click using setMouseBinding(Qt::KeyboardMo...
Definition: qglviewer.h:960
const QString & snapshotFormat() const
Returns the snapshot file format used by saveSnapshot().
Definition: qglviewer.h:487
void showEntireScene()
Moves the camera so that the entire scene is visible.
Definition: qglviewer.h:242
static const QList< QGLViewer * > & QGLViewerPool()
Returns a QList that contains pointers to all the created QGLViewers.
Definition: qglviewer.h:1085
void setFPSIsDisplayed(bool display=true)
Sets the state of FPSIsDisplayed().
Definition: qglviewer.h:132
qglviewer::Vec sceneCenter() const
Returns the scene center, defined in world coordinates.
Definition: qglviewer.h:215
bool cameraIsEdited() const
Returns true if the camera() is being edited in the viewer.
Definition: qglviewer.h:123
int snapshotQuality()
Defines the image quality of the snapshots produced with saveSnapshot().
Definition: qglviewer.h:502
FARSA_UTIL_TEMPLATE const T min(const T &t1, const U &t2)
bool mouseGrabberIsEnabled(const qglviewer::MouseGrabber *const mouseGrabber)
Returns true if mouseGrabber is enabled.
Definition: qglviewer.h:301
qglviewer::MouseGrabber * mouseGrabber() const
Returns the current qglviewer::MouseGrabber, or NULL if no qglviewer::MouseGrabber currently grabs mo...
Definition: qglviewer.h:289
int selectRegionWidth() const
Returns the width (in pixels) of a selection frustum, centered on the mouse cursor, that is used to select objects.
Definition: qglviewer.h:835
void setAnimationPeriod(int period)
Sets the animationPeriod(), in milliseconds.
Definition: qglviewer.h:616
void toggleAnimation()
Calls startAnimation() or stopAnimation(), depending on animationIsStarted().
Definition: qglviewer.h:632
bool animationIsStarted() const
Return true when the animation loop is started.
Definition: qglviewer.h:597
virtual QString helpString() const
Returns the QString displayed in the help() window main tab.
Definition: qglviewer.h:713
virtual QSize sizeHint() const
Returns the recommended size for the QGLViewer.
Definition: qglviewer.h:351
static int QGLViewerIndex(const QGLViewer *const viewer)
Returns the index of the QGLViewer viewer in the QGLViewerPool().
Definition: qglviewer.h:1095