MDL SDK API nvidia_logo_transpbg.gif Up
ibsdf_measurement.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IBSDF_MEASUREMENT_H
8#define MI_NEURAYLIB_IBSDF_MEASUREMENT_H
9
11
12namespace mi {
13
14namespace neuraylib {
15
16class IBsdf_isotropic_data;
17class IReader;
18
37 public base::Interface_declare<0xa05e5a42,0x3f74,0x4ad9,0x8e,0xa9,0x17,0x4f,0x97,0x52,0x39,0x8a,
38 neuraylib::IScene_element>
39{
40public:
54 virtual Sint32 reset_file( const char* filename) = 0;
55
64 virtual Sint32 reset_reader( IReader* reader) = 0;
65
73 virtual const char* get_filename() const = 0;
74
81 virtual const char* get_original_filename() const = 0;
82
90 virtual Sint32 set_reflection( const IBsdf_isotropic_data* bsdf_data) = 0;
91
97 virtual const base::IInterface* get_reflection() const = 0;
98
112 template<class T>
113 const T* get_reflection() const
114 {
115 const base::IInterface* ptr_iinterface = get_reflection();
116 if( !ptr_iinterface)
117 return 0;
118 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
119 ptr_iinterface->release();
120 return ptr_T;
121 }
122
130 virtual Sint32 set_transmission( const IBsdf_isotropic_data* bsdf_data) = 0;
131
137 virtual const base::IInterface* get_transmission() const = 0;
138
152 template<class T>
153 const T* get_transmission() const
154 {
155 const base::IInterface* ptr_iinterface = get_transmission();
156 if( !ptr_iinterface)
157 return 0;
158 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
159 ptr_iinterface->release();
160 return ptr_T;
161 }
162};
163 // end group mi_neuray_misc
165
166} // namespace neuraylib
167
168} // namespace mi
169
170#endif // MI_NEURAYLIB_IBSDF_MEASUREMENT_H
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for isotropic BSDF data.
Definition: ibsdf_isotropic_data.h:44
A scene element that stores measured BSDF data.
Definition: ibsdf_measurement.h:39
virtual const base::IInterface * get_reflection() const =0
Returns the BSDF data for the reflection.
const T * get_transmission() const
Returns the BSDF data for transmission.
Definition: ibsdf_measurement.h:153
virtual Sint32 reset_reader(IReader *reader)=0
Sets the BSDF measurement to the data provided by a reader.
virtual const char * get_original_filename() const =0
Returns the unresolved file name as passed to reset_file().
virtual const char * get_filename() const =0
Returns the resolved file name of the file containing the BSDF measurement.
virtual Sint32 reset_file(const char *filename)=0
Sets the BSDF measurement to a file identified by filename.
const T * get_reflection() const
Returns the BSDF data for reflection.
Definition: ibsdf_measurement.h:113
virtual Sint32 set_reflection(const IBsdf_isotropic_data *bsdf_data)=0
Sets the BSDF data for the reflection.
virtual Sint32 set_transmission(const IBsdf_isotropic_data *bsdf_data)=0
Sets the BSDF data for transmission.
virtual const base::IInterface * get_transmission() const =0
Returns the BSDF data for transmission.
A reader supports binary block reads and string-oriented line reads that zero-terminate the result.
Definition: ireader.h:27
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5