[vtkusers] cursor management

Karthik Krishnan karthik.krishnan at kitware.com
Tue May 11 03:22:53 EDT 2010


This is great.. I'm sure custom cursors would be very useful. If your cursor
isn't supported in the default list of cursors (for instance for unix
(xfree86/xorg), here is a typical list that can be added to the
corresponding render windows (vtkXOpenGLRenderWindow etc).

  http://tronche.com/gui/x/xlib/appendix/b/

The niche ones like a Rotate cursor etc aren't available. I took a cursory
(laughing) look at how OpenInventor does this.. As you know they have a
rotate cursor for the roll action (search for so_xt_roll_bits to get the
bitmap). The bitmaps for the cursors (see SoXtCursor) and allow custom
bitmaps..

See the OpenInventor chapter "Using cursors for feedback" on how to set
these custom bitmaps..


http://docs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0530/bks/SGI_Developer/books/Inventor_TM/sgi_html/ch10.html#id11605


// This routine is used to define cursors..
void simpleViewer::defineCursors()
{
   XColor foreground;
   Pixmap source;

   ...

   // View plane translate cursor
   source = XCreateBitmapFromData(display, d,
            so_xt_flat_hand_bits, so_xt_flat_hand_width,
            so_xt_flat_hand_height);
   vwrCursor = XCreatePixmapCursor(display, source, source,
               &foreground, &foreground, so_xt_flat_hand_x_hot,
               so_xt_flat_hand_y_hot);
   XFreePixmap(display, source);

   // Seek cursor
   source = XCreateBitmapFromData(display, d,
            so_xt_target_bits, so_xt_target_width,
            so_xt_target_height);
   seekCursor = XCreatePixmapCursor(display, source, source,
                &foreground, &foreground, so_xt_target_x_hot,
                so_xt_target_y_hot);
   XFreePixmap(display, source);

   createdCursors = TRUE;
}


It would be great to add this kind of functionality to expand VTK's cursor
management.



On Mon, May 3, 2010 at 12:08 PM, Dean Inglis <dean.inglis at camris.ca> wrote:

> I have an application in which Id like to have
> a cursor to indicate rotation is occuring during widget interaction,
> however,
> VTK is limited to a basic set of cursors which does
> not include such a cursor.  Im guessing
> this is to maintain cross-platform compatibility.
> Anyone have any experience coding a custom
> cursor they could share (Windows or any other
> platform)?
> thanks,
> Dean
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100511/81598c82/attachment.htm>


More information about the vtkusers mailing list