| java.lang.Object com.sun.j3d.utils.behaviors.picking.PickObject
Field Summary | |
final public static int | BRANCH_GROUP A flag to indicate to the pickNode method to return a
BranchGroup
node from a given SceneGraphPath . | final public static int | GROUP A flag to indicate to the pickNode method to return a
Group node from
a given SceneGraphPath . | final public static int | LINK A flag to indicate to the pickNode method to return a
Link node from
a given SceneGraphPath . | final public static int | MORPH A flag to indicate to the pickNode method to return a
Morph node from
a given SceneGraphPath . | final public static int | PRIMITIVE A flag to indicate to the pickNode method to return a
Primitive node
from a given SceneGraphPath . | final public static int | SHAPE3D A flag to indicate to the pickNode method to return a
Shape3D node from
a given SceneGraphPath . | final public static int | SWITCH A flag to indicate to the pickNode method to return a
Switch node from
a given SceneGraphPath . | final public static int | TRANSFORM_GROUP A flag to indicate to the pickNode method to return a
TransformGroup
node from a given SceneGraphPath . | final public static int | USE_BOUNDS Set this flag if you want to pick by bounds. | final public static int | USE_GEOMETRY Set this flag if you want to pick by geometry. | Canvas3D | canvas | final static boolean | debug | Vector3d | direction | Point3d | origin | int | pickBy | PickRay | pickRay | BranchGroup | pickRoot | SceneGraphPath | sceneGraphPath | SceneGraphPath | sceneGraphPathArr |
Constructor Summary | |
public | PickObject(Canvas3D c, BranchGroup root) Creates a PickObject.
Parameters: c - Current J3D canvas. Parameters: root - The portion of the scenegraph for which picking is to occuron. |
Method Summary | |
public PickShape | generatePickRay(int xpos, int ypos) Creates a PickRay that starts at the viewer position and points into
the scene in the direction of (xpos, ypos) specified in window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. | public SceneGraphPath[] | pickAll(int xpos, int ypos) Returns an array referencing all the items that are pickable below the
BranchGroup (specified in the PickObject constructor) that
intersect with a ray that starts at the
viewer position and points into the scene in the direction of (xpos, ypos)
specified in window space. | public SceneGraphPath[] | pickAll(int xpos, int ypos, int flag) Returns an array referencing all the items that are pickable below the
BranchGroup (specified in the PickObject constructor) that
intersect with a ray that starts at the
viewer position and points into the scene in the direction of (xpos, ypos)
specified in window space. | public SceneGraphPath[] | pickAllSorted(int xpos, int ypos) Returns a sorted array of references to all the Pickable items below the
BranchGroup (specified in the PickObject constructor) that
intersect with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos)
in the window space. | public SceneGraphPath[] | pickAllSorted(int xpos, int ypos, int flag) Returns a sorted array of references to all the Pickable items below the
BranchGroup (specified in the PickObject constructor) that
intersect with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos)
in the window space. | public SceneGraphPath | pickAny(int xpos, int ypos) Returns a reference to any item that is Pickable below the specified
BranchGroup (specified in the PickObject constructor) which
intersects with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos) in
window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. | public SceneGraphPath | pickAny(int xpos, int ypos, int flag) Returns a reference to any item that is Pickable below the specified
BranchGroup (specified in the PickObject constructor) which
intersects with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos) in
window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. | public SceneGraphPath | pickClosest(int xpos, int ypos) Returns a reference to the item that is closest to the viewer and is
Pickable below the BranchGroup (specified in the PickObject
constructor) which intersects with the ray that starts at
the viewer position and points into the scene in the direction of
(xpos, ypos) in the window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. | public SceneGraphPath | pickClosest(int xpos, int ypos, int flag) Returns a reference to the item that is closest to the viewer and is
Pickable below the BranchGroup (specified in the PickObject
constructor) which intersects with the ray that starts at
the viewer position and points into the scene in the direction of
(xpos, ypos) in the window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. | public Node | pickNode(SceneGraphPath sgPath, int flags) Returns a reference to a Pickable Node that
is of the specified type
that is contained in the specified SceneGraphPath.
If more than one node of the same type is encountered, the node
closest to the terminal node of SceneGraphPath will be returned.
Parameters: sgPath - the SceneGraphPath to be traversed. Parameters: flags - the Node types interested in picking. | public Node | pickNode(SceneGraphPath sgPath, int flags, int occurrence) Returns a reference to a Pickable Node that
is of the specified type
that is contained in the specified SceneGraphPath.
The Node returned is the nth occurrence
of a Node that is of the specified type.
Parameters: sgPath - the SceneGraphPath to be traversed. Parameters: flags - the Node types interested. Parameters: occurrence - the occurrence of a Node thatmatches the specified type to return. |
BRANCH_GROUP | final public static int BRANCH_GROUP(Code) | | A flag to indicate to the pickNode method to return a
BranchGroup
node from a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
GROUP | final public static int GROUP(Code) | | A flag to indicate to the pickNode method to return a
Group node from
a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
LINK | final public static int LINK(Code) | | A flag to indicate to the pickNode method to return a
Link node from
a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
MORPH | final public static int MORPH(Code) | | A flag to indicate to the pickNode method to return a
Morph node from
a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
PRIMITIVE | final public static int PRIMITIVE(Code) | | A flag to indicate to the pickNode method to return a
Primitive node
from a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
SHAPE3D | final public static int SHAPE3D(Code) | | A flag to indicate to the pickNode method to return a
Shape3D node from
a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
SWITCH | final public static int SWITCH(Code) | | A flag to indicate to the pickNode method to return a
Switch node from
a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
TRANSFORM_GROUP | final public static int TRANSFORM_GROUP(Code) | | A flag to indicate to the pickNode method to return a
TransformGroup
node from a given SceneGraphPath .
See Also: PickObject.pickNode See Also: |
USE_BOUNDS | final public static int USE_BOUNDS(Code) | | Set this flag if you want to pick by bounds.
|
USE_GEOMETRY | final public static int USE_GEOMETRY(Code) | | Set this flag if you want to pick by geometry.
|
debug | final static boolean debug(Code) | | |
direction | Vector3d direction(Code) | | |
PickObject | public PickObject(Canvas3D c, BranchGroup root)(Code) | | Creates a PickObject.
Parameters: c - Current J3D canvas. Parameters: root - The portion of the scenegraph for which picking is to occuron. It has to be a BranchGroup . See Also: BranchGroup See Also: Canvas3D |
generatePickRay | public PickShape generatePickRay(int xpos, int ypos)(Code) | | Creates a PickRay that starts at the viewer position and points into
the scene in the direction of (xpos, ypos) specified in window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. A PickShape object that is the constructed PickRay. |
pickAll | public SceneGraphPath[] pickAll(int xpos, int ypos)(Code) | | Returns an array referencing all the items that are pickable below the
BranchGroup (specified in the PickObject constructor) that
intersect with a ray that starts at the
viewer position and points into the scene in the direction of (xpos, ypos)
specified in window space. The resultant array is unordered.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. The array of SceneGraphPath objects that contain Objects thatwere pickedIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickAll | public SceneGraphPath[] pickAll(int xpos, int ypos, int flag)(Code) | | Returns an array referencing all the items that are pickable below the
BranchGroup (specified in the PickObject constructor) that
intersect with a ray that starts at the
viewer position and points into the scene in the direction of (xpos, ypos)
specified in window space. The resultant array is unordered.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. The array of SceneGraphPath objects that contain Objects thatwere pickedIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickAllSorted | public SceneGraphPath[] pickAllSorted(int xpos, int ypos)(Code) | | Returns a sorted array of references to all the Pickable items below the
BranchGroup (specified in the PickObject constructor) that
intersect with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos)
in the window space.
Element [0] references the item closest to viewer.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. A sorted arrayof SceneGraphPath objects that contain Objects thatwere picked. The array is sorted from closest to farthest from theviewerIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickAllSorted | public SceneGraphPath[] pickAllSorted(int xpos, int ypos, int flag)(Code) | | Returns a sorted array of references to all the Pickable items below the
BranchGroup (specified in the PickObject constructor) that
intersect with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos)
in the window space.
Element [0] references the item closest to viewer.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. A sorted arrayof SceneGraphPath objects that contain Objects thatwere picked. The array is sorted from closest to farthest from theviewerIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickAny | public SceneGraphPath pickAny(int xpos, int ypos)(Code) | | Returns a reference to any item that is Pickable below the specified
BranchGroup (specified in the PickObject constructor) which
intersects with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos) in
window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. A SceneGraphPath of an object that was picked. This is notguarenteed to return the same result for multiple picksIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickAny | public SceneGraphPath pickAny(int xpos, int ypos, int flag)(Code) | | Returns a reference to any item that is Pickable below the specified
BranchGroup (specified in the PickObject constructor) which
intersects with the ray that starts at the viewer
position and points into the scene in the direction of (xpos, ypos) in
window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. A SceneGraphPath of an object that was picked. This is notguarenteed to return the same result for multiple picksIf no pickable object is found null is returned.. See Also: SceneGraphPath |
pickClosest | public SceneGraphPath pickClosest(int xpos, int ypos)(Code) | | Returns a reference to the item that is closest to the viewer and is
Pickable below the BranchGroup (specified in the PickObject
constructor) which intersects with the ray that starts at
the viewer position and points into the scene in the direction of
(xpos, ypos) in the window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. A SceneGraphPath which contains the closest pickable object.If no pickable object is found, null is returned. See Also: SceneGraphPath |
pickClosest | public SceneGraphPath pickClosest(int xpos, int ypos, int flag)(Code) | | Returns a reference to the item that is closest to the viewer and is
Pickable below the BranchGroup (specified in the PickObject
constructor) which intersects with the ray that starts at
the viewer position and points into the scene in the direction of
(xpos, ypos) in the window space.
Parameters: xpos - The value along the x-axis. Parameters: ypos - The value along the y-axis. Parameters: flag - Specifys picking by Geometry or Bounds. A SceneGraphPath which contains the closest pickable object.If no pickable object is found, null is returned. See Also: SceneGraphPath |
pickNode | public Node pickNode(SceneGraphPath sgPath, int flags)(Code) | | Returns a reference to a Pickable Node that
is of the specified type
that is contained in the specified SceneGraphPath.
If more than one node of the same type is encountered, the node
closest to the terminal node of SceneGraphPath will be returned.
Parameters: sgPath - the SceneGraphPath to be traversed. Parameters: flags - the Node types interested in picking. the first occurrence of the specified Node typestarting from the terminal node of SceneGraphPath. If no pickable object is found of the specifed types, null is returned. |
pickNode | public Node pickNode(SceneGraphPath sgPath, int flags, int occurrence)(Code) | | Returns a reference to a Pickable Node that
is of the specified type
that is contained in the specified SceneGraphPath.
The Node returned is the nth occurrence
of a Node that is of the specified type.
Parameters: sgPath - the SceneGraphPath to be traversed. Parameters: flags - the Node types interested. Parameters: occurrence - the occurrence of a Node thatmatches the specified type to return. An occurrence of1 means to return the first occurrence of that object type (the objectclosest to the Locale). the nth occurrence of a Nodeof type flags , starting from the Locale. If no pickable object is found, null is returned. |
|
|