NVIDIA IndeX API nvidia_logo_transpbg.gif Up
xac_interface_scene_elements_sparse_volume_doc.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
6
7namespace nv {
8namespace index {
9namespace xac {
10
15{
17};
18
22{
29};
30
33struct Data_point_access;
34
36template<typename T> T read_native_voxel(
37 const unsigned attrib_idx,
38 const Data_point_access& );
39
40
42template<typename T> void write_native_voxel(
43 const T& value,
44 const unsigned attrib_idx,
45 Data_point_access& );
46}
47
51{
53 template<typename T>
54 void write_value(const unsigned attrib_idx, const T& value) {
55 xac::write_native_voxel(value, attrib_idx, dp_access);
56 }
57};
58
62{
64 xac::Data_point_access& dp_access;
65
67 float3 position;
68
70 float3 get_position() const { return position; }
71
73 bool is_valid() const { return true; }
74};
75
78enum class Volume_filter_mode : unsigned
79{
80 NEAREST,
81 TRILINEAR,
82 TRICUBIC_CATMUL,
83 TRICUBIC_BSPLINE
84};
85
88enum class Volume_classification_mode : unsigned
89{
90 POST_INTERPOLATION,
91 PRE_INTERPOLATION
92};
93
96template<typename SVOL_attrib_type,
97 Volume_filter_mode SVOL_filter_mode,
98 Volume_classification_mode SVOL_classify_mode>
100{
101
102public:
103
111 SVOL_attrib_type fetch_sample(const float3& sample_position) const;
112
122 float4 fetch_sample_classify( const float3& sample_position,
123 const xac::Colormap& color_map) const;
124
125};
126
130{
131public:
133 typedef Sample_info_sparse_volume Base_info_type;
134
142 template<typename SVOL_attrib_type,
143 Volume_filter_mode SVOL_filter_mode = default_filter_mode,
144 Volume_classification_mode SVOL_classify_mode = default_classification_mode>
145 Sparse_volume_sampler<SVOL_attrib_type,
146 SVOL_filter_mode,
147 SVOL_classify_mode> generate_sampler(
148 const unsigned attrib_idx,
149 const Sparse_volume_sample_context& sample_context) const;
150
159 template<typename SVOL_attrib_type,
160 Volume_filter_mode SVOL_filter_mode = default_filter_mode,
161 Volume_classification_mode SVOL_classify_mode = default_classification_mode>
162 Sparse_volume_sampler<SVOL_attrib_type,
163 SVOL_filter_mode,
164 SVOL_classify_mode> generate_sampler(
165 const unsigned attrib_idx) const;
166
172
175
177 const float3& get_volume_bbox_min() const;
178
180 const float3& get_volume_bbox_max() const;
181
183 const Mat4x4f& get_scene_to_object_transform() const;
184
187
189 template<typename SVOL_attrib_type>
190 SVOL_attrib_type get_attribute(
191 const unsigned attrib_idx,
192 const Data_point_info_sparse_volume& data_point_info) const
193{
194
195};
196
197} // namespace xac
198} // namespace index
199} // namespace nv
Sparse volume sampler for retrieving filtered and optionally classified volume samples.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:100
SVOL_attrib_type fetch_sample(const float3 &sample_position) const
Sample a sparse volume attribute at the provided sample location.
float4 fetch_sample_classify(const float3 &sample_position, const xac::Colormap &color_map) const
Sample a sparse volume attribute at the provided sample location.
Sparse volume reference class.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:130
SVOL_attrib_type get_attribute(const unsigned attrib_idx, const Data_point_info_sparse_volume &data_point_info) const
Function to retrieve information on the current voxel during XAC compute operations.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:190
const Mat4x4f & get_scene_to_object_transform() const
Get the transformation matrix to transform from scene space to object space coordinates.
const float3 & get_volume_bbox_max() const
Get the sparse volume bounding box maximum coordinate.
Sparse_volume_sampler<SVOL_attrib_type, SVOL_filter_mode, SVOL_classify_mode> generate_sampler(const unsigned attrib_idx, const Sparse_volume_sample_context &sample_context) const
Generates a sparse volume sampler object of a given sample context for local sampling operations.
const Mat4x4f & get_scene_to_object_transform_inverse() const
Get the transformation matrix to transform from object space to scene space coordinates.
Sparse_volume_sampler<SVOL_attrib_type, SVOL_filter_mode, SVOL_classify_mode> generate_sampler(const unsigned attrib_idx) const
Generates a sparse volume sampler object without providing an existing sample context.
Sample_info_sparse_volume Base_info_type
Declaring the sparse volume sample info.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:133
float get_sample_distance() const const float3 &get_volume_bbox_min() const
Get distance of the current sample position to the camera.
xac::Colormap get_colormap() const
Get the colormap currently associated with the volume through the scene setup.
Colormap.
Definition: xac_interface_scene_elements_doc.h:139
Volume_classification_mode
Sparse volume sample classification modes.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:89
Volume_filter_mode
Sparse volume filter modes.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:79
void write_native_voxel(const T &value, const unsigned attrib_idx, Data_point_access &)
Function to write voxel.
T read_native_voxel(const unsigned attrib_idx, const Data_point_access &)
Function to read voxel.
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349
Struct to represent the information on a current voxel and its properties.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:62
float3 position
Position of the current grid voxel (in object space).
Definition: xac_interface_scene_elements_sparse_volume_doc.h:67
bool is_valid() const
Function to check that the current voxel entry is valid.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:73
float3 get_position() const
Function to retrieve the current voxel position.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:70
xac::Data_point_access & dp_access
Access class for stored voxel information.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:64
Output information for XAC compute programs.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:51
void write_value(const unsigned attrib_idx, const T &value)
Function to write a voxel value in a XAC compute program.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:54
Sample information for sparse volumes.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:22
float3 sample_position_object_space
Sample position in object space.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:28
Sparse_volume_sample_context sample_context
Sample context.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:24
float3 sample_position_object_space_normalized
Normalized sample position in object space.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:26
Generic ray sampling information.
Definition: xac_interface_sample_info_doc.h:16
Sparse volume sample context that stores internal information for validating sample information again...
Definition: xac_interface_scene_elements_sparse_volume_doc.h:15