Class PickObject
- java.lang.Object
-
- com.sun.j3d.utils.behaviors.picking.PickObject
-
public class PickObject extends java.lang.Object
Deprecated.As of Java 3D version 1.2, replaced bycom.sun.j3d.utils.picking.PickCanvas
- See Also:
PickCanvas
-
-
Field Summary
Fields Modifier and Type Field Description static int
BRANCH_GROUP
Deprecated.A flag to indicate to the pickNode method to return aBranchGroup
node from a givenSceneGraphPath
.static int
GROUP
Deprecated.A flag to indicate to the pickNode method to return aGroup
node from a givenSceneGraphPath
.static int
LINK
Deprecated.A flag to indicate to the pickNode method to return aLink
node from a givenSceneGraphPath
.static int
MORPH
Deprecated.A flag to indicate to the pickNode method to return aMorph
node from a givenSceneGraphPath
.static int
PRIMITIVE
Deprecated.A flag to indicate to the pickNode method to return aPrimitive
node from a givenSceneGraphPath
.static int
SHAPE3D
Deprecated.A flag to indicate to the pickNode method to return aShape3D
node from a givenSceneGraphPath
.static int
SWITCH
Deprecated.A flag to indicate to the pickNode method to return aSwitch
node from a givenSceneGraphPath
.static int
TRANSFORM_GROUP
Deprecated.A flag to indicate to the pickNode method to return aTransformGroup
node from a givenSceneGraphPath
.static int
USE_BOUNDS
Deprecated.Set this flag if you want to pick by bounds.static int
USE_GEOMETRY
Deprecated.Set this flag if you want to pick by geometry.
-
Constructor Summary
Constructors Constructor Description PickObject(Canvas3D c, BranchGroup root)
Deprecated.Creates a PickObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PickShape
generatePickRay(int xpos, int ypos)
Deprecated.Creates a PickRay that starts at the viewer position and points into the scene in the direction of (xpos, ypos) specified in window space.SceneGraphPath[]
pickAll(int xpos, int ypos)
Deprecated.Returns an array referencing all the items that are pickable below theBranchGroup
(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.SceneGraphPath[]
pickAll(int xpos, int ypos, int flag)
Deprecated.Returns an array referencing all the items that are pickable below theBranchGroup
(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.SceneGraphPath[]
pickAllSorted(int xpos, int ypos)
Deprecated.Returns a sorted array of references to all the Pickable items below theBranchGroup
(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.SceneGraphPath[]
pickAllSorted(int xpos, int ypos, int flag)
Deprecated.Returns a sorted array of references to all the Pickable items below theBranchGroup
(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.SceneGraphPath
pickAny(int xpos, int ypos)
Deprecated.Returns a reference to any item that is Pickable below the specifiedBranchGroup
(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.SceneGraphPath
pickAny(int xpos, int ypos, int flag)
Deprecated.Returns a reference to any item that is Pickable below the specifiedBranchGroup
(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.SceneGraphPath
pickClosest(int xpos, int ypos)
Deprecated.Returns a reference to the item that is closest to the viewer and is Pickable below theBranchGroup
(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.SceneGraphPath
pickClosest(int xpos, int ypos, int flag)
Deprecated.Returns a reference to the item that is closest to the viewer and is Pickable below theBranchGroup
(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.Node
pickNode(SceneGraphPath sgPath, int flags)
Deprecated.Returns a reference to a Pickable Node that is of the specified type that is contained in the specified SceneGraphPath.Node
pickNode(SceneGraphPath sgPath, int flags, int occurrence)
Deprecated.Returns a reference to a Pickable Node that is of the specified type that is contained in the specified SceneGraphPath.
-
-
-
Field Detail
-
SHAPE3D
public static final int SHAPE3D
Deprecated.A flag to indicate to the pickNode method to return aShape3D
node from a givenSceneGraphPath
.
-
MORPH
public static final int MORPH
Deprecated.A flag to indicate to the pickNode method to return aMorph
node from a givenSceneGraphPath
.
-
PRIMITIVE
public static final int PRIMITIVE
Deprecated.A flag to indicate to the pickNode method to return aPrimitive
node from a givenSceneGraphPath
.
-
LINK
public static final int LINK
Deprecated.A flag to indicate to the pickNode method to return aLink
node from a givenSceneGraphPath
.
-
GROUP
public static final int GROUP
Deprecated.A flag to indicate to the pickNode method to return aGroup
node from a givenSceneGraphPath
.
-
TRANSFORM_GROUP
public static final int TRANSFORM_GROUP
Deprecated.A flag to indicate to the pickNode method to return aTransformGroup
node from a givenSceneGraphPath
.
-
BRANCH_GROUP
public static final int BRANCH_GROUP
Deprecated.A flag to indicate to the pickNode method to return aBranchGroup
node from a givenSceneGraphPath
.
-
SWITCH
public static final int SWITCH
Deprecated.A flag to indicate to the pickNode method to return aSwitch
node from a givenSceneGraphPath
.
-
USE_GEOMETRY
public static final int USE_GEOMETRY
Deprecated.Set this flag if you want to pick by geometry.- See Also:
- Constant Field Values
-
USE_BOUNDS
public static final int USE_BOUNDS
Deprecated.Set this flag if you want to pick by bounds.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PickObject
public PickObject(Canvas3D c, BranchGroup root)
Deprecated.Creates a PickObject.- Parameters:
c
- Current J3D canvas.root
- The portion of the scenegraph for which picking is to occur on. It has to be aBranchGroup
.- See Also:
BranchGroup
,Canvas3D
-
-
Method Detail
-
generatePickRay
public PickShape generatePickRay(int xpos, int ypos)
Deprecated.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.ypos
- The value along the y-axis.- Returns:
- A PickShape object that is the constructed PickRay.
-
pickAll
public SceneGraphPath[] pickAll(int xpos, int ypos)
Deprecated.Returns an array referencing all the items that are pickable below theBranchGroup
(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.ypos
- The value along the y-axis.- Returns:
- The array of SceneGraphPath objects that contain Objects that
were picked
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickAllSorted
public SceneGraphPath[] pickAllSorted(int xpos, int ypos)
Deprecated.Returns a sorted array of references to all the Pickable items below theBranchGroup
(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.ypos
- The value along the y-axis.- Returns:
- A sorted arrayof SceneGraphPath objects that contain Objects that
were picked. The array is sorted from closest to farthest from the
viewer
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickAny
public SceneGraphPath pickAny(int xpos, int ypos)
Deprecated.Returns a reference to any item that is Pickable below the specifiedBranchGroup
(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.ypos
- The value along the y-axis.- Returns:
- A SceneGraphPath of an object that was picked. This is not
guarenteed to return the same result for multiple picks
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickClosest
public SceneGraphPath pickClosest(int xpos, int ypos)
Deprecated.Returns a reference to the item that is closest to the viewer and is Pickable below theBranchGroup
(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.ypos
- The value along the y-axis.- Returns:
- A SceneGraphPath which contains the closest pickable object.
If no pickable object is found,
null
is returned. - See Also:
SceneGraphPath
-
pickAll
public SceneGraphPath[] pickAll(int xpos, int ypos, int flag)
Deprecated.Returns an array referencing all the items that are pickable below theBranchGroup
(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.ypos
- The value along the y-axis.flag
- Specifys picking by Geometry or Bounds.- Returns:
- The array of SceneGraphPath objects that contain Objects that
were picked
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickAllSorted
public SceneGraphPath[] pickAllSorted(int xpos, int ypos, int flag)
Deprecated.Returns a sorted array of references to all the Pickable items below theBranchGroup
(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.ypos
- The value along the y-axis.flag
- Specifys picking by Geometry or Bounds.- Returns:
- A sorted arrayof SceneGraphPath objects that contain Objects that
were picked. The array is sorted from closest to farthest from the
viewer
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickAny
public SceneGraphPath pickAny(int xpos, int ypos, int flag)
Deprecated.Returns a reference to any item that is Pickable below the specifiedBranchGroup
(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.ypos
- The value along the y-axis.flag
- Specifys picking by Geometry or Bounds.- Returns:
- A SceneGraphPath of an object that was picked. This is not
guarenteed to return the same result for multiple picks
If no pickable object is found
null
is returned.. - See Also:
SceneGraphPath
-
pickClosest
public SceneGraphPath pickClosest(int xpos, int ypos, int flag)
Deprecated.Returns a reference to the item that is closest to the viewer and is Pickable below theBranchGroup
(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.ypos
- The value along the y-axis.flag
- Specifys picking by Geometry or Bounds.- Returns:
- 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)
Deprecated.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.flags
- the Node types interested in picking.- Returns:
- the first occurrence of the specified Node type
starting 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)
Deprecated.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 nthoccurrence
of a Node that is of the specified type.- Parameters:
sgPath
- the SceneGraphPath to be traversed.flags
- the Node types interested.occurrence
- the occurrence of a Node that matches the specified type to return. Anoccurrence
of 1 means to return the first occurrence of that object type (the object closest to the Locale).- Returns:
- the nth
occurrence
of a Node of typeflags
, starting from the Locale. If no pickable object is found,null
is returned.
-
-