| java.lang.Object com.sun.j3d.utils.picking.PickTool com.sun.j3d.utils.picking.PickCanvas
PickCanvas | public class PickCanvas extends PickTool (Code) | | A subclass of PickTool, simplifies picking using mouse events from a canvas.
This class allows picking using canvas x,y locations by generating the
appropriate pick shape.
The pick tolerance specifies the distance from the
pick center to include in the pick shape. A tolerance of 0.0 may speedup
picking slightly, but also make it very difficult to pick points and lines.
The pick canvas can be used to make a series of picks. For example, to
initialize the pick canvas:
PickCanvas pickCanvas = new PickCanvas(canvas, scene);
pickCanvas.setMode(PickTool.GEOMETRY_INTERSECT_INFO);
pickCanvas.setTolerance(4.0f);
Then for each mouse event:
pickCanvas.setShapeLocation(mouseEvent);
PickResult[] results = pickCanvas.pickAll();
NOTE: For the pickAllSorted or pickClosest methods, the picks will be sorted
by the distance from the ViewPlatform to the intersection point.
See Also: PickTool |
tolerance | float tolerance(Code) | | |
PickCanvas | public PickCanvas(Canvas3D c, BranchGroup b)(Code) | | Constructor with Canvas3D for mouse events and BranchGroup to be picked.
|
PickCanvas | public PickCanvas(Canvas3D c, Locale l)(Code) | | Constructor with Canvas3D for mouse events and Locale to be picked.
|
getCanvas | public Canvas3D getCanvas()(Code) | | Inquire the canvas to be used for picking operations.
the canvas. |
getTolerance | public float getTolerance()(Code) | | Get the pick tolerance.
|
setShapeLocation | public void setShapeLocation(MouseEvent mevent)(Code) | | Set the pick location. Defines the location on the canvas where the
pick is to be performed.
Parameters: mevent - The MouseEvent for the picking point |
setShapeLocation | public void setShapeLocation(int xpos, int ypos)(Code) | | Set the pick location. Defines the location on the canvas where the
pick is to be performed (upper left corner of canvas is 0,0).
Parameters: xpos - the X position of the picking point Parameters: ypos - the Y position of the picking point |
setTolerance | public void setTolerance(float t)(Code) | | Set the picking tolerance. Objects within this distance
(in pixels)
to the mouse x,y location will be picked. The default tolerance is 2.0.
Parameters: t - The tolerance exception: IllegalArgumentException - if the tolerance is less than 0. |
Methods inherited from com.sun.j3d.utils.picking.PickTool | public BranchGroup getBranchGroup()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public int getMode()(Code)(Java Doc) public PickShape getPickShape()(Code)(Java Doc) public Point3d getStartPosition()(Code)(Java Doc) public PickResult[] pickAll()(Code)(Java Doc) public PickResult[] pickAllSorted()(Code)(Java Doc) public PickResult pickAny()(Code)(Java Doc) public PickResult pickClosest()(Code)(Java Doc) public Locale setBranchGroup(Locale l)(Code)(Java Doc) public static void setCapabilities(Node node, int level)(Code)(Java Doc) public void setMode(int mode)(Code)(Java Doc) public void setShape(PickShape ps, Point3d startPt)(Code)(Java Doc) public void setShapeBounds(Bounds bounds, Point3d startPt)(Code)(Java Doc) public void setShapeConeRay(Point3d start, Vector3d dir, double angle)(Code)(Java Doc) public void setShapeConeSegment(Point3d start, Point3d end, double angle)(Code)(Java Doc) public void setShapeCylinderRay(Point3d start, Vector3d dir, double radius)(Code)(Java Doc) public void setShapeCylinderSegment(Point3d start, Point3d end, double radius)(Code)(Java Doc) public void setShapeRay(Point3d start, Vector3d dir)(Code)(Java Doc) public void setShapeSegment(Point3d start, Point3d end)(Code)(Java Doc)
|
|
|