MeVisLabToolboxReference
SoViewerProxy Class Reference

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

#include <SoViewerProxy.h>

List of all members.

Public Types

enum  {
  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, 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 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).

Static Public Member Functions

static const char *const cursorShapeNames ()
 return list of strings containing cursor shape names; this includes UNDEFINED_CURSOR, so you must add 1 when indexing this array
static int getNextFreeShapeID ()
 return the next free id for defining your own cursor shape

Public Attributes

enum SoViewerProxy:: { ... }  cursorShapeEnum

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 20 of file SoViewerProxy.h.


Member Enumeration Documentation

anonymous enum

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 
PREDEFINED_CURSOR_COUNT 

Definition at line 28 of file SoViewerProxy.h.


Constructor & Destructor Documentation

virtual SoViewerProxy::~SoViewerProxy ( ) [inline, virtual]

Destructor.

Definition at line 24 of file SoViewerProxy.h.

SoViewerProxy::SoViewerProxy ( ) [inline, protected]

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

Definition at line 123 of file SoViewerProxy.h.


Member Function Documentation

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

virtual int SoViewerProxy::defineCursor ( const char *  ,
int  = -1,
int  = -1,
int  = -1 
) [inline, virtual]

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. [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 misc/inventorGUIWrapper for instructions.)

Definition at line 107 of file SoViewerProxy.h.

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.

static int SoViewerProxy::getNextFreeShapeID ( ) [static]

return the next free id for defining your own cursor shape

virtual bool SoViewerProxy::hasShape ( int  shapeID) [virtual]

return true if the cursor shape has already been defined

virtual bool SoViewerProxy::isInitialRendering ( ) const [inline, virtual]

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

Definition at line 115 of file SoViewerProxy.h.

virtual bool SoViewerProxy::isUserInterationEventInQueue ( ) const [inline, virtual]

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 119 of file SoViewerProxy.h.

virtual void SoViewerProxy::setCursor ( int  ) [inline, virtual]

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 88 of file SoViewerProxy.h.


Member Data Documentation


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