| java.lang.Object com.sun.j3d.utils.picking.PickResult
PickResult | public class PickResult (Code) | | Stores information about a pick hit.
Detailed information about the pick and each intersection of the PickShape
with the picked Node can be inquired. The PickResult is constructed with
basic information and more detailed information is generated as needed. The
additional information is only available if capability bits on the scene
graph Nodes are set properly;
PickTool.setCapabilties(Node, int)
can
be used to ensure correct capabilites are set. Inquiring data which is not
available due to capabilties not being set will generate a
CapabilityNotSet exception.
A PickResult can be used to calculate intersections on Node which is not part
of a live scene graph using the constructor which takes a local to VWorld
transformation for the Node.
Pick hits on TriangleStrip primitives will store the triangle points in the
PickIntersection with
the verticies in counter-clockwise order. For triangles which start with
an odd numbered vertex this will be the the opposite of the
order of the points in the TriangleStrip.
This way the triangle in
the PickIntersection will display the same was as the triangle in the
strip.
If the Shape3D being picked has multiple geometry arrays, the arrays are
stored in the PickResult and referred to by a geometry index.
If the Shape3D refers to a CompressedGeometry, the geometry is decompressed
into an array of Shape3D nodes which can be inquired. The geometry
NodeComponents for the Shape3D nodes are stored and used as if the Shape3D
had multiple geometries. If there are multiple CompressedGeometries on the
Shape3D, the decompressed Shape3Ds and GeometryArrays will be stored
sequentially.
The intersection point for Morph nodes cannot be calculated using the
displayed geometry
due to limitations in the current Java3D core API (the current
geometry of the the Morph cannot be inquired). Instead
the geometry at index 0 in the Morph is used. This limitation may
be eliminated in a future release of Java3D.
|
Method Summary | |
static double | det2D(Point2d a, Point2d b, Point2d p) | static boolean | edgeIntersectPlane(Vector3d normal, Point3d pnt, Point3d start, Point3d end, Point3d iPnt) | static boolean | edgeIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d[] seg) | static boolean | edgeIntersectSphere(BoundingSphere sphere, Point3d start, Point3d end) | static double | generalStandardSimplexSolver(double problemTableau, double stopingValue) | boolean | generateIntersections() | public PickIntersection | getClosestIntersection(Point3d pt) | public Shape3D[] | getCompressedGeometryShape3Ds() Get the array of Shape3Ds that came from decompressing a
CompressedGeometry on the picked node. | public boolean | getFirstPickEnable() Return the "first intersection only" value. | public GeometryArray | getGeometryArray() | public GeometryArray[] | getGeometryArrays() | public PickIntersection | getIntersection(int index) | public Transform3D | getLocalToVworld() | public Node | getNode(int flags) | public Node | getObject() | public PickShape | getPickShape() | public SceneGraphPath | getSceneGraphPath() Get the SceneGraphPath. | void | initPickShape() | static boolean | inside(Point3d coordinates, PickPoint point, int ccw) Return true if point is on the inside of halfspace test. | final boolean | intersect(int geomIndex, boolean firstpick) | static boolean | intersectBoundingBox(Point3d coordinates, BoundingBox box) | static boolean | intersectBoundingPolytope(Point3d coordinates, BoundingPolytope polytope) | static boolean | intersectBoundingSphere(Point3d coordinates, BoundingSphere sphere) | static boolean | intersectCone(Point3d coordinates, PickCone cone, PickIntersection pi) Return true if triangle or quad intersects with cone. | static boolean | intersectCone(Point3d pt, PickCone cone, PickIntersection pi) Return true if point intersects with cone and the
distance is stored in pi. | static boolean | intersectCylinder(Point3d coordinates, PickCylinder cyl, PickIntersection pi) Return true if triangle or quad intersects with cylinder and the
distance is stored in pr. | static boolean | intersectCylinder(Point3d pt, PickCylinder cyl, PickIntersection pi) Return true if point intersects with cylinder and the
distance is stored in pi. | boolean | intersectILA(IndexedLineArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectILSA(IndexedLineStripArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectIPA(IndexedPointArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | final boolean | intersectIQA(IndexedQuadArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectITA(IndexedTriangleArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectITFA(IndexedTriangleFanArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectITSA(IndexedTriangleStripArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectLA(LineArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectLSA(LineStripArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectLine(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi) | static boolean | intersectLineAndRay(Point3d start, Point3d end, Point3d ori, Vector3d dir, PickIntersection pi) | boolean | intersectPA(PointArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | static boolean | intersectPntAndPnt(Point3d pnt1, Point3d pnt2, PickIntersection pi) | static boolean | intersectPntAndRay(Point3d pnt, Point3d ori, Vector3d dir, PickIntersection pi) | boolean | intersectPoint(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi) | static boolean | intersectPolygon(Point3d coord1, Point3d coord2, boolean doTrivialTest) | boolean | intersectQA(QuadArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectQuad(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi) | static boolean | intersectRay(Point3d coordinates, PickRay ray, PickIntersection pi) | static boolean | intersectRayOrSegment(Point3d coordinates, Vector3d direction, Point3d origin, PickIntersection pi, boolean isSegment) Return true if triangle or quad intersects with ray and the distance is
stored in pr. | static boolean | intersectSegment(Point3d coordinates, PickSegment segment, PickIntersection pi) Return true if triangle or quad intersects with segment and the distance is
stored in dist. | boolean | intersectTA(TriangleArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectTFA(TriangleFanArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectTSA(TriangleStripArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi) | boolean | intersectTri(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi) | final static boolean | isNonZero(double v) | public int | numCompressedGeometryShape3Ds() Get the number of Shape3Ds that came from decompressing a
CompressedGeometry on the picked node. | public int | numGeometryArrays() | public int | numIntersections() Returns the number of PickIntersections in the PickResult. | static boolean | pointIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d point) | public void | setFirstIntersectOnly(boolean flag) Set the PickResult to find only the first intersection of the PickShape
with the Node. | void | setObject(Node n) | void | storeNode() | public String | toString() |
BRANCH_GROUP | final public static int BRANCH_GROUP(Code) | | Flag to pass to
getNode(int)
to return a
BranchGroup node from
the SceneGraphPath .
|
EPS | final static double EPS(Code) | | |
FUZZ | final static double FUZZ(Code) | | |
GROUP | final public static int GROUP(Code) | | Flag to pass to
getNode(int)
to return a
Group node from
the SceneGraphPath .
|
LINK | final public static int LINK(Code) | | Flag to pass to
getNode(int)
to return a
Link node from
the SceneGraphPath .
|
MORPH | final public static int MORPH(Code) | | Flag to pass to
getNode(int)
to return a
Morph node from
the SceneGraphPath .
|
PICK_SHAPE_BOUNDING_BOX | final static int PICK_SHAPE_BOUNDING_BOX(Code) | | |
PICK_SHAPE_BOUNDING_POLYTOPE | final static int PICK_SHAPE_BOUNDING_POLYTOPE(Code) | | |
PICK_SHAPE_BOUNDING_SPHERE | final static int PICK_SHAPE_BOUNDING_SPHERE(Code) | | |
PICK_SHAPE_CONE | final static int PICK_SHAPE_CONE(Code) | | |
PICK_SHAPE_CYLINDER | final static int PICK_SHAPE_CYLINDER(Code) | | |
PICK_SHAPE_POINT | final static int PICK_SHAPE_POINT(Code) | | |
PICK_SHAPE_RAY | final static int PICK_SHAPE_RAY(Code) | | |
PICK_SHAPE_SEGMENT | final static int PICK_SHAPE_SEGMENT(Code) | | |
PRIMITIVE | final public static int PRIMITIVE(Code) | | Flag to pass to
getNode(int)
to return a
Primitive node from
the SceneGraphPath .
|
SHAPE3D | final public static int SHAPE3D(Code) | | Flag to pass to
getNode(int)
to return a
Shape3D node from
the SceneGraphPath .
|
SWITCH | final public static int SWITCH(Code) | | Flag to pass to
getNode(int)
to return a
Switch node from
the SceneGraphPath .
|
TRANSFORM_GROUP | final public static int TRANSFORM_GROUP(Code) | | Flag to pass to
getNode(int)
to return a
TransformGroup node from
the SceneGraphPath .
|
debug | static boolean debug(Code) | | |
intersections | ArrayList intersections(Code) | | ArrayList to store intersection results
Used in PickTool
|
zeroPnt | final static Point3d zeroPnt(Code) | | |
PickResult | PickResult()(Code) | | Default constructor.
|
PickResult | public PickResult(SceneGraphPath sgp, PickShape ps)(Code) | | Construct a PickResult using a SceneGraphPath
Parameters: sgp - SceneGraphPath associated with this PickResult Parameters: ps - The pickShape to intersect against |
PickResult | public PickResult(Node pn, Transform3D l2vw, PickShape ps)(Code) | | Construct a PickResult using the Node and localToVWorld transform
Parameters: pn - The picked node. Parameters: l2vw - The local to VWorld transformation for the node Parameters: ps - The PickShape to intersect against throws: IllegalArgumentException - If the node is not a Morph or Shape3D. |
det2D | static double det2D(Point2d a, Point2d b, Point2d p)(Code) | | |
edgeIntersectPlane | static boolean edgeIntersectPlane(Vector3d normal, Point3d pnt, Point3d start, Point3d end, Point3d iPnt)(Code) | | |
edgeIntersectPolygon2D | static boolean edgeIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d[] seg)(Code) | | |
edgeIntersectSphere | static boolean edgeIntersectSphere(BoundingSphere sphere, Point3d start, Point3d end)(Code) | | |
generalStandardSimplexSolver | static double generalStandardSimplexSolver(double problemTableau, double stopingValue)(Code) | | |
generateIntersections | boolean generateIntersections()(Code) | | Fill in the intersections of the Node with the PickShape
|
getClosestIntersection | public PickIntersection getClosestIntersection(Point3d pt)(Code) | | Gets the PickIntersection in this PickResult that is closest to a point
Parameters: pt - the point to use for distance calculations the closest PickIntersection object |
getCompressedGeometryShape3Ds | public Shape3D[] getCompressedGeometryShape3Ds()(Code) | | Get the array of Shape3Ds that came from decompressing a
CompressedGeometry on the picked node.
|
getFirstPickEnable | public boolean getFirstPickEnable()(Code) | | Return the "first intersection only" value.
|
getGeometryArray | public GeometryArray getGeometryArray()(Code) | | Get the GeometryArray at index 0 for the picked node
|
getGeometryArrays | public GeometryArray[] getGeometryArrays()(Code) | | Get the array of GeometryArrays for the picked node
|
getIntersection | public PickIntersection getIntersection(int index)(Code) | | Returns a specific PickIntersection object
Parameters: index - the index number the PickIntersection referenced by the index number |
getLocalToVworld | public Transform3D getLocalToVworld()(Code) | | Get the localToVworld transform for the Node
|
getNode | public Node getNode(int flags)(Code) | | Get the first node of a certain type up the SceneGraphPath
Parameters: flags - the type of node we are interested in a Node object |
getObject | public Node getObject()(Code) | | Get the picked node
|
getPickShape | public PickShape getPickShape()(Code) | | Get the PickShape used for intersections
|
getSceneGraphPath | public SceneGraphPath getSceneGraphPath()(Code) | | Get the SceneGraphPath. This will be null if the non SceneGraphPath
constructor was used.
|
initPickShape | void initPickShape()(Code) | | |
inside | static boolean inside(Point3d coordinates, PickPoint point, int ccw)(Code) | | Return true if point is on the inside of halfspace test. The halfspace is
partition by the plane of triangle or quad.
|
intersect | final boolean intersect(int geomIndex, boolean firstpick)(Code) | | |
intersectBoundingBox | static boolean intersectBoundingBox(Point3d coordinates, BoundingBox box)(Code) | | |
intersectBoundingPolytope | static boolean intersectBoundingPolytope(Point3d coordinates, BoundingPolytope polytope)(Code) | | |
intersectBoundingSphere | static boolean intersectBoundingSphere(Point3d coordinates, BoundingSphere sphere)(Code) | | |
intersectCone | static boolean intersectCone(Point3d coordinates, PickCone cone, PickIntersection pi)(Code) | | Return true if triangle or quad intersects with cone. The
distance is stored in pr.
|
intersectCone | static boolean intersectCone(Point3d pt, PickCone cone, PickIntersection pi)(Code) | | Return true if point intersects with cone and the
distance is stored in pi.
|
intersectCylinder | static boolean intersectCylinder(Point3d coordinates, PickCylinder cyl, PickIntersection pi)(Code) | | Return true if triangle or quad intersects with cylinder and the
distance is stored in pr.
|
intersectCylinder | static boolean intersectCylinder(Point3d pt, PickCylinder cyl, PickIntersection pi)(Code) | | Return true if point intersects with cylinder and the
distance is stored in pi.
|
intersectLA | boolean intersectLA(LineArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi)(Code) | | Intersect method for LineArray
|
intersectLine | boolean intersectLine(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi)(Code) | | |
intersectLineAndRay | static boolean intersectLineAndRay(Point3d start, Point3d end, Point3d ori, Vector3d dir, PickIntersection pi)(Code) | | |
intersectPntAndRay | static boolean intersectPntAndRay(Point3d pnt, Point3d ori, Vector3d dir, PickIntersection pi)(Code) | | |
intersectPoint | boolean intersectPoint(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi)(Code) | | |
intersectPolygon | static boolean intersectPolygon(Point3d coord1, Point3d coord2, boolean doTrivialTest)(Code) | | |
intersectQA | boolean intersectQA(QuadArray geom, int geomIndex, Point3d[] pnts, boolean firstpick, PickIntersection pi)(Code) | | Intersect method for QuadArray
|
intersectQuad | boolean intersectQuad(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi)(Code) | | |
intersectRayOrSegment | static boolean intersectRayOrSegment(Point3d coordinates, Vector3d direction, Point3d origin, PickIntersection pi, boolean isSegment)(Code) | | Return true if triangle or quad intersects with ray and the distance is
stored in pr.
|
intersectSegment | static boolean intersectSegment(Point3d coordinates, PickSegment segment, PickIntersection pi)(Code) | | Return true if triangle or quad intersects with segment and the distance is
stored in dist.
|
intersectTri | boolean intersectTri(int[] vertidx, int[] coordidx, int geomIndex, Point3d[] pnts, PickIntersection pi)(Code) | | |
isNonZero | final static boolean isNonZero(double v)(Code) | | |
numCompressedGeometryShape3Ds | public int numCompressedGeometryShape3Ds()(Code) | | Get the number of Shape3Ds that came from decompressing a
CompressedGeometry on the picked node.
|
numGeometryArrays | public int numGeometryArrays()(Code) | | Get the number of GeometryArrays for the picked node
|
numIntersections | public int numIntersections()(Code) | | Returns the number of PickIntersections in the PickResult.
the number of intersections |
pointIntersectPolygon2D | static boolean pointIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d point)(Code) | | |
setFirstIntersectOnly | public void setFirstIntersectOnly(boolean flag)(Code) | | Set the PickResult to find only the first intersection of the PickShape
with the Node. The default is false (all intersections are
found)
|
setObject | void setObject(Node n)(Code) | | Set the picked node
|
storeNode | void storeNode()(Code) | | Extract the picked node from the SceneGraphPath
|
toString | public String toString()(Code) | | Returns String representation
string representation of this object |
|
|