[vtkusers] Change mouse cursor while hovering on vtkSphereWidget

Alok alok.theanomaly at gmail.com
Fri Oct 10 09:53:02 EDT 2014


Thanks Cory
I dont have experience with subclassing vtk classes yet. Is there any other
class that you can suggest as a reference to look at while going about this?



On Thu, Oct 9, 2014 at 5:13 PM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> I think you will have to subclass vtkSphereWidget2 and override the
> SetCursor() method. The SetCursor() method for vtkHandleWidget is
>
> //-------------------------------------------------------------------------
> void vtkHandleWidget::SetCursor(int cState)
> {
>   if ( this->ManagesCursor )
>     {
>     switch (cState)
>       {
>       case vtkHandleRepresentation::Outside:
>         this->RequestCursorShape(VTK_CURSOR_DEFAULT);
>         break;
>       default:
>         this->RequestCursorShape(VTK_CURSOR_HAND);
>       }
>     }
> }
>
> I imagine you would want the same in your subclass.
>
> HTH,
> Cory
>
> On Thu, Oct 9, 2014 at 5:03 PM, junior <alok.theanomaly at gmail.com> wrote:
> > Hi,
> >
> > I want the mouse cursor to change to a 'hand' when the mouse is hovering
> > over a vtkSphereWidget.
> > Is there any out of box solution for this or do I need to subclass? I
> tried
> > using vtkSphereWidget2 and setting ManagesCursorOn() to true but that did
> > not help.
> >
> > I see that the vtkAngleWidget exhibits the said behavior when mouse
> hovers
> > above one of the three control points which in my understanding are
> > vtkHandleWidgets.
> >
> > Any suggestions??
> > Thanks
> >
> >
> >
> > --
> > View this message in context:
> http://vtk.1045678.n5.nabble.com/Change-mouse-cursor-while-hovering-on-vtkSphereWidget-tp5729100.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
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
I live a simple life...  in 0s and 1s !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141010/f2c942ff/attachment.html>


More information about the vtkusers mailing list