Developer Documentation
|
#include <ACG/QtWidgets/QtBaseViewer.hh>
Classes | |
struct | PickMode |
Public Types | |
enum | Options { Nothing =0, ShowPrivateStatusBar =1, ShowToolBar =2, ShowPickButton =4, ShowLassoButton =8, ShowQuestionButton =0x10, ShowWheelX =0x20, ShowWheelY =0x40, ShowWheelZ =0x80, ShowWheels =0xe0, DefaultOptions = 0xffff & (~ShowPrivateStatusBar) } |
enum | NavigationMode { NORMAL_NAVIGATION, FIRSTPERSON_NAVIGATION } |
Navigation mode. More... | |
enum | ProjectionMode { ORTHOGRAPHIC_PROJECTION, PERSPECTIVE_PROJECTION } |
projection mode More... | |
enum | ActionMode { ExamineMode, PickingMode, QuestionMode, LightMode } |
How to react on mouse events? More... | |
enum | FaceOrientation { CCW_ORIENTATION, CW_ORIENTATION } |
orientation of the faces More... | |
enum | NormalsMode { DONT_TOUCH_NORMALS, NORMALIZE_NORMALS } |
Automatically normalize normals? More... | |
Public Slots | |
virtual void | drawNow () |
virtual void | updateGL () |
Redraw scene. Triggers paint event for updating the view (cf. drawNow()). | |
virtual void | setHome () |
set home position | |
virtual void | home () |
go to home pos | |
virtual void | viewAll () |
view the whole scene | |
virtual void | flyTo (const QPoint &_pos, bool _move_back) |
Fly to. Get closer if _move_back= get more distant else. More... | |
virtual void | flyTo (const QPoint &_pos) |
Fly to, get closer. | |
virtual void | flyFrom (const QPoint &_pos) |
Fly to, get more distant. | |
virtual void | flyTo (const Vec3d &_position, const Vec3d &_center, double _time=1000.0) |
virtual void | examineMode () |
calls actionMode() with ExamineMode (cf. ActionMode) | |
virtual void | lightMode () |
calls actionMode() with LightMode (cf. ActionMode) | |
virtual void | questionMode () |
calls actionMode() with QuestionMode (cf. ActionMode) | |
virtual void | perspectiveProjection () |
set perspective view (projectionMode(PERSPECTIVE_PROJECTION)) | |
virtual void | orthographicProjection () |
set orthographic view (projectionMode(ORTHOGRAPHIC_PROJECTION)) | |
virtual void | toggleProjectionMode () |
toggle projection mode | |
virtual void | toggleNavigationMode () |
toggle navigation mode | |
virtual void | showSceneGraphDialog () |
show scenegraph widget | |
virtual void | setView (const GLMatrixd &_modelview, const GLMatrixd &_inverse_modelview) |
set view, used for synchronizing | |
void | actionBackground () |
void | actionCopyView () |
void | actionPasteView () |
void | actionPasteDropSize () |
void | actionSynchronize () |
void | actionAnimation () |
void | actionBackfaceCulling () |
void | actionTwoSidedLighting () |
void | actionSynchronize (bool _enable) |
void | actionAnimation (bool _enable) |
void | actionBackfaceCulling (bool _enable) |
void | actionTwoSidedLighting (bool _enable) |
void | actionDrawMenu (QAction *_action) |
void | actionPickMenu (QAction *_action) |
Signals | |
void | projectionModeChanged (bool _ortho) |
void | navigationModeChanged (bool _normal) |
void | signalInitializeGL () |
emitted when OpenGL stuff can be initialized | |
void | signalMouseEvent (QMouseEvent *, const std::string &) |
void | signalMouseEvent (QMouseEvent *) |
This signal does not send the pick mode and is kept for compatibility. | |
void | signalWheelEvent (QWheelEvent *, const std::string &) |
Emitted in Pick mode. Uses pick mode. | |
void | signalMouseEventIdentify (QMouseEvent *) |
void | signalSetView (const GLMatrixd &_modelview, const GLMatrixd &_inverse_modelview) |
set view, used for synchronizing (cf. slotSetView()) | |
void | signalSceneGraphChanged (ACG::SceneGraph::BaseNode *_root) |
scene graph has changed | |
void | signalNodeChanged (ACG::SceneGraph::BaseNode *_node) |
scene graph has changed | |
void | signalActionModeChanged (ACG::QtWidgets::QtBaseViewer::ActionMode _m) |
action mode was changed | |
void | signalDrawScene (ACG::GLState *_state) |
render callback | |
void | signalCustomContextMenuRequested (const QPoint &) |
view handling | |
void | viewUpdated () |
This signal is emitted when the scene is repainted due to any event. | |
void | viewChanged () |
This signal is emitted whenever the view is changed by the user. | |
Public Member Functions | |
QtBaseViewer (QWidget *_parent=0, const char *_name=0, QStatusBar *_statusBar=0, const QGLFormat *_format=0, const QtBaseViewer *_share=0, Options _options=DefaultOptions) | |
virtual | ~QtBaseViewer () |
Destructor. | |
virtual QSize | sizeHint () const |
QStatusBar * | statusBar () |
get status bar, guaranteed to be not 0 (QStatusBar may be invisible) | |
void | setStatusBar (QStatusBar *_sb) |
void | applyOptions (int _options) |
Apply ORed Options _options . | |
int | options () const |
get current ORed Options | |
virtual void | makeCurrent () |
Makes this widget the current widget for OpenGL operations. | |
virtual void | swapBuffers () |
Swaps the screen contents with the off-screen buffer. | |
GLState & | glState () |
get OpenGL state | |
void | backgroundColor (const Vec4f &_color) |
Vec4f | backgroundColor () |
get background color | |
virtual void | lockUpdate () |
virtual void | unlockUpdate () |
Unlock display locked by updateLock(). | |
virtual void | unlockAndUpdate () |
bool | isUpdateLocked () const |
void | lockProjectionUpdate (void) |
Lock update of projection matrix. | |
void | unlockProjectionUpdate (void) |
Unlock update of projection matrix. | |
bool | animation () const |
Is animation enabled? | |
void | animation (bool _b) |
Set animation enabled. | |
void | trackMouse (bool _track) |
Enable/disable mouse tracking (move events with no button press) | |
void | enablePopupMenu (bool _enable) |
Enable/disable right button draw mode menu (default: enabled) | |
SceneGraph::BaseNode * | sceneGraph () |
Returns: root node of scene graph. | |
const SceneGraph::BaseNode * | sceneGraph () const |
same but const | |
void | sceneGraph (SceneGraph::BaseNode *_root) |
void | projectionMode (ProjectionMode _p) |
Changes the projection mode and updates the projection matrix. | |
ProjectionMode | projectionMode () const |
get current projection mode | |
void | navigationMode (NavigationMode _n) |
Changes the navigation mode. | |
NavigationMode | navigationMode () const |
get current navigation mode | |
void | setScenePos (const ACG::Vec3d &_center, double _radius, const bool _setCenter=true) |
void | setSceneCenter (const ACG::Vec3d &_center) |
const ACG::Vec3d & | scene_center () const |
double | scene_radius () const |
void | setSceneRadius (double radius) |
void | viewingDirection (const ACG::Vec3d &_dir, const ACG::Vec3d &_up) |
set the viewing direction | |
void | setFovy (double _fovy) |
set field of view y | |
void | actionMode (ActionMode) |
ActionMode | lastActionMode () |
Return the last action mode. | |
ActionMode | actionMode () const |
get action mode | |
void | faceOrientation (FaceOrientation) |
set face orientation (used for back face culling, backFaceCulling()) | |
FaceOrientation | faceOrientation () const |
get face orientation | |
void | backFaceCulling (bool _b) |
set backface culling on/off | |
bool | backFaceCulling () const |
is backface culling enabled? | |
void | twoSidedLighting (bool _b) |
set 2-sided lighting on/off | |
bool | twoSidedLighting () const |
is 2-sided lighing enabled? | |
void | normalsMode (NormalsMode _mode) |
set treatment of normals | |
NormalsMode | normalsMode () const |
get treatment of normals | |
GLMatrixd & | light_matrix () |
get light rotation matrix | |
void | rotate_lights (Vec3d &_axis, double _angle) |
rotete light sources | |
void | update_lights () |
update light position | |
void | copyToImage (QImage &_image, GLenum _buffer=GL_BACK) |
copy current framebuffer to an QImage | |
void | copyToImage (QImage &_image, unsigned int _left, unsigned int _top, unsigned int _width, unsigned int _height, GLenum _buffer) |
copy current framebuffer to an QImage | |
unsigned int | glWidth () const |
get width of QGLWidget | |
unsigned int | glHeight () const |
get height of QGLWidget | |
QSize | glSize () const |
get size of QGLWIdget | |
QPoint | glMapFromGlobal (const QPoint &_pos) const |
map global to glarea coords | |
QPoint | glMapToGlobal (const QPoint &_pos) const |
map glarea coords to global coords | |
void | drawMode (ACG::SceneGraph::DrawModes::DrawMode _mode) |
set draw mode (No test if this mode is available!) | |
ACG::SceneGraph::DrawModes::DrawMode | drawMode () |
get current draw mode | |
void | encodeView (QString &_view) |
convert current view to text representation | |
bool | decodeView (const QString &_view) |
void | initModelviewMatrix () |
initialize modelview matrix to identity | |
void | grabGLArea () |
void | releaseGLArea () |
void | drawBlendedObjects (bool _status) |
One or two pass Drawing. | |
void | translate (const Vec3d &trans) |
translate the scene and update modelview matrix | |
void | rotate (const Vec3d &axis, double angle) |
rotate the scene (around its center) and update modelview matrix | |
void | rotate (const Vec3d &axis, double angle, const Vec3d &_center) |
rotate the scene and update modelview matrix | |
QMenu * | getPickMenu () |
Get the menu pointers (required to add them to the menubar as a temp workaround for a qt 4.3 bug. | |
QMenu * | getFuncMenu () |
QMenu * | getDrawMenu () |
QToolBar * | getToolBar () |
Returns a pointer to the Toolbar. | |
QToolBar * | removeToolBar () |
Returns a pointer to the toolbar and removes it from the default position in the examiner widget. | |
void | moveForward () |
First person navigation: Move forward. | |
void | moveBack () |
First person navigation: Move back. | |
void | strafeLeft () |
First person navigation: Strafe left. | |
void | strafeRight () |
First person navigation: Strafe Right. | |
Protected Slots | |
virtual void | sceneRectChanged (const QRectF &rect) |
process graphics scene size changes | |
virtual void | slotWheelX (double _dAngle) |
process signals from wheelX_ | |
virtual void | slotWheelY (double _dAngle) |
process signals from wheelX_ | |
virtual void | slotWheelZ (double _dist) |
process signals from wheelZ_ | |
virtual void | slotNodeChanged (ACG::SceneGraph::BaseNode *_node) |
connected to scenegraph widget | |
virtual void | cleanupEventFilter () |
correct ??? (same function as in qt src) | |
Protected Member Functions | |
virtual void | initializeGL () |
initialize OpenGL states | |
virtual void | paintGL () |
draw the scene. Triggered by updateGL(). | |
virtual void | resizeGL (int _w, int _h) |
handle resize events | |
virtual void | glMousePressEvent (QMouseEvent *_event) |
handle mouse press events | |
virtual void | glMouseDoubleClickEvent (QMouseEvent *_event) |
handle mouse double click events | |
virtual void | glMouseMoveEvent (QMouseEvent *_event) |
handle mouse move events | |
virtual void | glMouseReleaseEvent (QMouseEvent *_event) |
handle mouse release events | |
virtual void | glMouseWheelEvent (QWheelEvent *_event) |
handle mouse wheel events | |
virtual void | glContextMenuEvent (QContextMenuEvent *_event) |
handle mouse press events More... | |
virtual void | viewMouseEvent (QMouseEvent *_event)=0 |
specialized viewer: hande mouse events | |
virtual void | viewWheelEvent (QWheelEvent *_event)=0 |
specialized viewer: handle wheel events | |
virtual void | lightMouseEvent (QMouseEvent *) |
optional: hande mouse events to rotate light | |
void | updateProjectionMatrix () |
updates projection matrix | |
void | updatePickMenu () |
update pick mode menu | |
Protected Attributes | |
Vec3d | scene_center_ |
Vec3d | trackball_center_ |
double | scene_radius_ |
double | trackball_radius_ |
GLdouble | orthoWidth_ |
GLdouble | near_ |
GLdouble | far_ |
GLdouble | fovy_ |
GLState * | glstate_ |
bool | isRotating_ |
QStatusBar * | statusbar_ |
Private Slots | |
void | hidePopupMenus () |
Private Member Functions | |
QtBaseViewer (const QtBaseViewer &) | |
Copy constructor. Never used! | |
QtBaseViewer & | operator= (const QtBaseViewer &) |
Assignment operator. Never used! | |
void | createWidgets (const QGLFormat *_format, QStatusBar *_sb, const QtBaseViewer *_share) |
void | drawScene () |
void | drawScene_mono () |
void | drawScene_stereo () |
void | updatePopupMenu () |
Private Attributes | |
Vec3d | home_center_ |
double | home_radius_ |
GLMatrixd | home_modelview_ |
GLMatrixd | home_inverse_modelview_ |
double | homeOrthoWidth_ |
GLMatrixd | light_matrix_ |
NormalsMode | normalsMode_ |
FaceOrientation | faceOrientation_ |
ProjectionMode | projectionMode_ |
NavigationMode | navigationMode_ |
ActionMode | actionMode_ |
ActionMode | lastActionMode_ |
bool | backFaceCulling_ |
bool | twoSidedLighting_ |
bool | animation_ |
bool | trackMouse_ |
bool | popupEnabled_ |
bool | glareaGrabbed_ |
double | frame_time_ |
QMenu * | pickMenu_ |
QMenu * | funcMenu_ |
QMenu * | drawMenu_ |
SceneGraph::BaseNode * | sceneGraphRoot_ |
ACG::SceneGraph::DrawModes::DrawMode | curDrawMode_ |
ACG::SceneGraph::DrawModes::DrawMode | availDrawModes_ |
bool | updateLocked_ |
bool | projectionUpdateLocked_ |
bool | blending_ |
QtSceneGraphDialog * | sceneGraphDialog_ |
Options | options_ |
QGLWidget * | glWidget_ |
QtGLGraphicsScene * | glScene_ |
QtGLGraphicsView * | glView_ |
QGraphicsWidget * | glBase_ |
QGraphicsGridLayout * | glBaseLayout_ |
QStatusBar * | privateStatusBar_ |
QGridLayout * | glLayout_ |
QToolBar * | buttonBar_ |
QToolButton * | pickButton_ |
QToolButton * | moveButton_ |
QToolButton * | lightButton_ |
QToolButton * | questionButton_ |
QToolButton * | projectionButton_ |
QToolButton * | homeButton_ |
QToolButton * | setHomeButton_ |
QToolButton * | viewAllButton_ |
QToolButton * | sceneGraphButton_ |
QToolButton * | stereoButton_ |
QtWheel * | wheelX_ |
QtWheel * | wheelY_ |
QtWheel * | wheelZ_ |
QMap< QString, QAction * > | action_ |
std::vector< QAction * > | drawMenuActions_ |
QTime | redrawTime_ |
Friends | |
class | QtGLGraphicsScene |
class | QtGLGraphicsView |
Stereo | |
bool | stereo_ |
Set eye distance for stereo. More... | |
double | eyeDist_ |
Set eye distance for stereo. More... | |
double | focalDist_ |
Set eye distance for stereo. More... | |
void | setEyeDistance (double _distance) |
Set eye distance for stereo. More... | |
double | eyeDistance () |
Get the current eye Distance. | |
void | setFocalDistance (double _distance) |
Set focal distance for stereo. More... | |
double | focalDistance () |
Get the current focal Distance. | |
virtual void | toggleStereoMode () |
toggle stereo mode | |
virtual void | setStereoMode (bool _b) |
enable/disable stereo mode | |
Key handling | |
bool | disableKeyHandling_ |
Enable or disable internal Key handling. More... | |
void | disableKeyHandling (bool _state) |
Enable or disable internal Key handling. More... | |
bool | keyHandlingState () |
get the current key handling state. More... | |
void | signalKeyPressEvent (QKeyEvent *) |
Key Event received. More... | |
virtual void | glKeyPressEvent (QKeyEvent *) |
Get keyPress events from the glArea. More... | |
virtual void | glKeyReleaseEvent (QKeyEvent *_event) |
Get keyRelease events from the glArea. More... | |
virtual bool | viewKeyPressEvent (QKeyEvent *_event)=0 |
Handle key events in view mode. More... | |
Drag and Drop | |
bool | externalDrag_ |
void | setExternalDrag (bool _external) |
Enable or disable external dragging controls. | |
void | startDragEvent (QMouseEvent *_event) |
void | dragEnterEvent (QDragEnterEvent *_event) |
void | dropEvent (QDropEvent *_event) |
virtual void | startDrag () |
drag & drop for modelview copying | |
virtual void | glDragEnterEvent (QDragEnterEvent *_event) |
drag & drop for modelview copying | |
virtual void | glDropEvent (QDropEvent *_event) |
drag & drop for modelview copying | |
Synchronize different viewers | |
bool | synchronized_ |
synchronized with different viewer? | |
bool | skipNextSync_ |
Skips the next synch event. | |
QUdpSocket * | socket_ |
socket used for synchronization | |
std::vector< QHostAddress > | sync_hosts_ |
List of hosts which should receive sync information. | |
void | sync_connect (const QtBaseViewer *) |
void | sync_disconnect (const QtBaseViewer *) |
unsync two sync_connect()ed QtBaseViewer's | |
virtual void | setSynchronization (bool _b) |
toggle global synchronization | |
bool | add_sync_host (const QString &_name) |
add host to synchronize with, given by its name | |
void | add_sync_host (QHostAddress &_adr) |
add host to synchronize with, given by its address | |
bool | synchronization () |
synchronized with different viewer? | |
void | sync_receive () |
synchronized with different viewer? | |
void | sync_send (const GLMatrixd &_modelview, const GLMatrixd &_inverse_modelview) |
synchronized with different viewer? | |
Snapshots | |
QString | snapshotName_ |
int | snapshotCounter_ |
QImage * | snapshot_ |
virtual void | snapshotBaseFileName (const QString &_fname) |
virtual void | snapshot () |
void | actionSnapshot () |
void | actionSnapshotName () |
void | actionSnapshotSavesView () |
Picking | |
std::vector< PickMode > | pick_modes_ |
std::string | pick_mode_name_ |
int | pick_mode_idx_ |
bool | renderPicking_ |
ACG::SceneGraph::PickTarget | pickRendererMode_ |
bool | pick (SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, Vec3d *_hitPointPtr=0) |
bool | fast_pick (const QPoint &_mousePos, Vec3d &_hitPoint) |
void | addPickMode (const std::string &_name, bool _mouse_tracking=false, int _pos=-1, bool _visible=true, QCursor _cursor=Qt::ArrowCursor) |
add pick mode More... | |
void | clearPickModes () |
const std::string & | pickMode () const |
void | pickMode (const std::string &_name) |
void | pickMode (int _id) |
void | renderPicking (bool _renderPicking, ACG::SceneGraph::PickTarget _mode) |
virtual void | pickingMode () |
void | setPickModeCursor (const std::string &_name, QCursor _cursor) |
set a new cursor for the pick mode More... | |
void | setPickModeMouseTracking (const std::string &_name, bool _mouseTracking) |
set mouseTracking for the pick mode More... | |
void | signalPickModeChanged (const std::string &) |
Base Viewer Widget: All viewers are derived from this one. Implement Mouse & Keyboard Events. Redefine Signals and Slots. See for example "QtExaminerViewer"
Definition at line 130 of file QtBaseViewer.hh.
How to react on mouse events?
Enumerator | |
---|---|
PickingMode |
Picking mode. Actually no pick()ing is performed (!) but events are forwarded to the application via signalMouseEvent(). |
Definition at line 362 of file QtBaseViewer.hh.
orientation of the faces
Enumerator | |
---|---|
CCW_ORIENTATION |
counter clockwise (default) |
CW_ORIENTATION |
clockwise |
Definition at line 391 of file QtBaseViewer.hh.
Navigation mode.
Enumerator | |
---|---|
NORMAL_NAVIGATION |
Normal mode. |
FIRSTPERSON_NAVIGATION |
First person mode. |
Definition at line 312 of file QtBaseViewer.hh.
Automatically normalize normals?
Enumerator | |
---|---|
DONT_TOUCH_NORMALS |
use provided normals as is |
NORMALIZE_NORMALS |
Automatically normalize normals. Input normals are not normalized or the transformation matrix does scaling or shearing. |
Definition at line 412 of file QtBaseViewer.hh.
Options for creating a QtBaseViewer. (cf. QtBaseViewer::QtBaseViewer(), applyOptions())
Enumerator | |
---|---|
Nothing |
all options disabled |
ShowPrivateStatusBar |
Show private status bar? |
ShowToolBar |
Show tool bar? Note: This toolbar inlcudes the wheels for translation along the z-axis (right, cf. ShowWheelZ)! The default setting is to show all buttons (see below). |
ShowPickButton |
Show pick button? Effect only if ShowToolBar! |
ShowLassoButton |
Show lasso button? Effect only if ShowToolBar! |
ShowQuestionButton |
Show question button? Effect only if ShowToolBar! |
ShowWheelX |
Show wheel for rotation around x-axis (left)? |
ShowWheelY |
Show wheel for rotation around y-axis (bottom)? |
ShowWheelZ |
Show wheel for translation along z-axis (right)? Effect only if ShowToolBar! |
ShowWheels |
Show all three wheels (default)! |
DefaultOptions |
default: all options (but not private statusbar) enabled |
Definition at line 140 of file QtBaseViewer.hh.
projection mode
Enumerator | |
---|---|
ORTHOGRAPHIC_PROJECTION |
orthographic |
PERSPECTIVE_PROJECTION |
perspective |
Definition at line 318 of file QtBaseViewer.hh.
ACG::QtWidgets::QtBaseViewer::QtBaseViewer | ( | QWidget * | _parent = 0 , |
const char * | _name = 0 , |
||
QStatusBar * | _statusBar = 0 , |
||
const QGLFormat * | _format = 0 , |
||
const QtBaseViewer * | _share = 0 , |
||
Options | _options = DefaultOptions |
||
) |
Create a QtBaseViewer.
_parent | parent widget |
_name | name (qt internal, qt debugging) |
_statusBar | pointer to an existing status bar for this widget, if statusBar==0 then a private status bar will be created |
_format | OpenGL context settings, will be passed to glarea() |
_share | Second base viewer for shared context |
_options | QtBaseViewer::Options |
Definition at line 136 of file QtBaseViewer.cc.
void ACG::QtWidgets::QtBaseViewer::actionMode | ( | ActionMode | _am | ) |
Set action mode. The ActionMode determines the type of reaction on mouse events. Note: You may also use the slots examineMode(), etc. to set this mode.
Definition at line 631 of file QtBaseViewer.cc.
|
slot |
This action triggers a snapshot
Definition at line 135 of file QtBaseViewerSnapshot.cc.
|
slot |
This action creates a widget for entering the snapshots name.
Definition at line 144 of file QtBaseViewerSnapshot.cc.
|
slot |
Doesn't do anything at the moment. Widget shows a checkbox for that.
Definition at line 165 of file QtBaseViewerSnapshot.cc.
void ACG::QtWidgets::QtBaseViewer::addPickMode | ( | const std::string & | _name, |
bool | _mouse_tracking = false , |
||
int | _pos = -1 , |
||
bool | _visible = true , |
||
QCursor | _cursor = Qt::ArrowCursor |
||
) |
add pick mode
_name | Name of the Pick Mode or "Separator" to insert a separator |
_mouse_tracking | true: every mouse movement will emit mouse events not only when mousebutton is pressed |
_pos | position to insert the mode in the popup menu. |
_visible | Visible or hidden pick mode |
_cursor | Active cursor for that pick mode |
Definition at line 251 of file QtBaseViewerPicking.cc.
|
inline |
Set background color. Sets the OpenGL clear color to (_c.red(), _c.green(), _c.blue(), 0).
Definition at line 249 of file QtBaseViewer.hh.
void ACG::QtWidgets::QtBaseViewer::clearPickModes | ( | ) |
clear all pick modes
Definition at line 302 of file QtBaseViewerPicking.cc.
bool ACG::QtWidgets::QtBaseViewer::decodeView | ( | const QString & | _view | ) |
Decode and apply text representation of view encoded by encodeView(). If _view
was successfully decoded it will immediately be applied and true
is returned, false
is returned else.
Definition at line 1373 of file QtBaseViewer.cc.
void ACG::QtWidgets::QtBaseViewer::disableKeyHandling | ( | bool | _state | ) |
Enable or disable internal Key handling.
With this function you can enable or disable viewers internal key handling. If disabled, all key events are passed to the widgets parent.
Definition at line 72 of file QtBaseViewerKeyHandling.cc.
|
signal |
Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drag enters the gl widget.
|
virtualslot |
Draws the scene immediately. This method does not trigger a paint event (like updateGL()) but redraws the scene immediately. It does not swap buffers! This has to be done manually.
Definition at line 800 of file QtBaseViewer.cc.
|
signal |
Signal is emitted only if in externalDragMode ( see setExternalDrag ) It will be send if a drop occurs in the gl widget.
bool ACG::QtWidgets::QtBaseViewer::fast_pick | ( | const QPoint & | _mousePos, |
Vec3d & | _hitPoint | ||
) |
get the coordinates of the picked point by z-buffer re-projection
_mousePos | The position to pick |
_hitPoint | The point returned by the reprojection |
Definition at line 202 of file QtBaseViewerPicking.cc.
|
virtualslot |
Fly to. Get closer if _move_back=
get more distant else. false
,
Definition at line 1000 of file QtBaseViewer.cc.
|
virtualslot |
Fly to point and set new viewing direction (animated).
_position | New viewer position ( the new eye point of the viewer ) |
_center | The new scene center ( the point we are looking at ) |
_time | Animation time in ms |
Definition at line 1042 of file QtBaseViewer.cc.
|
protectedvirtual |
|
protectedvirtual |
Get keyPress events from the glArea.
This function is called by the internal gl widget when receiving a key press event.
Definition at line 90 of file QtBaseViewerKeyHandling.cc.
|
protectedvirtual |
Get keyRelease events from the glArea.
This function is called by the internal gl widget when receiving a key release event. Here these events are simply passed to the parent widget.
Definition at line 84 of file QtBaseViewerKeyHandling.cc.
|
inline |
Are updateDisplayList() and updateGL() locked? (c.f. lockUpdate())
Definition at line 271 of file QtBaseViewer.hh.
bool ACG::QtWidgets::QtBaseViewer::keyHandlingState | ( | ) |
get the current key handling state.
Definition at line 78 of file QtBaseViewerKeyHandling.cc.
|
virtual |
Lock update of display. If locked (isUpdateLocked()) then all calls to updateDisplayList() and updateGL() will have no effect! This is true until the display is unlockUpdate()'ed.
Definition at line 426 of file QtBaseViewer.cc.
bool ACG::QtWidgets::QtBaseViewer::pick | ( | SceneGraph::PickTarget | _pickTarget, |
const QPoint & | _mousePos, | ||
unsigned int & | _nodeIdx, | ||
unsigned int & | _targetIdx, | ||
Vec3d * | _hitPointPtr = 0 |
||
) |
Apply pick action.
Information about the picked primitive is stored in the provided pointers. No information is stored if 0-pointers are given. Resulting values are defined only if true
has been returned!
_pickTarget | Select what should be picked: Faces/Vertices/... |
_mousePos | The position to be used for picking |
_nodeIdx | If picking is successfull this will contain the id of the scenegraph node picked. |
_targetIdx | Special index defined by the picked Node. E.g. Facehandle/VertexHandle/.. for MeshNodes |
_hitPointPtr | Pointer to 3D point from picking |
Definition at line 86 of file QtBaseViewerPicking.cc.
|
virtualslot |
calls actionMode() with PickingMode
(cf. ActionMode) Switches to pickingMode
Definition at line 338 of file QtBaseViewerPicking.cc.
const std::string & ACG::QtWidgets::QtBaseViewer::pickMode | ( | ) | const |
return the currently active pick mode
Definition at line 314 of file QtBaseViewerPicking.cc.
void ACG::QtWidgets::QtBaseViewer::pickMode | ( | const std::string & | _name | ) |
Switch to given picking mode
_name | Name of the picking mode |
Definition at line 323 of file QtBaseViewerPicking.cc.
void ACG::QtWidgets::QtBaseViewer::pickMode | ( | int | _id | ) |
Switch to given picking mode
_id | Id of the picking Mode |
Definition at line 227 of file QtBaseViewerPicking.cc.
void ACG::QtWidgets::QtBaseViewer::renderPicking | ( | bool | _renderPicking, |
ACG::SceneGraph::PickTarget | _mode | ||
) |
Use this function to switch the viewer to visualize picking. When you set this function to true the renderer will render the picking elements rather then the scene
Definition at line 78 of file QtBaseViewerPicking.cc.
|
inline |
|
inline |
void ACG::QtWidgets::QtBaseViewer::sceneGraph | ( | SceneGraph::BaseNode * | _root | ) |
Set scene graph. Sets the scene graph to the the graph rooted at _root
. The available draw modes in the scene graph will be collected and the popup menu will be updated.
The sceneGraphToched()
signal will be emitted (even if _root
does not actually change).
_root | The root node of the scene graph |
Definition at line 389 of file QtBaseViewer.cc.
void ACG::QtWidgets::QtBaseViewer::setEyeDistance | ( | double | _distance | ) |
Set eye distance for stereo.
Set the eye distance used for stereo projection. The function will enforce a redraw.
Definition at line 79 of file QtBaseViewerStereo.cc.
void ACG::QtWidgets::QtBaseViewer::setFocalDistance | ( | double | _distance | ) |
Set focal distance for stereo.
Set the focal distance used for stereo projection. The function will enforce a redraw.
Definition at line 88 of file QtBaseViewerStereo.cc.
|
slot |
set a new cursor for the pick mode
_name | Name of the Pick Mode |
_cursor | the new cursor |
Definition at line 271 of file QtBaseViewerPicking.cc.
|
slot |
set mouseTracking for the pick mode
_name | Name of the Pick Mode |
_mouseTracking | true: every mouse movement will emit mouse events not only when mousebutton is pressed |
Definition at line 286 of file QtBaseViewerPicking.cc.
void ACG::QtWidgets::QtBaseViewer::setSceneCenter | ( | const ACG::Vec3d & | _center | ) |
Set new center point of scene
Definition at line 599 of file QtBaseViewer.cc.
void ACG::QtWidgets::QtBaseViewer::setScenePos | ( | const ACG::Vec3d & | _center, |
double | _radius, | ||
const bool | _setCenter = true |
||
) |
Sets the center and dimension of the whole scene. This point is used as fixpoint for rotations and to set the eye point far enough from the scene so that the whole scene is visible.
Definition at line 574 of file QtBaseViewer.cc.
void ACG::QtWidgets::QtBaseViewer::setStatusBar | ( | QStatusBar * | _sb | ) |
Set status bar. Sets the QStatusBar
widget that is used for informational output, e.g. the frame rate of the rotation animation. If sb==0
a private QStatusBar
will be used, cf. Options. This private status bar may be invisible, but statusBar() will never return 0 even if setStatusBar(0) has been called!
Definition at line 331 of file QtBaseViewer.cc.
|
signal |
If popups are disabled context menu mode is set to custom Menu and the signal is passed from the QGLWidget to this signal. You can use mapToGlobal for mapping this point to global coords.
|
signal |
Key Event received.
This signal is emitted if a Key press event is received which is not handled by the widget itself. If internal key handling is disabled the events are passed to the parent of this widget.
|
signal |
A signal for giving mouse events to the application. This is done if the Pick-Button (top-most button of the toolbar) is activated. Connect to this signal to implement application specific handling of mouse events.
Notes:
|
signal |
Emitted instead o signalMouseEvent() if actionMode()==Question and _event
is a mouse press event.
|
signal |
This signal is emitted when the pickMode is changed and contains the new PickMode
|
virtualslot |
Trigger a snapshot and increase the snapshot counter. Save snapshot to file determined by snapshotBaseFileName() and the current snapshot counter. The back buffer will be saved.
Definition at line 88 of file QtBaseViewerSnapshot.cc.
|
virtualslot |
Set the base file name and reset the counter for snapshots.
The image file format is determined from the file name extension, the QImageIO formats are supported (e.g. ".ppm" [raw], ".png").
The current snapshot counter will be added in front of the last "." in the filename.
Note: Calling snapshotBaseFileName() will always reset the snapshot counter to 0.
Definition at line 78 of file QtBaseViewerSnapshot.cc.
|
signal |
Signal is emitted when Control modifier is pressed and mouse moded. It will only be emitted if in externalDragMode ( see setExternalDrag )
void ACG::QtWidgets::QtBaseViewer::sync_connect | ( | const QtBaseViewer * | _other | ) |
Synchronize with other QtBaseViewer. A QtBaseViewer can be synchronized with other instances. The viewing position is copied from the other widget after each transformation.
Definition at line 75 of file QtBaseViewerSynchronization.cc.
|
virtual |
Convenient unlock and update. Calls unlockUpdate() and then updateDisplayList() and updateGL() (Note that this has only an effect if !isUpdateLocked().)
Definition at line 440 of file QtBaseViewer.cc.
|
protectedpure virtual |
Handle key events in view mode.
This funtion is called by the BaseViewer if a key press event occured in view mode. This function has to be implemented by every viewer!
Implemented in ACG::QtWidgets::QtExaminerViewer.
|
private |
Enable or disable internal Key handling.
With this function you can enable or disable viewers internal key handling. If disabled, all key events are passed to the widgets parent.
Definition at line 1019 of file QtBaseViewer.hh.
|
private |
flag defining, if dragging will be handled internal by the viewer or passed via signals to the application
Definition at line 1062 of file QtBaseViewer.hh.
|
private |
Set eye distance for stereo.
Set the eye distance used for stereo projection. The function will enforce a redraw.
Definition at line 960 of file QtBaseViewer.hh.
|
private |
Set eye distance for stereo.
Set the eye distance used for stereo projection. The function will enforce a redraw.
Definition at line 960 of file QtBaseViewer.hh.
|
private |
Index of current pickMode
Definition at line 1291 of file QtBaseViewer.hh.
|
private |
Name of current pickMode
Definition at line 1287 of file QtBaseViewer.hh.
|
private |
Vector of all Picking modes
Definition at line 1283 of file QtBaseViewer.hh.
|
private |
If rendering is in picking mode, this variable controls which picking targets will be rendered. ( see renderPicking_ , renderPicking(bool _renderPicking, PickRendererMode _mode) , and ACG::SceneGraph::PickTarget
Definition at line 1301 of file QtBaseViewer.hh.
|
private |
This variable controls if the scene is rendered in normal or in picking mode
Definition at line 1295 of file QtBaseViewer.hh.
|
private |
Set the base file name and reset the counter for snapshots.
The image file format is determined from the file name extension, the QImageIO formats are supported (e.g. ".ppm" [raw], ".png").
The current snapshot counter will be added in front of the last "." in the filename.
Note: Calling snapshotBaseFileName() will always reset the snapshot counter to 0.
Definition at line 1154 of file QtBaseViewer.hh.
|
private |
Set the base file name and reset the counter for snapshots.
The image file format is determined from the file name extension, the QImageIO formats are supported (e.g. ".ppm" [raw], ".png").
The current snapshot counter will be added in front of the last "." in the filename.
Note: Calling snapshotBaseFileName() will always reset the snapshot counter to 0.
Definition at line 1153 of file QtBaseViewer.hh.
|
private |
Set the base file name and reset the counter for snapshots.
The image file format is determined from the file name extension, the QImageIO formats are supported (e.g. ".ppm" [raw], ".png").
The current snapshot counter will be added in front of the last "." in the filename.
Note: Calling snapshotBaseFileName() will always reset the snapshot counter to 0.
Definition at line 1152 of file QtBaseViewer.hh.
|
private |
Set eye distance for stereo.
Set the eye distance used for stereo projection. The function will enforce a redraw.
Definition at line 959 of file QtBaseViewer.hh.