Custom cursor shapes

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom cursor shapes

Enzo Matsumiya-3
Hello,

Is there any way to add custom cursors?
I'm already using VTK_CURSOR_CROSSHAIR and VTK_CURSOR_HAND, but now I'm implementing zoom and rotate functionality to my app and I would like to use some shapes that represents those better.


Thanks in advance!
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

David Gobbi
Hi Enzo,

For custom cursor shapes, you'd have to rely on a GUI toolkit like Qt.  VTK can't load custom cursors on its own.

 - David

On Tue, Jun 28, 2016 at 1:02 PM, Enzo Matsumiya <[hidden email]> wrote:
Hello,

Is there any way to add custom cursors?
I'm already using VTK_CURSOR_CROSSHAIR and VTK_CURSOR_HAND, but now I'm implementing zoom and rotate functionality to my app and I would like to use some shapes that represents those better.

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

-Daniel-
Hi Enzo,

I'm using Java, where I added my own cursor as follows:
Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(
     CursorImageAsGIF, new Point(10,10), "Cursorname" );
myVTKPanel.setCursor(c);

Maybe it helps you...
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

Enzo Matsumiya-3
David, I am using Qt.
Daniel, what type is your myVTKPanel?

I have my visualization stack as a separate dynamic library. When I set the cursor on the application's mainwindow,
it works fine, but the cursor will be the one I chose in every portion of the app.

I tried setting the cursor to my QVTKWidget (within my library) to create the "mouse over" feeling which, I think, should activate
such cursor only when within its bounds. But it didn't work.

Now I don't know if I should take it to Qt's side or if it's indeed within VTK.


Thanks!


On Jun 30, 2016, at 04:16, -Daniel- <[hidden email]> wrote:

Hi Enzo,

I'm using Java, where I added my own cursor as follows:
Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(
    CursorImageAsGIF, new Point(10,10), "Cursorname" );
myVTKPanel.setCursor(c);

Maybe it helps you...




--
View this message in context: http://vtk.1045678.n5.nabble.com/Custom-cursor-shapes-tp5738967p5739006.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

David Gobbi
On Thu, Jun 30, 2016 at 7:25 AM, Enzo Matsumiya <[hidden email]> wrote:

Now I don't know if I should take it to Qt's side or if it's indeed within VTK.

I've done it by simply calling setCursor() on the widget.  You will have to disable any VTK code that you used to use for setting the cursor.

 - David

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

Enzo Matsumiya-3
That didn't work.

The only code I modified was vtkResliceCursorWidget::SetCursor() to act according to my needs. I don't have any other direct calls to RequestCursorShape().
Now I commented the whole method body and widget's setCursor() still didn't work.


On Jun 30, 2016, at 10:59, David Gobbi <[hidden email]> wrote:

On Thu, Jun 30, 2016 at 7:25 AM, Enzo Matsumiya <[hidden email]> wrote:

Now I don't know if I should take it to Qt's side or if it's indeed within VTK.

I've done it by simply calling setCursor() on the widget.  You will have to disable any VTK code that you used to use for setting the cursor.

 - David


_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom cursor shapes

-Daniel-
In reply to this post by Enzo Matsumiya-3
Hello Enzo,
the type of myVTKPanel is a extended vtkCanvas.