Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
SoWinCursor Class Reference

The SoWinCursor class is used to set cursors for GUI components. More...


class  CustomCursor
 The SoWinCursor::CustomCursor class is used to specify bitmap data for SoWinCursor custom cursors. More...

Public Types

enum  Shape {

Public Member Functions

 SoWinCursor (void)
 SoWinCursor (const Shape shape)
 SoWinCursor (const CustomCursor *cc)
 SoWinCursor (const SoWinCursor &cursor)
 ~SoWinCursor ()
SoWinCursoroperator= (const SoWinCursor &c)
Shape getShape (void) const
void setShape (const Shape shape)
const CustomCursorgetCustomCursor (void) const

Static Public Member Functions

static void initClass (void)
static const SoWinCursorgetZoomCursor (void)
static const SoWinCursorgetPanCursor (void)
static const SoWinCursorgetRotateCursor (void)
static const SoWinCursorgetBlankCursor (void)

Detailed Description

The SoWinCursor class is used to set cursors for GUI components.

The class provides both a set of predefined cursor shapes, as well as the option to use custom bitmap graphics.

Instances of this class is usually made for passing in to the SoWinComponent::setComponentCursor() and SoWinComponent::setWidgetCursor() methods.

Member Enumeration Documentation

◆ Shape

For enumerating built-in shape types, that can be used without having to specify cursor graphics. These are mapped to predefined cursor shapes from the underlying toolkit.


Cursor is specified with our own bitmap graphics. The bitmap data must be passed to the constructor.


Using the native Window system's default cursor.


A busy cursor.


Two thin lines in a cross.


Thick, upward-pointing arrow.

Constructor & Destructor Documentation

◆ SoWinCursor() [1/4]

SoWinCursor::SoWinCursor ( void  )

Default constructor. Creates a default cursor.

◆ SoWinCursor() [2/4]

SoWinCursor::SoWinCursor ( const Shape  shape)

Constructor with Shape argument, for setting up the cursor with a predefined shape from the underlying native toolkit.

◆ SoWinCursor() [3/4]

SoWinCursor::SoWinCursor ( const CustomCursor ccarg)

Constructs a new custom bitmap cursor from cc.

Note that only a shallow copy will be made of the CustomCursor bitmap and mask references, so don't deallocate the memory they use until the SoWinCursor has been destructed.

As for the format of the cursor bitmap data, see documentation of SoWinCursor::CustomCursor.

◆ SoWinCursor() [4/4]

SoWinCursor::SoWinCursor ( const SoWinCursor cursor)


◆ ~SoWinCursor()

SoWinCursor::~SoWinCursor ( )


Member Function Documentation

◆ operator=()

SoWinCursor & SoWinCursor::operator= ( const SoWinCursor c)

Assignment operator.

◆ getShape()

SoWinCursor::Shape SoWinCursor::getShape ( void  ) const

Returns the shape type.

If the cursor has been set by the application programmer to a bitmap cursor, SoWinCursor::CUSTOM_BITMAP is returned.

◆ setShape()

void SoWinCursor::setShape ( const Shape  shapearg)

Sets the cursor to a predefined shape.

◆ getCustomCursor()

const SoWinCursor::CustomCursor & SoWinCursor::getCustomCursor ( void  ) const

Returns a reference to the current custom bitmap cursor.

Do not call this method unless SoWinCursor::getShape() returns SoWinCursor::CUSTOM_BITMAP.

◆ getZoomCursor()

const SoWinCursor & SoWinCursor::getZoomCursor ( void  )

Returns a "zoom" indicator cursor.

◆ getPanCursor()

const SoWinCursor & SoWinCursor::getPanCursor ( void  )

Returns a cursor with "pan" graphics (i.e. for translation in the camera normal plane).

◆ getRotateCursor()

const SoWinCursor & SoWinCursor::getRotateCursor ( void  )

Returns a "rotate" indicator cursor.

◆ getBlankCursor()

const SoWinCursor & SoWinCursor::getBlankCursor ( void  )

Because not all toolkits do easily support setting up a blank cursor from predefined shapes or API functions, we also provide a simple completely transparent cursor.

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