|
MeVisLab Resolution Independence API
|
#include <SoQtViewerProxy.h>
Public Member Functions | |
| SoQtViewerProxy (SoQtRenderArea *renderArea=nullptr) | |
| This class implements access to the state of the SoQtMeVis viewer. | |
| ~SoQtViewerProxy () override | |
| Destructor. | |
| void | setCursor (int shapeID) override |
| void | setForceCursor (int shapeID) override |
| int | getCursor () |
| Returns the requested cursor shape. | |
| bool | hasShape (int shapeID) override |
| Checks whether this shape has already been defined. | |
| int | defineCursor (const char *cursorImgFileName, int hotSpotX=-1, int hotSpotY=-1, int id=-1) override |
| bool | getCurrentCursorPosition (int &x, int &y) override |
| bool | isInitialRendering () const override |
Returns true if the viewer does the initial rendering after it became visible. | |
| bool | isUserInterationEventInQueue () const override |
| Returns whether a user interaction event is the the GUI event queue. | |
| double | getDevicePixelRatio () override |
| Public Member Functions inherited from SoViewerProxy | |
| virtual | ~SoViewerProxy () |
| Destructor. | |
| virtual bool | isHighQualityOffscreenRendering () const |
Returns true if high quality offscreen rendering (e.g., for OffscreenRenderer) is desired. | |
| virtual SoMetaInformationMap * | getMetaInformationMap () |
Static Public Member Functions | |
| static bool | forceDefineCursor (int id, const char *cursorImgFileName, int hotSpotX=-1, int hotSpotY=-1) |
| defineCursor simply calls this method, which will overwrite previous shapes. | |
| static void | initializeDefaultCursors () |
| static QCursor | getCursor (int shapeID) |
Returns the QCursor associated with the given shapeID. | |
| static QPixmap | getPixmap (int shapeID) |
Returns the QPixmap associated with the given shapeID in 1x resolution. | |
| static QPixmap | getPixmap2x (int shapeID) |
Returns the QPixmap associated with the given shapeID in 2x resolution. | |
| static int | getShapeID (const QCursor &cursor) |
| static bool | isSameCursor (const QCursor &a, const QCursor &b) |
| Compares cursor shapes. | |
| Static Public Member Functions inherited from SoViewerProxy | |
| static const char *const * | cursorShapeNames () |
| static int | getPredefinedCursorCount () |
| static const ml::EnumValues< cursorShapeEnum > & | getCursorShapeEnumValues () |
| Returns enum values record for use with ml::TypedEnumField. | |
| static int | getNextFreeShapeID () |
| Returns the next free ID for defining custom cursor shape. | |
Protected Attributes | |
| SoQtRenderArea * | _renderArea |
| Pointer to the actual viewer. | |
| int | _requestedShape |
| Currently requested cursor shape. | |
| bool | _cursorEnforced |
| Cursor setting was enforced. | |
| virtual void | resetCursor () |
| Resets the stored cursor shape. This must be called before event handling traversal. | |
| virtual void | evaluateCursor () |
| Evaluates the set cursor shape. This must be called after event handling traversal. | |
| virtual bool | actionMayChangeCursor (SoAction *action) |
| static void | resetCursorCB (void *userData, SoAction *action) |
| static void | evaluateCursorCB (void *userData, SoAction *action) |
Definition at line 28 of file SoQtViewerProxy.h.
| SoQtViewerProxy::SoQtViewerProxy | ( | SoQtRenderArea * | renderArea = nullptr | ) |
This class implements access to the state of the SoQtMeVis viewer.
Constructor.
|
inlineoverride |
Destructor.
Definition at line 64 of file SoQtViewerProxy.h.
|
virtual |
Returns whether the given action may change the cursor. This is typically the case for SoHandleEvent actions with the exception of the artificial SoLocation2RefreshEvent event.
|
overridevirtual |
Defines new cursor shape - successful operation is only guaranteed with PNG-Images with size 32x32, containing only black, white, and transparent pixels. If the operation failed, -1 is returned. If an ID id is set, you can change the cursor shape of an already existing cursor (the file name is cached per ID, so the actual operation is only performed on the first call).
Reimplemented from SoViewerProxy.
|
virtual |
Evaluates the set cursor shape. This must be called after event handling traversal.
|
static |
This callback can be used together with a SoCallback node, userData must be set to the pointer to this (or a derived) proxy. This need to be called after before event traversal. It calls the virtual evaluateCursor() method, which should be overwritten in specialized proxies, e.g., for remote rendering.
|
static |
defineCursor simply calls this method, which will overwrite previous shapes.
|
overridevirtual |
Returns the current cursor position relative to the viewing window. Returns true if the position is inside of the viewing window.
Reimplemented from SoViewerProxy.
|
inline |
Returns the requested cursor shape.
Definition at line 76 of file SoQtViewerProxy.h.
References _requestedShape.
|
static |
Returns the QCursor associated with the given shapeID.
|
static |
Returns the QPixmap associated with the given shapeID in 1x resolution.
|
static |
Returns the QPixmap associated with the given shapeID in 2x resolution.
|
static |
Returns the shape ID associated with the given cursor. It will return -1 if the cursor is not used for any shape ID. Note that if different shape IDs use the same cursor, the lowest shape ID will be returned.
|
overridevirtual |
Checks whether this shape has already been defined.
Reimplemented from SoViewerProxy.
|
static |
On some platforms, it may not be possible to initialize the default cursors at any time, so one may have to call this in advance.
|
overridevirtual |
Returns true if the viewer does the initial rendering after it became visible.
Reimplemented from SoViewerProxy.
|
static |
Compares cursor shapes.
|
overridevirtual |
Returns whether a user interaction event is the the GUI event queue.
Reimplemented from SoViewerProxy.
|
virtual |
Resets the stored cursor shape. This must be called before event handling traversal.
The methods resetCursor and evaluateCursor must be called before and after traversal of the scene graph: The underlying idea is to only set the cursor if it has been set during event traversal, and only to the last shape (if it has been set more than once). This way, the cursor change can only be executed after the traversal and must be prepared by resetting the cursor shape before the traversal.
|
static |
This callback can be used together with a SoCallback node, userData must be set to the pointer to this (or a derived) proxy. This need to be called before event traversal.
|
overridevirtual |
Sets the cursor of the viewer to pre- or user-defined shape. Invalid positive values will set cursor to default shape, negative values will do nothing.
Reimplemented from SoViewerProxy.
|
overridevirtual |
Enforces the setting the cursor, even from mouseOverUpdates. This may lead to cursor flickering. You should probably not use this function!
Reimplemented from SoViewerProxy.
|
protected |
Cursor setting was enforced.
Definition at line 169 of file SoQtViewerProxy.h.
|
protected |
Pointer to the actual viewer.
Definition at line 163 of file SoQtViewerProxy.h.
|
protected |
Currently requested cursor shape.
Definition at line 166 of file SoQtViewerProxy.h.
Referenced by getCursor().