[vtkusers] How to show vtkSphereWidget?

jiang jiang at TI.Uni-Trier.DE
Wed Nov 5 10:25:38 EST 2003


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();

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




More information about the vtkusers mailing list