[vtkusers] Using vtkAreaPicker from Java

kent myers dakota_63124 at yahoo.com
Sun Mar 20 19:48:55 EDT 2016


I am trying to use vtkAreaPicker from Java.  I based the code below on
examples I found.  If I type "r", this activates the rubberband selector,
but my callback is not called after drawing the selection rectangle and
releasing the mouse button. I have tried "CharEvent" and "InteractionEvent",
but neither works.

I would also like to know how to force the mouse selection to be immediately
active without typing "r".

Thanks for any help someone can provide.

Kent




	public void selectWindowMenuItemActionPerformed(ActionEvent evt) {
		// select any objects (even if obstructed)
		display.setVisibleSelection(false);
		
		vtkRenderWindowInteractor renderWindowInteractor =
renWin.getRenderWindowInteractor();
		vtkAreaPicker areaPicker = new vtkAreaPicker();
		renderWindowInteractor.SetPicker(areaPicker);
		
		vtkInteractorStyleRubberBandPick style = new
vtkInteractorStyleRubberBandPick();
		renderWindowInteractor.SetInteractorStyle(style);
		areaPicker.AddObserver("CharEvent",this,"areaPickCallback");
		renderWindowInteractor.Start();
	}

	public void areaPickCallback()
	{
		vtkAreaPicker areaPicker = (vtkAreaPicker)
renWin.getRenderWindowInteractor().GetPicker();
		vtkProp3DCollection props = areaPicker.GetProp3Ds();
		
		for(int i = 0; i < props.GetNumberOfItems(); i++)
		{
			vtkProp3D prop = props.GetNextProp3D();
		}
	}







--
View this message in context: http://vtk.1045678.n5.nabble.com/Using-vtkAreaPicker-from-Java-tp5737306.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list