APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.scene.input

public Class PickResultChooser

extends Object
Class Inheritance
Imports
com.sun.javafx.geom.PickRay, .Vec3d, com.sun.javafx.scene.NodeHelper, .SubSceneHelper, javafx.application.ConditionalFeature, .Platform, javafx.geometry.Point2D, .Point3D, javafx.scene.Node, .SubScene, javafx.scene.input.PickResult

Used during 3D picking process to determine the best pick result.

Field Summary

Modifier and TypeField and Description
private boolean
private double
private boolean
private int
private Node
private Point3D
private Point3D
private Point2D

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Point3D

Returns:

the intersection point
computePoint
(PickRay
Pick ray used for picking
ray
,
double
Distance measured in ray direction magnitudes
distance
)

Helper method for computing intersected point.

public final double

Returns:

the distance from camera to the intersection
getIntersectedDistance
()

Returns the intersected distance between camera position and the picked Node

public final int

Returns:

the picked face
getIntersectedFace
()

Returns the intersected face of the picked Node

public final Node

Returns:

the picked Node
getIntersectedNode
()

Returns the intersected Node

public final Point3D

Returns:

new Point3D presenting the intersected normal
getIntersectedNormal
()

Return the intersected normal in local coordinate of the picked Node

public final Point3D

Returns:

new Point3D presenting the intersected point
getIntersectedPoint
()

Return the intersected point in local coordinate of the picked Node

public final Point2D
getIntersectedTexCoord()

Return the intersected texture coordinates of the picked Node return new Point2D presenting the intersected TexCoord

public boolean

Returns:

true if this chooser has been closed.
isClosed
()

Returns true if this chooser has been closed.

public boolean

Returns:

true if the given distance is smaller
isCloser
(double
The distance to compare
distance
)

Returns true if the given distance is smaller than the distance stored in this instance.

public boolean

Returns:

true if there is no intersection stored in this instance.
isEmpty
()

Returns true if there is no intersection stored in this instance.

public boolean

Returns:

true if the offered intersection has been used
offer
(Node
The intersected node
node
,
double
The intersected distance measured in pickRay direction magnitudes
distance
,
int
The intersected face
face
,
Point3D
The intersection point
point
,
Point2D
The intersected texture coordinates
texCoord
)

Offers an intersection.

public boolean

Returns:

true if the offered intersection has been used
offer
(Node
The intersected node
node
,
double
The intersected distance measured in pickRay direction magnitudes
distance
,
Point3D
The intersection point
point
)

Offers an intersection with a non-Shape3D object.

public boolean

Returns:

true if the offered intersection has been used
offerSubScenePickResult
(SubScene
SubScene where the result was picked
subScene
,
PickResult
Picking result from the subScene
pickResult
,
double
distance from the camera to the intersection point with the subScene plane
distance
)

Offers an intersection found inside a SubScene.

protected boolean

Returns:

true if the offered intersection has been used
processOffer
(Node
The intersected node
node
,
Node
The node whose depthTest is considered. When processing subScene pick result we need to consider the inner picked node but subScene's depth test
depthTestNode
,
double
The intersected distance measured in pickRay direction magnitudes
distance
,
Point3D
The intersection point
point
,
int
The intersected face
face
,
Point3D
The intersected normal
normal
,
Point2D
The intersected texture coordinates
texCoord
)

Process an offered intersection.

public void
reset()

Resets this PickResultChooser instance so that it can be reused.

public PickResult

Returns:

PickResult containing the current values of this chooser
toPickResult
()

Converts the current content of this instance to the unmodifiable PickResult.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
private boolean closed
distanceback to summary
private double distance
emptyback to summary
private boolean empty
faceback to summary
private int face
nodeback to summary
private Node node
normalback to summary
private Point3D normal
pointback to summary
private Point3D point
texCoordback to summary
private Point2D texCoord

Constructor Detail

PickResultChooserback to summary
public PickResultChooser()

Method Detail

computePointback to summary
public static Point3D computePoint(PickRay ray, double distance)

Helper method for computing intersected point. This method would fit better to PickRay but it cannot work with Point3D (dependency issues).

Parameters
ray:PickRay

Pick ray used for picking

distance:double

