| java.lang.Object com.sun.j3d.utils.pickfast.PickTool
All known Subclasses: com.sun.j3d.utils.pickfast.PickCanvas,
PickTool | public class PickTool (Code) | | The base class for optimized picking operations.
The picking methods will return a PickInfo object for each object picked,
which can then be queried to
obtain more detailed information about the specific objects that were
picked.
The pick mode specifies the detail level of picking before the PickInfo
is returned:
- PickInfo.PICK_BOUNDS - Pick using the only bounds of the pickable nodes.
- PickInfo.PICK_GEOMETRY will pick using the geometry of the pickable nodes.
Geometry nodes in the scene must have the ALLOW_INTERSECT capability set for
this mode.
The pick flags specifies the content of the PickInfo(s) returned by the
pick methods. This is specified as one or more individual bits that are
bitwise "OR"ed together to describe the PickInfo data. The flags include :
PickInfo.SCENEGRAPHPATH - request for computed SceneGraphPath.
PickInfo.NODE - request for computed intersected Node.
PickInfo.LOCAL_TO_VWORLD - request for computed local to virtual world transform.
PickInfo.CLOSEST_INTERSECTION_POINT - request for closest intersection point.
PickInfo.CLOSEST_DISTANCE - request for the distance of closest intersection.
PickInfo.CLOSEST_GEOM_INFO - request for only the closest intersection geometry information.
PickInfo.ALL_GEOM_INFO - request for all intersection geometry information.
When using pickAllSorted or pickClosest methods, the picks
will be sorted by the distance from the start point of the pick shape to
the intersection point.
See Also: Locale.pickClosest(intintjavax.media.j3d.PickShape) |
Field Summary | |
final public static int | TYPE_BRANCH_GROUP Flag to pass to
getNode(int)
to return a
BranchGroup node from
the SceneGraphPath . | final public static int | TYPE_GROUP Flag to pass to
getNode(int)
to return a
Group node from
the SceneGraphPath . | final public static int | TYPE_LINK Flag to pass to
getNode(int)
to return a
Link node from
the SceneGraphPath . | final public static int | TYPE_MORPH Flag to pass to
getNode(int)
to return a
Morph node from
the SceneGraphPath . | final public static int | TYPE_PRIMITIVE Flag to pass to
getNode(int)
to return a
Primitive node from
the SceneGraphPath . | final public static int | TYPE_SHAPE3D Flag to pass to
getNode(int)
to return a
Shape3D node from
the SceneGraphPath . | final public static int | TYPE_SWITCH Flag to pass to
getNode(int)
to return a
Switch node from
the SceneGraphPath . | final public static int | TYPE_TRANSFORM_GROUP Flag to pass to
getNode(int)
to return a
TransformGroup node from
the SceneGraphPath . | int | flags | int | mode | BranchGroup | pickRootBG | Locale | pickRootL | PickShape | pickShape | Point3d | start Used to store a reference point used in determining how "close" points
are. | protected boolean | userDefineShape |
Method Summary | |
public BranchGroup | getBranchGroup() Returns the BranchGroup to be picked if the tool was initialized
with a BranchGroup, null otherwise. | public int | getFlags() Gets the PickInfo content flags. | public Locale | getLocale() Returns the Locale to be picked if the tool was initialized with
a Locale, null otherwise. | public int | getMode() Gets the picking detail mode. | public Node | getNode(PickInfo pickInfo, int type) | public PickShape | getPickShape() Returns the PickShape for this object. | public Point3d | getStartPosition() Returns the start postion used for distance measurement. | public PickInfo[] | pickAll() Selects all the nodes that intersect the PickShape.
An array of PickInfo objects which will contain information about the picked instances. | public PickInfo[] | pickAllSorted() Select all the nodes that intersect the
PickShape, returned sorted. | public PickInfo | pickAny() Select one of the nodes that intersect the PickShape
A PickInfo object which will contain information about the picked instance. | public PickInfo | pickClosest() Select the closest node that
intersects the PickShape. | public void | setFlags(int flags) Sets the PickInfo content flags. | public void | setMode(int mode) Sets the picking detail mode. | public void | setShape(PickShape ps, Point3d startPt) | public void | setShapeBounds(Bounds bounds, Point3d startPt) | public void | setShapeConeRay(Point3d start, Vector3d dir, double angle) Sets the pick shape to an infinite PickCone. | public void | setShapeConeSegment(Point3d start, Point3d end, double angle) | public void | setShapeCylinderRay(Point3d start, Vector3d dir, double radius) Sets the pick shape to an infinite PickCylinder. | public void | setShapeCylinderSegment(Point3d start, Point3d end, double radius) | public void | setShapeRay(Point3d start, Vector3d dir) Sets the pick shape to a PickRay. | public void | setShapeSegment(Point3d start, Point3d end) Sets the pick shape to a PickSegment. |
TYPE_BRANCH_GROUP | final public static int TYPE_BRANCH_GROUP(Code) | | Flag to pass to
getNode(int)
to return a
BranchGroup node from
the SceneGraphPath .
|
TYPE_GROUP | final public static int TYPE_GROUP(Code) | | Flag to pass to
getNode(int)
to return a
Group node from
the SceneGraphPath .
|
TYPE_LINK | final public static int TYPE_LINK(Code) | | Flag to pass to
getNode(int)
to return a
Link node from
the SceneGraphPath .
|
TYPE_MORPH | final public static int TYPE_MORPH(Code) | | Flag to pass to
getNode(int)
to return a
Morph node from
the SceneGraphPath .
|
TYPE_PRIMITIVE | final public static int TYPE_PRIMITIVE(Code) | | Flag to pass to
getNode(int)
to return a
Primitive node from
the SceneGraphPath .
|
TYPE_SHAPE3D | final public static int TYPE_SHAPE3D(Code) | | Flag to pass to
getNode(int)
to return a
Shape3D node from
the SceneGraphPath .
|
TYPE_SWITCH | final public static int TYPE_SWITCH(Code) | | Flag to pass to
getNode(int)
to return a
Switch node from
the SceneGraphPath .
|
TYPE_TRANSFORM_GROUP | final public static int TYPE_TRANSFORM_GROUP(Code) | | Flag to pass to
getNode(int)
to return a
TransformGroup node from
the SceneGraphPath .
|
pickRootBG | BranchGroup pickRootBG(Code) | | Used to store the BranchGroup used for picking
|
pickRootL | Locale pickRootL(Code) | | Used to store the Locale used for picking
|
start | Point3d start(Code) | | Used to store a reference point used in determining how "close" points
are.
|
userDefineShape | protected boolean userDefineShape(Code) | | |
PickTool | public PickTool(BranchGroup b)(Code) | | Constructor with BranchGroup to be picked.
|
PickTool | public PickTool(Locale l)(Code) | | Constructor with the Locale to be picked.
|
getBranchGroup | public BranchGroup getBranchGroup()(Code) | | Returns the BranchGroup to be picked if the tool was initialized
with a BranchGroup, null otherwise.
|
getFlags | public int getFlags()(Code) | | Gets the PickInfo content flags.
|
getLocale | public Locale getLocale()(Code) | | Returns the Locale to be picked if the tool was initialized with
a Locale, null otherwise.
|
getMode | public int getMode()(Code) | | Gets the picking detail mode.
|
getNode | public Node getNode(PickInfo pickInfo, int type)(Code) | | Get the first node of a certain type up the SceneGraphPath
Parameters: type - the type of node we are interested in a Node object exception: NullPointerException - if pickInfo does not contain aScenegraphpath or a picked node |
getPickShape | public PickShape getPickShape()(Code) | | Returns the PickShape for this object.
|
getStartPosition | public Point3d getStartPosition()(Code) | | Returns the start postion used for distance measurement.
|
pickAll | public PickInfo[] pickAll()(Code) | | Selects all the nodes that intersect the PickShape.
An array of PickInfo objects which will contain information about the picked instances. null if nothing was picked. |
pickAllSorted | public PickInfo[] pickAllSorted()(Code) | | Select all the nodes that intersect the
PickShape, returned sorted. The "closest" object will be returned first.
See note above to see how "closest" is determined.
An array of PickInfo objects which will contain information about the picked instances. null if nothing was picked. |
pickAny | public PickInfo pickAny()(Code) | | Select one of the nodes that intersect the PickShape
A PickInfo object which will contain information about the picked instance. null if nothing was picked. |
pickClosest | public PickInfo pickClosest()(Code) | | Select the closest node that
intersects the PickShape. See note above to see how "closest" is
determined.
A PickInfo object which will contain information about the picked instance. null if nothing was picked. |
setFlags | public void setFlags(int flags)(Code) | | Sets the PickInfo content flags. The default is PickInfo.NODE.
Parameters: flags - specified as one or more individual bits that are bitwise "OR"ed together : PickInfo.SCENEGRAPHPATH - request for computed SceneGraphPath. PickInfo.NODE - request for computed intersected Node.
PickInfo.LOCAL_TO_VWORLD - request for computed local to virtual world transform.
PickInfo.CLOSEST_INTERSECTION_POINT - request for closest intersection point.
PickInfo.CLOSEST_DISTANCE - request for the distance of closest intersection.
PickInfo.CLOSEST_GEOM_INFO - request for only the closest intersection geometry information.
PickInfo.ALL_GEOM_INFO - request for all intersection geometry information.
exception: IllegalArgumentException - if any other bits besides the above are set. |
setMode | public void setMode(int mode)(Code) | | Sets the picking detail mode. The default is PickInfo.PICK_BOUNDS.
Parameters: mode - One of PickInfo.PICK_BOUNDS or PickInfo.PICK_GEOMETRY. exception: IllegalArgumentException - if mode is not a legal value |
setShape | public void setShape(PickShape ps, Point3d startPt)(Code) | | Sets the pick shape to a user-provided PickShape object
Parameters: ps - The pick shape to pick against. Parameters: startPt - The start point to use for distance calculations |
setShapeBounds | public void setShapeBounds(Bounds bounds, Point3d startPt)(Code) | | Sets the pick shape to use a user-provided Bounds object
Parameters: bounds - The bounds to pick against. Parameters: startPt - The start point to use for distance calculations |
setShapeConeRay | public void setShapeConeRay(Point3d start, Vector3d dir, double angle)(Code) | | Sets the pick shape to an infinite PickCone.
Parameters: start - The start of axis of the cone Parameters: dir - The direction of the axis of the cone Parameters: angle - The angle of the cone |
setShapeConeSegment | public void setShapeConeSegment(Point3d start, Point3d end, double angle)(Code) | | Sets the pick shape to a capped PickCone
Parameters: start - The start of axis of the cone Parameters: end - The end of the axis of the cone Parameters: angle - The angle of the cone |
setShapeCylinderRay | public void setShapeCylinderRay(Point3d start, Vector3d dir, double radius)(Code) | | Sets the pick shape to an infinite PickCylinder.
Parameters: start - The start of axis of the cylinder Parameters: dir - The direction of the axis of the cylinder Parameters: radius - The radius of the cylinder |
setShapeCylinderSegment | public void setShapeCylinderSegment(Point3d start, Point3d end, double radius)(Code) | | Sets the pick shape to a capped PickCylinder
Parameters: start - The start of axis of the cylinder Parameters: end - The end of the axis of the cylinder Parameters: radius - The radius of the cylinder |
setShapeRay | public void setShapeRay(Point3d start, Vector3d dir)(Code) | | Sets the pick shape to a PickRay.
Parameters: start - The start of the ray Parameters: dir - The direction of the ray |
setShapeSegment | public void setShapeSegment(Point3d start, Point3d end)(Code) | | Sets the pick shape to a PickSegment.
Parameters: start - The start of the segment Parameters: end - The end of the segment |
|
|