NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::IScene_pick_result Class Referenceabstract

Interface class that returns the result of a pick operation. More...

#include <iscene_query_results.h>

Inherits mi::base::Interface_declare< 0x0e201838, ... >.

Public Member Functions

virtual mi::base::Uuid get_intersection_info_class () const =0
 Represents the interface class of the intersection info result. More...
 
virtual mi::neuraylib::Tag_struct get_scene_element () const =0
 Returns the intersected scene element's tag. More...
 
virtual mi::Sint32 get_scene_element_sub_index () const =0
 Returns the sub index that specifies which of the sub elements was hit, if any. More...
 
virtual const IData_sampleget_data_sample () const =0
 The hit point of the ray with the scene element may be associated with a regular volume sample value. More...
 
virtual const mi::math::Color_struct & get_color () const =0
 The hit point of the ray with the scene element may be associated with a color value. More...
 
virtual const mi::math::Vector_struct< mi::Float32, 3 > & get_intersection () const =0
 Returns the intersection between the scene element and the ray. More...
 
virtual mi::Float32 get_distance () const =0
 Returns the distance of the intersection from the camera position. More...
 
virtual const mi::math::Matrix_struct< mi::Float32, 4, 4 > & get_transform () const =0
 Returns the transformation matrix of the intersected scene element. More...
 
virtual const IScene_pathget_scene_path () const =0
 Returns the scene path from the scene root to the intersected scene element. More...
 

Detailed Description

Interface class that returns the result of a pick operation.

The interface class represents a single scene query result generated by a mouse over operation (a.k.a. 'pick' operation), i.e., by a ray starting from the scene's camera position cast through the scene.

Each query result gives information about the scene element hit by the ray. This information includes, for instance, the scene element's tag to clearly identify it and the intersection point in the scene element's IJK space.

Member Function Documentation

 get_color()

virtual const mi::math::Color_struct & nv::index::IScene_pick_result::get_color ( ) const
pure virtual

The hit point of the ray with the scene element may be associated with a color value.

For instance, a heightfield surface is typically rendered using a solid color that will be returned. In case of a slice scene element the ray-slice intersection determines a color value based on the voxel value and the colormap associated to the slice.

Returns
The color at the intersection point.

 get_data_sample()

virtual const IData_sample * nv::index::IScene_pick_result::get_data_sample ( ) const
pure virtual

The hit point of the ray with the scene element may be associated with a regular volume sample value.

For instance, a plane may visualize the voxel data values that the plane passes through. The ray-plane intersection then determines the regular voxel value of the dataset at the very position. Similarly, the data value of a heightfield surface that is textured based on the data values of an associated regular volume can also be determined.

Returns
Interface pointer to an IData_volume_sample instance representing, for example, a regular volume sample value related to the ray-element intersection. If the intersection is not related to any data value, then the returned pointer is 0.

 get_distance()

virtual mi::Float32 nv::index::IScene_pick_result::get_distance ( ) const
pure virtual

Returns the distance of the intersection from the camera position.

The distance from the camera's eye position to the intersection between the scene element and the cast ray.

Returns
The distance of the intersection point to the camera position in XYZ space.

 get_intersection()

virtual const mi::math::Vector_struct< mi::Float32, 3 > & nv::index::IScene_pick_result::get_intersection ( ) const
pure virtual

Returns the intersection between the scene element and the ray.

The intersection between the scene element and the ray cast from the camera through the scene is given as a 3D point in the IJK space of the scene element.

Returns
The intersection between the scene element and the ray cast from the camera in IJK space.

 get_intersection_info_class()

virtual mi::base::Uuid nv::index::IScene_pick_result::get_intersection_info_class ( ) const
pure virtual

Represents the interface class of the intersection info result.

Typically, an intersection result including its intersection information are highly dependent on the intersected shape class. For instance, intersecting (1) a line segments part of a set of line segments should return the index that that line segment in the line set, or intersecting (2) a triangular mesh should expose not only the index of the intersected triangle but also the adjacent vertices and possibly the according per-vertex attributes. The intersection result interfaces class IScene_pick_result provides just very basic intersection information such as the tag of the intersected shape, the intersection point in local space, and distance from the camera position in world space. Additional shape-specific intersection information are supposed to be provided derived (interface) classes. The UUID returned by get_intersection_info_class provides the application with the necessary interface class id required for proper casting the general intersection information interface class to the shape-specific intersection information interface class if additional shape-specific details for the intersection are required.

Returns
Unique UUID of the shape-specific intersection result interface class. By default, the UUID refers to this default intersection info interface.

 get_scene_element()

virtual mi::neuraylib::Tag_struct nv::index::IScene_pick_result::get_scene_element ( ) const
pure virtual

Returns the intersected scene element's tag.

Each scene element is clearly defined by its unique tag. Thus, the tag returned by the query result unambiguously defines which scene element has been hit by the cast ray.

Returns
The tag of the hit scene element. The returned tag shall be always valid.

 get_scene_element_sub_index()

virtual mi::Sint32 nv::index::IScene_pick_result::get_scene_element_sub_index ( ) const
pure virtual

Returns the sub index that specifies which of the sub elements was hit, if any.

Some scene elements such as point geometry consist of multiple sub elements (i.e. individual points).

Deprecated:
Use the methods provided by specializations of this class, e.g. IPoint_set_pick_result.
Returns
The index of the hit sub element, or -1 if the scene element has not sub elements.

 get_scene_path()

virtual const IScene_path * nv::index::IScene_pick_result::get_scene_path ( ) const
pure virtual

Returns the scene path from the scene root to the intersected scene element.

Note
Use the mi::base::Handle template to store the returned interface pointer in order to guarantee the correct destruction of the returned interface.
Returns
Scene path to intersected scene element.

 get_transform()

virtual const mi::math::Matrix_struct< mi::Float32, 4, 4 > & nv::index::IScene_pick_result::get_transform ( ) const
pure virtual

Returns the transformation matrix of the intersected scene element.

This is the transformation that needs to be applied to the intersection point (as returned by get_intersection()) to transform from IJK to XYZ space.

Note
The name of this method is subject to change!
Returns
Transformation matrix.

The documentation for this class was generated from the following file: