javax.media.j3d

## Class PickInfo

- java.lang.Object
- - javax.media.j3d.PickInfo

-     public class PickInfo
      extends java.lang.Object

  The PickInfo object contains the computed information about a pick hit. The detailed information about each intersection of the PickShape with the picked Node can be inquired. The PickInfo object is constructed with basic information and more detailed information can be generated by setting the appropriate mask to the flag argument in the pick methods of BranchGroup and Locale.

  Since:
    Java 3D 1.4
  See Also:
    `Locale`, `BranchGroup`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `PickInfo.IntersectionInfo` The IntersectionInfo object holds extra information about an intersection of a PickShape with a Node as part of a PickInfo.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALL_GEOM_INFO` Specifies that this PickInfo returns all the closest intersection geometry informations.
    `static int` | `CLOSEST_DISTANCE` Specifies that this PickInfo returns the closest intersection distance.
    `static int` | `CLOSEST_GEOM_INFO` Specifies that this PickInfo returns only the closest intersection geometry information.
    `static int` | `CLOSEST_INTERSECTION_POINT` Specifies that this PickInfo returns the closest intersection point.
    `static int` | `LOCAL_TO_VWORLD` Specifies that this PickInfo returns the computed local to vworld transform.
    `static int` | `NODE` Specifies that this PickInfo returns the computed intersected Node object.
    `static int` | `PICK_BOUNDS` Specifies a Pick using the bounds of the pickable nodes.
    `static int` | `PICK_GEOMETRY` Specifies a Pick using the geometry of the pickable nodes.
    `static int` | `SCENEGRAPHPATH` Specifies that this PickInfo returns the computed SceneGraphPath object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getClosestDistance()` Retrieves the distance between the start point of the pickShape and the closest intersection point.
    `Point3d` | `getClosestIntersectionPoint()` Retrieves the reference to the closest intersection point in this PickInfo object.
    `PickInfo.IntersectionInfo[]` | `getIntersectionInfos()` Retrieves the reference to the array of intersection results in this PickInfo object.
    `Transform3D` | `getLocalToVWorld()` Retrieves the reference to the LocalToVworld transform of the picked node in this PickInfo object.
    `Node` | `getNode()` Retrieves the reference to the picked node, either a Shape3D or a Morph, in this PickInfo object.
    `SceneGraphPath` | `getSceneGraphPath()` Retrieves the reference to the SceneGraphPath in this PickInfo object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PICK_BOUNDS

          public static final int PICK_BOUNDS

      Specifies a Pick using the bounds of the pickable nodes.
      See Also:
        Constant Field Values

    - #### PICK_GEOMETRY

          public static final int PICK_GEOMETRY

      Specifies a Pick using the geometry of the pickable nodes.
      See Also:
        Constant Field Values

    - #### SCENEGRAPHPATH

          public static final int SCENEGRAPHPATH

      Specifies that this PickInfo returns the computed SceneGraphPath object.
      See Also:
        Constant Field Values

    - #### NODE

          public static final int NODE

      Specifies that this PickInfo returns the computed intersected Node object.
      See Also:
        Constant Field Values

    - #### LOCAL_TO_VWORLD

          public static final int LOCAL_TO_VWORLD

      Specifies that this PickInfo returns the computed local to vworld transform.
      See Also:
        Constant Field Values

    - #### CLOSEST_INTERSECTION_POINT

          public static final int CLOSEST_INTERSECTION_POINT

      Specifies that this PickInfo returns the closest intersection point.
      See Also:
        Constant Field Values

    - #### CLOSEST_DISTANCE

          public static final int CLOSEST_DISTANCE

      Specifies that this PickInfo returns the closest intersection distance.
      See Also:
        Constant Field Values

    - #### CLOSEST_GEOM_INFO

          public static final int CLOSEST_GEOM_INFO

      Specifies that this PickInfo returns only the closest intersection geometry information.
      See Also:
        Constant Field Values

    - #### ALL_GEOM_INFO

          public static final int ALL_GEOM_INFO

      Specifies that this PickInfo returns all the closest intersection geometry informations.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getSceneGraphPath

          public SceneGraphPath getSceneGraphPath()

      Retrieves the reference to the SceneGraphPath in this PickInfo object.
      Returns:
        the SceneGraphPath object, or null if flag is not set with SCENEGRAPHPATH.
      See Also:
        `Locale`, `BranchGroup`

    - #### getNode

          public Node getNode()

      Retrieves the reference to the picked node, either a Shape3D or a Morph, in this PickInfo object.
      Returns:
        the picked leaf node object, or null if flag is not set with NODE.
      See Also:
        `Locale`, `BranchGroup`

    - #### getLocalToVWorld

          public Transform3D getLocalToVWorld()

      Retrieves the reference to the LocalToVworld transform of the picked node in this PickInfo object.
      Returns:
        the local to vworld transform, or null if flag is not set with LOCAL_TO_VWORLD.
      See Also:
        `Locale`, `BranchGroup`

    - #### getClosestIntersectionPoint

          public Point3d getClosestIntersectionPoint()

      Retrieves the reference to the closest intersection point in this PickInfo object.
      Returns:
        the closest intersection point, or null if flag is not set with CLOSEST_INTERSECTION_POINT.
      See Also:
        `Locale`, `BranchGroup`

    - #### getClosestDistance

          public double getClosestDistance()

      Retrieves the distance between the start point of the pickShape and the closest intersection point.
      Returns:
        the closest distance in double, or NaN if flag is not set with CLOSEST_INTERSECTION_POINT. Note : If this PickInfo object is returned by either pickClosest or pickAllSorted method, the return value is the closest distance in double even if flag is not set with CLOSET_INTERSECTION_POINT.
      See Also:
        `Locale`, `BranchGroup`

    - #### getIntersectionInfos

          public PickInfo.IntersectionInfo[] getIntersectionInfos()

      Retrieves the reference to the array of intersection results in this PickInfo object.
      Returns:
        an array of 1 IntersectionInfo object if flag is to set CLOSEST_GEOM_INFO, or an array of N IntersectionInfo objects containing all intersections of the picked node in sorted order if flag is to set ALL_GEOM_INFO, or null if neither bit is set.
      See Also:
        `Locale`, `BranchGroup`

Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.