AW: [vtkusers] How to show vtkSphereWidget?

jiang jiang at TI.Uni-Trier.DE
Wed Nov 5 10:47:05 EST 2003


Hi Amy,
Thank you very much! It is visible now. I have another question: why are
there two sphere? One sphere is a big line frame, the other one is a solid
sphere that lies on the frame sphere.
I want to show the solid sphere alone without line frame. Is it possible?
And may I change the color of the solid sphere?

Thanks again.

Chunyan

-----Ursprungliche Nachricht-----
Von: Amy Henderson [mailto:amy.henderson at kitware.com]
Gesendet: Mittwoch, 5. November 2003 16:30
An: jiang; VTK
Betreff: Re: [vtkusers] How to show vtkSphereWidget?


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