Package org.web3d.x3d.sai.Picking
Interface PointPickSensor
- All Superinterfaces:
X3DChildNode
,X3DNode
,X3DPickSensorNode
,X3DSensorNode
- All Known Implementing Classes:
PointPickSensor
PointPickSensor tests one or more pickingGeometry points in space as lying inside the provided pickTarget geometry.
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
org.web3d.x3d.jsail
classes.
PointPickSensor node tooltip: (X3D version 3.2 or later) [X3DPickSensorNode] PointPickSensor tests one or more pickingGeometry points in space as lying inside the provided pickTarget geometry. For each pickingGeometry PointSet coordinate point that lies inside the pickTarget geometry, a pickedPoint coordinate is returned along with a corresponding pickedGeometry node inside which the point lies.
- Hint: because points represent an infinitely small location in space, sortOrder values CLOSEST and ALL_SORTED are defined to mean ANY and ALL respectively.
- Hint: picking is performed between rendered frames of the event model. An author sets up the picking request in one frame by placing a LinePickSensor in the desired location. At the start of the next frame, any picking intersections are reported by the pick sensor.
- Hint: picking notification is performed at the start of the frame for all enabled pick sensors once all other sensors are processed.
- Hint: event timing details are explained in X3D Specification 4.4.8.3 Execution model https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/concepts.html#ExecutionModel
- Warning: order of contained nodes is significant, single pickingGeometry node must precede pickTarget node array.
- Hint: PointSet can be used for pickingGeometry node.
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPickTarget
(X3DNode[] newValue) Add array of child pickTarget nodes to array of existing nodes (if any).Provide String value from inputOutput SFString field named description.boolean
Provide boolean value from inputOutput SFBool field named enabled.Provide String enumeration value (baseType xs:NMTOKEN) ["BOUNDS" | "GEOMETRY" | 'etc.'] from initializeOnly SFString field named intersectionType.boolean
Provide boolean value from outputOnly SFBool field named isActive.Provide String enumeration value (baseType xs:NMTOKEN) ["MATCH_ANY" | "MATCH_EVERY" | "MATCH_ONLY_ONE"] from inputOutput SFString field named matchCriterion.Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.String[]
Provide array of String enumeration results with quoted value(s) ["ALL","NONE","TERRAIN",...] from inputOutput MFString field named objectType.X3DNode[]
Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) from outputOnly MFNode field pickedGeometry.float[]
Provide array of 3-tuple float results from outputOnly MFVec3f field named pickedPoint.Provide org.web3d.x3d.sai.Rendering.X3DGeometryNode instance (using a properly typed node) from inputOutput SFNode field pickingGeometry.X3DNode[]
Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) with acceptable node types limited to X3DGroupingNode|X3DShapeNode|Inline, from inputOutput MFNode field pickTarget.Provide String enumeration value (baseType xs:NMTOKEN) ["ANY" | "CLOSEST" | "ALL" | "ALL_SORTED" | 'etc.'] from initializeOnly SFString field named sortOrder.setDescription
(String newValue) Accessor method to assign String value to inputOutput SFString field named description.setEnabled
(boolean newValue) Accessor method to assign boolean value to inputOutput SFBool field named enabled.setIntersectionType
(String newValue) Accessor method to assign String enumeration value ("BOUNDS" | "GEOMETRY") to initializeOnly SFString field named intersectionType.setMatchCriterion
(String newValue) Accessor method to assign String enumeration value ("MATCH_ANY" | "MATCH_EVERY" | "MATCH_ONLY_ONE") to inputOutput SFString field named matchCriterion.setMetadata
(X3DMetadataObject newValue) Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.setObjectType
(String[] newValue) Accessor method to assign String enumeration array (""ALL"" | ""NONE"" | ""TERRAIN"") to inputOutput MFString field named objectType.setPickingGeometry
(X3DGeometryNode newValue) Accessor method to assign org.web3d.x3d.sai.Rendering.X3DGeometryNode instance (using a properly typed node) to inputOutput SFNode field pickingGeometry.void
setPickTarget
(X3DNode newValue) Set single child pickTarget node, replacing prior array of existing nodes (if any).setPickTarget
(X3DNode[] newValue) Accessor method to assign org.web3d.x3d.sai.Core.X3DNode array (using an array consisting of properly typed nodes or ProtoInstances) to inputOutput MFNode field pickTarget.setSortOrder
(String newValue) Accessor method to assign String enumeration value ("ANY" | "CLOSEST" | "ALL" | "ALL_SORTED") to initializeOnly SFString field named sortOrder.
-
Method Details
-
getDescription
String getDescription()Provide String value from inputOutput SFString field named description.
Tooltip: Author-provided prose that describes intended purpose of the node.- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Specified by:
getDescription
in interfaceX3DPickSensorNode
- Specified by:
getDescription
in interfaceX3DSensorNode
- Returns:
- value of description field
-
setDescription
Accessor method to assign String value to inputOutput SFString field named description.
Tooltip: Author-provided prose that describes intended purpose of the node.- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Specified by:
setDescription
in interfaceX3DPickSensorNode
- Specified by:
setDescription
in interfaceX3DSensorNode
- Parameters:
newValue
- is new value for the description field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getEnabled
boolean getEnabled()Provide boolean value from inputOutput SFBool field named enabled.
Tooltip: Enables/disables node operation. *- Specified by:
getEnabled
in interfaceX3DPickSensorNode
- Specified by:
getEnabled
in interfaceX3DSensorNode
- Returns:
- value of enabled field
-
setEnabled
Accessor method to assign boolean value to inputOutput SFBool field named enabled.
Tooltip: Enables/disables node operation. *- Specified by:
setEnabled
in interfaceX3DPickSensorNode
- Specified by:
setEnabled
in interfaceX3DSensorNode
- Parameters:
newValue
- is new value for the enabled field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getIntersectionType
String getIntersectionType()Provide String enumeration value (baseType xs:NMTOKEN) ["BOUNDS" | "GEOMETRY" | 'etc.'] from initializeOnly SFString field named intersectionType.
Tooltip: intersectionType specifies precision of the collision computation.- Hint: intersectionType constants may be extended by the browser to provide additional options.
- Warning: do not wrap extra quotation marks around these SFString enumeration values, since "quotation" "marks" are only used for MFString values.
- Specified by:
getIntersectionType
in interfaceX3DPickSensorNode
- Returns:
- value of intersectionType field
-
setIntersectionType
Accessor method to assign String enumeration value ("BOUNDS" | "GEOMETRY") to initializeOnly SFString field named intersectionType.
Tooltip: intersectionType specifies precision of the collision computation.- Hint: intersectionType constants may be extended by the browser to provide additional options.
- Warning: do not wrap extra quotation marks around these SFString enumeration values, since "quotation" "marks" are only used for MFString values.
- Specified by:
setIntersectionType
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the intersectionType field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getIsActive
boolean getIsActive()Provide boolean value from outputOnly SFBool field named isActive.
Tooltip: isActive indicates when the intersecting object is picked by the picking geometry. Output event isActive=true gets sent once a picked item is found. Output event isActive=false gets sent once no picked item is found.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Specified by:
getIsActive
in interfaceX3DPickSensorNode
- Specified by:
getIsActive
in interfaceX3DSensorNode
- Returns:
- value of isActive field
-
getMatchCriterion
String getMatchCriterion()Provide String enumeration value (baseType xs:NMTOKEN) ["MATCH_ANY" | "MATCH_EVERY" | "MATCH_ONLY_ONE"] from inputOutput SFString field named matchCriterion.
Tooltip: defines whether the intersection test (i.e. pick) by this X3DPickSensorNode must match one or more objectType. Specifically MATCH_ANY means any match of objectType values is acceptable, MATCH_EVERY means that every objectType value in this node shall match an objectType value in the X3DPickableObject, and MATCH_ONLY_ONE means that one and only one objectType value can match. *- Specified by:
getMatchCriterion
in interfaceX3DPickSensorNode
- Returns:
- value of matchCriterion field
-
setMatchCriterion
Accessor method to assign String enumeration value ("MATCH_ANY" | "MATCH_EVERY" | "MATCH_ONLY_ONE") to inputOutput SFString field named matchCriterion.
Tooltip: defines whether the intersection test (i.e. pick) by this X3DPickSensorNode must match one or more objectType. Specifically MATCH_ANY means any match of objectType values is acceptable, MATCH_EVERY means that every objectType value in this node shall match an objectType value in the X3DPickableObject, and MATCH_ONLY_ONE means that one and only one objectType value can match. *- Specified by:
setMatchCriterion
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the matchCriterion field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getMetadata
X3DMetadataObject getMetadata()Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
getMetadata
in interfaceX3DChildNode
- Specified by:
getMetadata
in interfaceX3DNode
- Specified by:
getMetadata
in interfaceX3DPickSensorNode
- Specified by:
getMetadata
in interfaceX3DSensorNode
- Returns:
- value of metadata field
- See Also:
-
setMetadata
Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
setMetadata
in interfaceX3DChildNode
- Specified by:
setMetadata
in interfaceX3DNode
- Specified by:
setMetadata
in interfaceX3DPickSensorNode
- Specified by:
setMetadata
in interfaceX3DSensorNode
- Parameters:
newValue
- is new value for the metadata field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).- See Also:
-
getObjectType
String[] getObjectType()Provide array of String enumeration results with quoted value(s) ["ALL","NONE","TERRAIN",...] from inputOutput MFString field named objectType.
Tooltip: The objectType field specifies a set of labels used in the picking process. Each string specified is treated as an independent label that needs to be matched against the same type in one of the pick sensor instances. Example: labeling a PickableGroup with the objectType value "WATER" and then attempting to intersect a pick sensor with objectType value "GROUND" fails since the objectType values do not match. Example: the special value "ALL" means that each node is available for picking regardless of the type specified by the pick sensor. Example: the special value "NONE" effectively disables all picking for this node and is the equivalent of setting the pickable field of the corresponding PickableGroup to false.- Hint: authors may define any value for objectType.
- Hint: MFString arrays can have multiple values, so "separate each individual string" "by using quote marks".
- Specified by:
getObjectType
in interfaceX3DPickSensorNode
- Returns:
- value of objectType field
-
setObjectType
Accessor method to assign String enumeration array (""ALL"" | ""NONE"" | ""TERRAIN"") to inputOutput MFString field named objectType.
Tooltip: The objectType field specifies a set of labels used in the picking process. Each string specified is treated as an independent label that needs to be matched against the same type in one of the pick sensor instances. Example: labeling a PickableGroup with the objectType value "WATER" and then attempting to intersect a pick sensor with objectType value "GROUND" fails since the objectType values do not match. Example: the special value "ALL" means that each node is available for picking regardless of the type specified by the pick sensor. Example: the special value "NONE" effectively disables all picking for this node and is the equivalent of setting the pickable field of the corresponding PickableGroup to false.- Hint: authors may define any value for objectType.
- Hint: MFString arrays can have multiple values, so "separate each individual string" "by using quote marks".
- Specified by:
setObjectType
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the objectType field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getPickedGeometry
X3DNode[] getPickedGeometry()Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) from outputOnly MFNode field pickedGeometry.
Tooltip: Output event containing the node or nodes that have been found to intersect with the picking geometry from the last time this node performed a picking operation, given in the local coordinate system.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
Warning: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to X3DChildNode.- Specified by:
getPickedGeometry
in interfaceX3DPickSensorNode
- Returns:
- value of pickedGeometry field
- See Also:
-
getPickedPoint
float[] getPickedPoint()Provide array of 3-tuple float results from outputOnly MFVec3f field named pickedPoint.
Tooltip: Output event containing 3D points on surface of underlying pickingGeometry computed by the picking intersection computations, given in the local coordinate system.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of pickedPoint field
-
getPickingGeometry
X3DGeometryNode getPickingGeometry()Provide org.web3d.x3d.sai.Rendering.X3DGeometryNode instance (using a properly typed node) from inputOutput SFNode field pickingGeometry.
Tooltip: [PointSet] pickingGeometry specifies the exact geometry coordinates that are used to perform the intersection testing of the picking operation. *- Specified by:
getPickingGeometry
in interfaceX3DPickSensorNode
- Returns:
- value of pickingGeometry field
-
setPickingGeometry
Accessor method to assign org.web3d.x3d.sai.Rendering.X3DGeometryNode instance (using a properly typed node) to inputOutput SFNode field pickingGeometry.
Tooltip: [PointSet] pickingGeometry specifies the exact geometry coordinates that are used to perform the intersection testing of the picking operation. *- Specified by:
setPickingGeometry
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the pickingGeometry field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getPickTarget
X3DNode[] getPickTarget()Provide array of org.web3d.x3d.sai.Core.X3DNode results (using an array consisting of properly typed nodes or ProtoInstances) with acceptable node types limited to X3DGroupingNode|X3DShapeNode|Inline, from inputOutput MFNode field pickTarget.
Tooltip: [X3DGroupingNode|X3DShapeNode|Inline] pickTarget specifies the list of nodes against which picking operations are performed. All nodes declared in this field and their descendents are evaluated for intersections. *
Warning: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to X3DGroupingNode|X3DShapeNode|Inline.- Specified by:
getPickTarget
in interfaceX3DPickSensorNode
- Returns:
- value of pickTarget field
- See Also:
-
setPickTarget
Accessor method to assign org.web3d.x3d.sai.Core.X3DNode array (using an array consisting of properly typed nodes or ProtoInstances) to inputOutput MFNode field pickTarget.
Tooltip: [X3DGroupingNode|X3DShapeNode|Inline] pickTarget specifies the list of nodes against which picking operations are performed. All nodes declared in this field and their descendents are evaluated for intersections. *
Note: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to X3DGroupingNode|X3DShapeNode|Inline.- Specified by:
setPickTarget
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the pickTarget field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
addPickTarget
Add array of child pickTarget nodes to array of existing nodes (if any).
Note: according to X3D Unified Object Model (X3DUOM), acceptable node types are limited to X3DGroupingNode|X3DShapeNode|Inline.- Specified by:
addPickTarget
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value array to be appended the pickTarget field.
-
setPickTarget
Set single child pickTarget node, replacing prior array of existing nodes (if any).- Specified by:
setPickTarget
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new node for the pickTarget field
-
getSortOrder
String getSortOrder()Provide String enumeration value (baseType xs:NMTOKEN) ["ANY" | "CLOSEST" | "ALL" | "ALL_SORTED" | 'etc.'] from initializeOnly SFString field named sortOrder.
Tooltip: The sortOrder field determines the order provided for picked output events. Example: ANY means any single object that can satisfy picking conditions for this pick sensor. Consistency of results is not guaranteed. Example: ALL means that every object that satisfies the picking conditions for this pick sensor shall be returned. Example: ALL_SORTED means that every object that satisfies the picking conditions for this pick sensor shall be returned with the order of the output fields provided in a distance-sorted order from closest to farthest away. The exact algorithm for sorting is defined by the individual node definitions. Example: CLOSEST means that the closest object by distance that satisfies the conditions of this pick sensor. *The exact algorithm for distance determination shall be defined by individual node definitions*.- Hint: browser implementations may define additional values and algorithms beyond these four required values.
- Warning: do not wrap extra quotation marks around these SFString enumeration values, since "quotation" "marks" are only used for MFString values.
- Specified by:
getSortOrder
in interfaceX3DPickSensorNode
- Returns:
- value of sortOrder field
-
setSortOrder
Accessor method to assign String enumeration value ("ANY" | "CLOSEST" | "ALL" | "ALL_SORTED") to initializeOnly SFString field named sortOrder.
Tooltip: The sortOrder field determines the order provided for picked output events. Example: ANY means any single object that can satisfy picking conditions for this pick sensor. Consistency of results is not guaranteed. Example: ALL means that every object that satisfies the picking conditions for this pick sensor shall be returned. Example: ALL_SORTED means that every object that satisfies the picking conditions for this pick sensor shall be returned with the order of the output fields provided in a distance-sorted order from closest to farthest away. The exact algorithm for sorting is defined by the individual node definitions. Example: CLOSEST means that the closest object by distance that satisfies the conditions of this pick sensor. *The exact algorithm for distance determination shall be defined by individual node definitions*.- Hint: browser implementations may define additional values and algorithms beyond these four required values.
- Warning: do not wrap extra quotation marks around these SFString enumeration values, since "quotation" "marks" are only used for MFString values.
- Specified by:
setSortOrder
in interfaceX3DPickSensorNode
- Parameters:
newValue
- is new value for the sortOrder field.- Returns:
PointPickSensor
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-