MeVisLab Toolbox Reference
SoViewerProxy Class Reference

This class gives access to state of a viewer during scene graph traversal. More...

#include <SoViewerProxy.h>

Inheritance diagram for SoViewerProxy:
SoResolutionIndependentViewerProxy

Public Types

enum  cursorShapeEnum {
  UNDEFINED_CURSOR = -1 , DEFAULT_CURSOR = 0 , FORBIDDEN_CURSOR , POINTING_HAND_CURSOR ,
  OPEN_HAND_CURSOR , CLOSED_HAND_CURSOR , MOVE_ALL_CURSOR , MOVE_HORI_CURSOR ,
  MOVE_VERT_CURSOR , MOVE_FDIAG_CURSOR , MOVE_BDIAG_CURSOR , MOVE_INOUT_CURSOR ,
  ROTATE_X_CURSOR , ROTATE_Y_CURSOR , ROTATE_Z_CURSOR , ROTATE_XY_CURSOR ,
  ZOOM_CURSOR , ZOOM_IN_CURSOR , ZOOM_OUT_CURSOR , CROSS_CURSOR ,
  CROSS_PLUS_CURSOR , CROSS_MINUS_CURSOR , CROSS_MOVE_CURSOR , CROSS_ROTATE_CURSOR ,
  CROSS_RECT_CURSOR , CROSS_OVAL_CURSOR , CROSS_VECTOR_CURSOR , CROSS_FREEFORM_CURSOR ,
  CROSS_POINT_CURSOR , CROSS_LINE_CURSOR , CROSS_CURVE_CURSOR , CROSS_POLYLINE_CURSOR ,
  CROSS_POLYGON_CURSOR , CROSS_FILL_CURSOR , CROSS_LINK_CURSOR , CROSS_0_CURSOR ,
  CROSS_1_CURSOR , CROSS_2_CURSOR , CROSS_3_CURSOR , CROSS_4_CURSOR ,
  CROSS_5_CURSOR , CROSS_6_CURSOR , CROSS_7_CURSOR , CROSS_8_CURSOR ,
  CROSS_9_CURSOR , LUT_CURSOR , LUT_1_CURSOR , LUT_2_CURSOR ,
  LUT_3_CURSOR , SLICING_CURSOR , BLANK_CURSOR , OTHER_CURSOR_0 ,
  OTHER_CURSOR_1 , OTHER_CURSOR_2 , OTHER_CURSOR_3 , OTHER_CURSOR_4 ,
  OTHER_CURSOR_5 , OTHER_CURSOR_6 , OTHER_CURSOR_7 , OTHER_CURSOR_8 ,
  OTHER_CURSOR_9 , OTHER_CURSOR_10 , OTHER_CURSOR_11 , OTHER_CURSOR_12 ,
  OTHER_CURSOR_13 , OTHER_CURSOR_14 , OTHER_CURSOR_15 , OTHER_CURSOR_16 ,
  OTHER_CURSOR_17 , OTHER_CURSOR_18 , OTHER_CURSOR_19 , OTHER_CURSOR_20 ,
  OTHER_CURSOR_21 , OTHER_CURSOR_22 , OTHER_CURSOR_23 , OTHER_CURSOR_24 ,
  OTHER_CURSOR_25 , OTHER_CURSOR_26 , OTHER_CURSOR_27 , OTHER_CURSOR_28 ,
  OTHER_CURSOR_29 , OTHER_CURSOR_30 , OTHER_CURSOR_31 , OTHER_CURSOR_32 ,
  OTHER_CURSOR_33 , OTHER_CURSOR_34 , OTHER_CURSOR_35 , OTHER_CURSOR_36 ,
  OTHER_CURSOR_37 , OTHER_CURSOR_38 , OTHER_CURSOR_39 , OTHER_CURSOR_40 ,
  OTHER_CURSOR_41 , OTHER_CURSOR_42 , OTHER_CURSOR_43 , OTHER_CURSOR_44 ,
  OTHER_CURSOR_45 , OTHER_CURSOR_46 , OTHER_CURSOR_47 , OTHER_CURSOR_48 ,
  OTHER_CURSOR_49 , OTHER_CURSOR_50 , OTHER_CURSOR_51 , OTHER_CURSOR_52 ,
  OTHER_CURSOR_53 , OTHER_CURSOR_54 , OTHER_CURSOR_55 , OTHER_CURSOR_56 ,
  OTHER_CURSOR_57 , OTHER_CURSOR_58 , OTHER_CURSOR_59 , OTHER_CURSOR_60 ,
  OTHER_CURSOR_61 , OTHER_CURSOR_62 , OTHER_CURSOR_63 , OTHER_CURSOR_64 ,
  OTHER_CURSOR_65 , OTHER_CURSOR_66 , OTHER_CURSOR_67 , OTHER_CURSOR_68 ,
  OTHER_CURSOR_69 , PREDEFINED_CURSOR_COUNT
}
 pre-defined cursor shapes; note that you must adapt the list of names in SoViewerProxy.cpp if you change this list More...
 

