MDL SDK API nvidia_logo_transpbg.gif Up
ibsdf_measurement.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2022 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:
53 virtual Sint32 reset_file( const char* filename) = 0;
54
63 virtual Sint32 reset_reader( IReader* reader) = 0;
64
72 virtual const char* get_filename() const = 0;
73
80 virtual const char* get_original_filename() const = 0;
81
89 virtual Sint32 set_reflection( const IBsdf_isotropic_data* bsdf_data) = 0;
90
96 virtual const base::IInterface* get_reflection() const = 0;
97
111 template<class T>
112 const T* get_reflection() const
113 {
114 const base::IInterface* ptr_iinterface = get_reflection();
115 if( !ptr_iinterface)
116 return 0;
117 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
118 ptr_iinterface->release();
119 return ptr_T;
120 }
121
129 virtual Sint32 set_transmission( const IBsdf_isotropic_data* bsdf_data) = 0;
130
136 virtual const base::IInterface* get_transmission() const = 0;
137
151 template<class T>
152 const T* get_transmission() const
153 {
154 const base::IInterface* ptr_iinterface = get_transmission();
155 if( !ptr_iinterface)
156 return 0;
157 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
158 ptr_iinterface->release();
159 return ptr_T;
160 }
161};
162 // end group mi_neuray_misc
164
165} // namespace neuraylib
166
167} // namespace mi
168
169#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:152
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:112
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:44
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5