| java.lang.Object com.sun.j3d.utils.pickfast.PickTool com.sun.j3d.utils.pickfast.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(PickInfo.PICK_GEOMETRY);
pickCanvas.setFlags(PickInfo.NODE | PickInfo.CLOSEST_INTERSECTION_POINT);
pickCanvas.setTolerance(4.0f);
Then for each mouse event:
pickCanvas.setShapeLocation(mouseEvent);
PickInfo[] pickInfos = 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.pickfast.PickTool | public BranchGroup getBranchGroup()(Code)(Java Doc) public int getFlags()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public int getMode()(Code)(Java Doc) public Node getNode(PickInfo pickInfo, int type)(Code)(Java Doc) public PickShape getPickShape()(Code)(Java Doc) public Point3d getStartPosition()(Code)(Java Doc) public PickInfo[] pickAll()(Code)(Java Doc) public PickInfo[] pickAllSorted()(Code)(Java Doc) public PickInfo pickAny()(Code)(Java Doc) public PickInfo pickClosest()(Code)(Java Doc) public void setFlags(int flags)(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)
|
|
|