Loading...
Searching...
No Matches
fresnel.h
Go to the documentation of this file.
1#ifndef _BBM_FRESNEL_CONCEPT_H_
2#define _BBM_FRESNEL_CONCEPT_H_
3
4#include "bbm/config.h"
5#include "core/ior.h"
6
7/************************************************************************/
8/*! \file fresnel.h
9
10 \brief fresnel contract
11
12*************************************************************************/
13
14namespace bbm {
15 namespace concepts {
16
17 /*******************************************************************/
18 /*! \brief fresnel concept
19
20 Each fresnel implementation has:
21 + concepts::has_config
22 + typename parameter_type
23 + static Value|Spectrum eval(const parameter_type& eta, const Value& cosTheta, Mask Mask=true)
24
25 *********************************************************************/
26 template<typename Fresnel>
27 concept fresnel = requires
28 {
30 typename std::decay_t<Fresnel>::parameter_type;
31
32 //! \brief eval method
33 { std::decay_t<Fresnel>::eval( std::declval<typename std::decay_t<Fresnel>::parameter_type>(), std::declval<Value_t<Fresnel>>(), std::declval<Mask_t<Fresnel>>() ) } -> concepts::same_as_any<Value_t<Fresnel>, Spectrum_t<Fresnel>>;
34
35 //! \brief eval method with defaulted mask
36 { std::decay_t<Fresnel>::eval( std::declval<typename std::decay_t<Fresnel>::parameter_type>(), std::declval<Value_t<Fresnel>>() ) } -> concepts::same_as_any<Value_t<Fresnel>, Spectrum_t<Fresnel>>;
37 };
38
39 /********************************************************************/
40 /*! \brief fresnel archetype for concept checking
41
42 \tparam CONF = config to check for. Default value = archetype::config
43 \tparam PARAM = parameter type (ior)
44 *********************************************************************/
45 namespace archetype {
46 template<typename CONF=config, typename PARAM=ior::ior<Value_t<CONF>>> requires concepts::config<CONF> && ior::is_ior_type<PARAM>
47 struct fresnel
48 {
49 using Config = CONF;
50 using parameter_type = PARAM;
51 static Value_t<Config> eval(parameter_type, Value_t<Config>, Mask_t<Config> = true);
52 };
53 } // end archetype namespace
54
56
57 } // end concepts namespace
58} // end bbm namespace
59
60#endif /* _BBM_FRESNEL_CONCEPT_H_ */
All BBM methods are defined to operate on a variety of value types and spectrum types....
config concept
Definition: config.h:31
fresnel concept
Definition: fresnel.h:27
has_config
Definition: config.h:53
true if type is the same as any of the listed types
Definition: util.h:31
Definition: ior.h:47
Defines 'ior' and 'reflectance' types.
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
Definition: aggregatebsdf.h:29
typename get_config< T >::Value Value_t
Definition: config.h:67
Definition: fresnel.h:48
static Value_t< Config > eval(parameter_type, Value_t< Config >, Mask_t< Config >=true)
PARAM parameter_type
Definition: fresnel.h:50
CONF Config
Definition: fresnel.h:49