[vtkusers] How to show vtkSphereWidget?

Amy Henderson amy.henderson at kitware.com
Wed Nov 5 10:29:52 EST 2003


At 04:25 PM 11/5/2003 +0100, jiang wrote:
>Dear VTK users,
>I want to show a sphere with some other object in one window. And the sphere
>could be moved by drag and move mouse click. So I use vtkSphereWidget to
>realize it. However, it doesn't appear on the screen. The following is my
>code:
>
>vtkSphereWidget* Marker = vtkSphereWidget::New();
>         Marker->SetInteractor( iren);
>         Marker->SetProp3D(volume);//volume is one object that I want to show
>together with the sphere
>         Marker->SetPlaceFactor( 4);
>         Marker->PlaceWidget();
>         Marker->TranslationOn();
>         Marker->ScaleOff();
>         Marker->HandleVisibilityOn();

Add the following line:

Marker->SetEnabled(1);

This will set up the appropriate callbacks and make the widget visible.

- Amy

>I even add the below two lines again. But the sphere still doesn't exist.
>         renWin->show();
>         iren->Start();
>
>Who can tell me what's wrong with my code?
>Thank you very much!
>
>
>Chunyan
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list