Distance measured in ray direction magnitudes

Returns:Point3D

the intersection point

getIntersectedDistanceback to summary
public final double getIntersectedDistance()

Returns the intersected distance between camera position and the picked Node

Returns:double

the distance from camera to the intersection

getIntersectedFaceback to summary
public final int getIntersectedFace()

Returns the intersected face of the picked Node

Returns:int

the picked face

getIntersectedNodeback to summary
public final Node getIntersectedNode()

Returns the intersected Node

Returns:Node

the picked Node

getIntersectedNormalback to summary
public final Point3D getIntersectedNormal()

Return the intersected normal in local coordinate of the picked Node

Returns:Point3D

new Point3D presenting the intersected normal

getIntersectedPointback to summary
public final Point3D getIntersectedPoint()

Return the intersected point in local coordinate of the picked Node

Returns:Point3D

new Point3D presenting the intersected point

getIntersectedTexCoordback to summary
public final Point2D getIntersectedTexCoord()

Return the intersected texture coordinates of the picked Node return new Point2D presenting the intersected TexCoord

isClosedback to summary
public boolean isClosed()

Returns true if this chooser has been closed. The chooser is closed when it is clear that no further result can be accepted (due to disabled depth testing).

Returns:boolean

true if this chooser has been closed.

See Also
close()
isCloserback to summary
public boolean isCloser(double distance)

Returns true if the given distance is smaller than the distance stored in this instance.

Parameters
distance:double

The distance to compare

Returns:boolean

true if the given distance is smaller

isEmptyback to summary
public boolean isEmpty()

Returns true if there is no intersection stored in this instance.

Returns:boolean

true if there is no intersection stored in this instance.

offerback to summary
public boolean offer(Node node, double distance, int face, Point3D point, Point2D texCoord)

Offers an intersection. If the given intersection is closer to the camera than the current one (the distance is smaller), this instance is updated to hold the given values.

Parameters
node:Node

The intersected node

distance:double

The intersected distance measured in pickRay direction magnitudes

face:int

The intersected face

point:Point3D

The intersection point

texCoord:Point2D

The intersected texture coordinates

Returns:boolean

true if the offered intersection has been used

offerback to summary
public boolean offer(Node node, double distance, Point3D point)

Offers an intersection with a non-Shape3D object. This method is used for 2D objects and for 3D objects with pickOnBounds==true; in both cases face and texCoord make no sense. If the given intersection is closer to the camera than the current one (the distance is smaller), this instance is updated to hold the given values.

Parameters
node:Node

The intersected node

distance:double

The intersected distance measured in pickRay direction magnitudes

point:Point3D

The intersection point

Returns:boolean

true if the offered intersection has been used

offerSubScenePickResultback to summary
public boolean offerSubScenePickResult(SubScene subScene, PickResult pickResult, double distance)

Offers an intersection found inside a SubScene.

Parameters
subScene:SubScene

SubScene where the result was picked

pickResult:PickResult

Picking result from the subScene

distance:double

distance from the camera to the intersection point with the subScene plane

Returns:boolean

true if the offered intersection has been used

processOfferback to summary
protected boolean processOffer(Node node, Node depthTestNode, double distance, Point3D point, int face, Point3D normal, Point2D texCoord)

Process an offered intersection.

Parameters
node:Node

The intersected node

depthTestNode:Node

The node whose depthTest is considered. When processing subScene pick result we need to consider the inner picked node but subScene's depth test

distance:double

The intersected distance measured in pickRay direction magnitudes

point:Point3D

The intersection point

face:int

The intersected face

normal:Point3D

The intersected normal

texCoord:Point2D

The intersected texture coordinates

Returns:boolean

true if the offered intersection has been used

See Also
PickResultChooser#offer(javafx.scene.Node, double, int, javafx.geometry.Point3D, javafx.geometry.Point2D), PickResultChooser#offer(javafx.scene.Node, double, javafx.geometry.Point3D)
resetback to summary
public void reset()

Resets this PickResultChooser instance so that it can be reused.

toPickResultback to summary
public PickResult toPickResult()

Converts the current content of this instance to the unmodifiable PickResult.

Returns:PickResult

PickResult containing the current values of this chooser