Public Member Functions

virtual ~SoViewerProxy ()
 Destructor.
 
virtual void setCursor (int)
 Set cursor of viewer to pre- or user-defined shape, invalid values will set cursor to default shape.
 
virtual bool hasShape (int shapeID)
 return true if the cursor shape has already been defined
 
virtual int defineCursor (const char *, int=-1, int=-1, int=-1)
 Define new cursor shape - successful operation is only guaranteed with PNG-Images with size 32x32, containing only black, white and transparent pixels.
 
virtual bool getCurrentCursorPosition (int &x, int &y)
 Get current cursor position relative to the viewing window.
 
virtual bool isInitialRendering () const
 returns true if the viewer does the initial rendering after it became visible
 
virtual bool isHighQualityOffscreenRendering () const
 returns true if high quality offscreen rendering (e.g. for OffscreenRenderer) is desired
 
virtual bool isUserInterationEventInQueue () const
 returns if a user interaction event is the the GUI event queue (or in a remote rendering scenario in the incoming message queue).
 
virtual SoMetaInformationMapgetMetaInformationMap ()
 returns the current SoMetaInformationMap, which allows storing of the current meta information / render state as key/value pairs.
 
virtual double getDevicePixelRatio ()
 Returns the ratio between physical pixels and device-independent pixels for the viewer.
 
virtual void setForceCursor (int shapeID)
 Enforce setting the cursor, even from mouseOverUpdates.
 

Static Public Member Functions

static const char *constcursorShapeNames ()
 return list of strings containing cursor shape names; this includes UNDEFINED_CURSOR, so you must add 1 when indexing this array
 
static int getPredefinedCursorCount ()
 get number of predefined cursors from code (instead of requiring a re-compilation of all using libraries when using the value PREDEFINED_CURSOR_COUNT)
 
static const ml::EnumValues< cursorShapeEnum > & getCursorShapeEnumValues ()
 get enum values record for use with ml::TypedEnumField
 
static int getNextFreeShapeID ()
 return the next free id for defining your own cursor shape
 

Protected Member Functions

 SoViewerProxy ()
 Protected constructor. Class must be derived to be adapted to actual viewer.
 

Detailed Description

This class gives access to state of a viewer during scene graph traversal.

Currently implemented is setting of cursor shapes and defining own cursor shapes.

Definition at line 29 of file SoViewerProxy.h.

Member Enumeration Documentation

◆ cursorShapeEnum

pre-defined cursor shapes; note that you must adapt the list of names in SoViewerProxy.cpp if you change this list

