[vtkusers] cant resize / move / rescale vtkBoxWidget

James Potota tr_jun-jiang.ee at vitrox.com
Sat Aug 1 16:42:05 EDT 2015


Hi. I wan to clip volume in my Java program. I used boxWidget to control what
volume will be rendered. However I cant resize, move or rescale the
boxWidget at all. The following is my code snipplet. 

   /protected void clipping() {
            renderWindowInteractor = new vtkRenderWindowInteractor();
           
renderWindowInteractor.SetRenderWindow(renWin.GetRenderWindow());
            boxWidget = new vtkBoxWidget();
            boxWidget.SetInteractor(renderWindowInteractor);
            boxWidget.SetPlaceFactor(1.25);
            boxWidget.SetProp3D(volume);
            boxWidget.InsideOutOn();
            boxWidget.PlaceWidget();
            boxWidget.On(); // press "i" to turn off / on
            boxWidget.AddObserver("InteractionEvent", this,
"executeClipping");
        
            boxWidget.EnabledOn();
            renWin.Render();

            Thread t2;
            t2 = new Thread("vtkRenderWindowInteractor for volume clipping")
{
                public void run() {
                    renderWindowInteractor.Start();
                }
            };
            t2.start();
        }

        public void executeClipping(){
            planes = new vtkPlanes();
            boxWidget.GetPlanes(planes);
            volumeMapper.SetClippingPlanes(planes);
            planes.Delete();
        }/

This might be a stupid but I've tried for hours and frustrated. Can anyone
please point out my mistake ? Thanks.



--
View this message in context: http://vtk.1045678.n5.nabble.com/cant-resize-move-rescale-vtkBoxWidget-tp5733216.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list