Enumerator
UNDEFINED_CURSOR 
DEFAULT_CURSOR 
FORBIDDEN_CURSOR 
POINTING_HAND_CURSOR 
OPEN_HAND_CURSOR 
CLOSED_HAND_CURSOR 
MOVE_ALL_CURSOR 
MOVE_HORI_CURSOR 
MOVE_VERT_CURSOR 
MOVE_FDIAG_CURSOR 
MOVE_BDIAG_CURSOR 
MOVE_INOUT_CURSOR 
ROTATE_X_CURSOR 
ROTATE_Y_CURSOR 
ROTATE_Z_CURSOR 
ROTATE_XY_CURSOR 
ZOOM_CURSOR 
ZOOM_IN_CURSOR 
ZOOM_OUT_CURSOR 
CROSS_CURSOR 
CROSS_PLUS_CURSOR 
CROSS_MINUS_CURSOR 
CROSS_MOVE_CURSOR 
CROSS_ROTATE_CURSOR 
CROSS_RECT_CURSOR 
CROSS_OVAL_CURSOR 
CROSS_VECTOR_CURSOR 
CROSS_FREEFORM_CURSOR 
CROSS_POINT_CURSOR 
CROSS_LINE_CURSOR 
CROSS_CURVE_CURSOR 
CROSS_POLYLINE_CURSOR 
CROSS_POLYGON_CURSOR 
CROSS_FILL_CURSOR 
CROSS_LINK_CURSOR 
CROSS_0_CURSOR 
CROSS_1_CURSOR 
CROSS_2_CURSOR 
CROSS_3_CURSOR 
CROSS_4_CURSOR 
CROSS_5_CURSOR 
CROSS_6_CURSOR 
CROSS_7_CURSOR 
CROSS_8_CURSOR 
CROSS_9_CURSOR 
LUT_CURSOR 
LUT_1_CURSOR 
LUT_2_CURSOR 
LUT_3_CURSOR 
SLICING_CURSOR 
BLANK_CURSOR 
OTHER_CURSOR_0 
OTHER_CURSOR_1 
OTHER_CURSOR_2 
OTHER_CURSOR_3 
OTHER_CURSOR_4 
OTHER_CURSOR_5 
OTHER_CURSOR_6 
OTHER_CURSOR_7 
OTHER_CURSOR_8 
OTHER_CURSOR_9 
OTHER_CURSOR_10 
OTHER_CURSOR_11 
OTHER_CURSOR_12 
OTHER_CURSOR_13 
OTHER_CURSOR_14 
OTHER_CURSOR_15 
OTHER_CURSOR_16 
OTHER_CURSOR_17 
OTHER_CURSOR_18 
OTHER_CURSOR_19 
OTHER_CURSOR_20 
OTHER_CURSOR_21 
OTHER_CURSOR_22 
OTHER_CURSOR_23 
OTHER_CURSOR_24 
OTHER_CURSOR_25 
OTHER_CURSOR_26 
OTHER_CURSOR_27 
OTHER_CURSOR_28 
OTHER_CURSOR_29 
OTHER_CURSOR_30 
OTHER_CURSOR_31 
OTHER_CURSOR_32 
OTHER_CURSOR_33 
OTHER_CURSOR_34 
OTHER_CURSOR_35 
OTHER_CURSOR_36 
OTHER_CURSOR_37 
OTHER_CURSOR_38 
OTHER_CURSOR_39 
OTHER_CURSOR_40 
OTHER_CURSOR_41 
OTHER_CURSOR_42 
OTHER_CURSOR_43 
OTHER_CURSOR_44 
OTHER_CURSOR_45 
OTHER_CURSOR_46 
OTHER_CURSOR_47 
OTHER_CURSOR_48 
OTHER_CURSOR_49 
OTHER_CURSOR_50 
OTHER_CURSOR_51 
OTHER_CURSOR_52 
OTHER_CURSOR_53 
OTHER_CURSOR_54 
OTHER_CURSOR_55 
OTHER_CURSOR_56 
OTHER_CURSOR_57 
OTHER_CURSOR_58 
OTHER_CURSOR_59 
OTHER_CURSOR_60 
OTHER_CURSOR_61 
OTHER_CURSOR_62 
OTHER_CURSOR_63 
OTHER_CURSOR_64 
OTHER_CURSOR_65 
OTHER_CURSOR_66 
OTHER_CURSOR_67 
OTHER_CURSOR_68 
OTHER_CURSOR_69 
PREDEFINED_CURSOR_COUNT 

Definition at line 37 of file SoViewerProxy.h.

Constructor & Destructor Documentation

◆ ~SoViewerProxy()

virtual SoViewerProxy::~SoViewerProxy ( )
inlinevirtual

Destructor.

Definition at line 33 of file SoViewerProxy.h.

◆ SoViewerProxy()

SoViewerProxy::SoViewerProxy ( )
inlineprotected

Protected constructor. Class must be derived to be adapted to actual viewer.

Definition at line 229 of file SoViewerProxy.h.

Member Function Documentation

◆ cursorShapeNames()

static const char *const * SoViewerProxy::cursorShapeNames ( )
static

return list of strings containing cursor shape names; this includes UNDEFINED_CURSOR, so you must add 1 when indexing this array

◆ defineCursor()

virtual int SoViewerProxy::defineCursor ( const char * ,
int = -1,
int = -1,
int = -1 )
inlinevirtual

Define 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, otherwise the shape id. The filename should be UTF8 encoded.

[Remark: Since in principle viewers of different systems can be mixed, one should

  • in principle - get first a free id that is guaranteed to work across systems by calling getNextFreeShapeID, and before any call to setCursor check if hasShape returns true and if not call defineCursor with the acquired cursor shape id. But if you are sure that viewers are not mixed, simply call defineCursor with an id of -1. Or stick to the pre-defined shapes. Also see below for code fragments...]

(N.B.: In MeVisLab there is an easy way to override the pre-defined cursor shapes. Look into SoQtViewerProxy.h in MLInventorGUIBinding for instructions.)

Definition at line 197 of file SoViewerProxy.h.

◆ getCurrentCursorPosition()

virtual bool SoViewerProxy::getCurrentCursorPosition ( int & x,
int & y )
virtual

Get current cursor position relative to the viewing window.

Returns true if the position is inside of the viewing window.

◆ getCursorShapeEnumValues()

static const ml::EnumValues< cursorShapeEnum > & SoViewerProxy::getCursorShapeEnumValues ( )
static

get enum values record for use with ml::TypedEnumField

◆ getMetaInformationMap()

virtual SoMetaInformationMap * SoViewerProxy::getMetaInformationMap ( )
inlinevirtual

returns the current SoMetaInformationMap, which allows storing of the current meta information / render state as key/value pairs.

You need to check for a NULL pointer, since a valid pointer is only available in special scenarios (e.g. in remote rendering)

Definition at line 217 of file SoViewerProxy.h.

◆ getNextFreeShapeID()

static int SoViewerProxy::getNextFreeShapeID ( )
static

return the next free id for defining your own cursor shape

◆ getPredefinedCursorCount()

static int SoViewerProxy::getPredefinedCursorCount ( )
static

get number of predefined cursors from code (instead of requiring a re-compilation of all using libraries when using the value PREDEFINED_CURSOR_COUNT)

◆ hasShape()

virtual bool SoViewerProxy::hasShape ( int shapeID)
virtual

return true if the cursor shape has already been defined

◆ isHighQualityOffscreenRendering()

virtual bool SoViewerProxy::isHighQualityOffscreenRendering ( ) const
inlinevirtual

returns true if high quality offscreen rendering (e.g. for OffscreenRenderer) is desired

Definition at line 208 of file SoViewerProxy.h.

◆ isInitialRendering()

virtual bool SoViewerProxy::isInitialRendering ( ) const
inlinevirtual

returns true if the viewer does the initial rendering after it became visible

Definition at line 205 of file SoViewerProxy.h.

◆ isUserInterationEventInQueue()

virtual bool SoViewerProxy::isUserInterationEventInQueue ( ) const
inlinevirtual

returns if a user interaction event is the the GUI event queue (or in a remote rendering scenario in the incoming message queue).

Definition at line 212 of file SoViewerProxy.h.

◆ setCursor()

virtual void SoViewerProxy::setCursor ( int )
inlinevirtual

Set cursor of viewer to pre- or user-defined shape, invalid values will set cursor to default shape.

This only works from event handling routines.

Definition at line 175 of file SoViewerProxy.h.

◆ setForceCursor()

virtual void SoViewerProxy::setForceCursor ( int shapeID)
inlinevirtual

Enforce setting the cursor, even from mouseOverUpdates.

This may lead to cursor flickering. You should probably not use this function!

Definition at line 225 of file SoViewerProxy.h.

References mlrange_cast().


The documentation for this class was generated from the following file: