1#ifndef _BBM_BSDF_PTR_H_
2#define _BBM_BSDF_PTR_H_
20 template<
typename CONF>
requires concepts::config<CONF>
73 return (*this)->eval(in, out, component, unit, mask);
90 return (*this)->sample(out, xi, component, unit, mask);
106 return (*this)->pdf(in, out, component, unit, mask);
121 return (*this)->reflectance(out, component, unit, mask);
128 virtual std::string
toString(
void)
const override final
130 return (*this)->toString();
138 return (*this)->parameter_values(flags);
143 return (*this)->parameter_values(flags);
148 return (*this)->parameter_default_values(flags);
153 return (*this)->parameter_lower_bound(flags);
158 return (*this)->parameter_upper_bound(flags);
182 auto ptr = std::make_shared<BSDFTYPE>(
args...);
195 template<
typename BSDFMODEL,
typename... ARGS>
requires (concepts::bsdfmodel<BSDFMODEL> && !concepts::bsdf<BSDFMODEL>)
198 auto ptr = std::make_shared<bsdf<BSDFMODEL>>(
args...);
210 template<
typename BSDFTYPE>
requires (concepts::bsdf<BSDFTYPE> && !concepts::bsdf_ptr<BSDFTYPE>)
213 auto ptr = std::make_shared<BSDFTYPE>(
arg);
225 template<
typename BSDFMODEL>
requires (concepts::bsdfmodel<BSDFMODEL> && !concepts::bsdf<BSDFMODEL>)
228 auto ptr = std::make_shared<bsdf<BSDFMODEL>>(
arg);
237 template<
typename CONF>
requires concepts::config<CONF>
Connects a BSDF model and a BSDF.
Pointer wrapper that takes handle both shared as well as regular (unmanaged) pointers.
Definition: pointer.h:28
Definition: vector_util.h:27
bsdf_ptr concpt
Definition: bsdf_ptr.h:24
bsdf concept
Definition: bsdf.h:29
Predefined exceptions for common errors.
#define bbm_incomplete_init
Definition: error.h:42
concept to check if a type has a valid string_converter.
#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 std::decay_t< T >::Config get_config
get_config type trait
Definition: config.h:49
bsdf_ptr< get_config< BSDFTYPE > > make_bsdf_ptr(ARGS... args)
Helper method for making a bsdf_ptr from a BSDF (new construction)
Definition: bsdf_ptr.h:180
bsdf_attr
Attribute Property Flags.
Definition: bsdf_attr_flag.h:17
unit_t
Light Unit.
Definition: unit.h:21
Forward declaration of bbm::arg.
Definition: arg.h:27
Pointer wrapper that takes both shared and non-shared pointers. If the pointer is 'managed' then the ...
Forward declaration.
Definition: args.h:248
Forward declaration.
Definition: bsdf_base.h:55
Definition: bsdf_ptr.h:22
virtual bbm::vector< Value > parameter_upper_bound(bsdf_attr flags=bsdf_attr::All) const override final
Definition: bsdf_ptr.h:156
virtual bbm::vector< Value > parameter_lower_bound(bsdf_attr flags=bsdf_attr::All) const override final
Definition: bsdf_ptr.h:151
virtual bbm::vector< Value > parameter_default_values(bsdf_attr flags=bsdf_attr::All) const override final
Definition: bsdf_ptr.h:146
virtual Value pdf(const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const override final
Pointer-dereference passthrough of the pdf function.
Definition: bsdf_ptr.h:104
virtual Spectrum eval(const Vec3d &in, const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const override final
Pointer-dereference passthrough of eval function.
Definition: bsdf_ptr.h:71
virtual BsdfSample sample(const Vec3d &out, const Vec2d &xi, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const override final
Pointer-derefence passthrough of sample function.
Definition: bsdf_ptr.h:88
BBM_BSDF_FORWARD
Definition: bsdf_ptr.h:26
bsdf_ptr(void)=default
Default (empty) constructor; shared_ptr is set to nullptr.
pointer< bsdf_base< Config > > _bsdf
shared_prt to the actual BSDF implementation.
Definition: bsdf_ptr.h:164
bsdf_ptr(const bsdf_ptr< CONF > &b)
Copy constructor.
Definition: bsdf_ptr.h:35
virtual bbm::vector< Value & > parameter_values(bsdf_attr flags=bsdf_attr::All) override final
Definition: bsdf_ptr.h:136
const pointer< bsdf_base< Config > > & ptr(void) const
Get the internal shared pointer.
Definition: bsdf_ptr.h:45
bsdf_ptr & operator=(const bsdf_ptr &b)
Assignment operator.
Definition: bsdf_ptr.h:38
const pointer< bsdf_base< Config > > & operator->(void)
Definition: bsdf_ptr.h:48
virtual bbm::vector< const Value & > parameter_values(bsdf_attr flags=bsdf_attr::All) const override final
Definition: bsdf_ptr.h:141
virtual Spectrum reflectance(const Vec3d &out, BsdfFlag component=bsdf_flag::All, unit_t unit=unit_t::Radiance, Mask mask=true) const override final
Pointer-dereference passthrough of the hemispherical reflectance function.
Definition: bsdf_ptr.h:119
static constexpr string_literal name
Definition: bsdf_ptr.h:25
pointer< const bsdf_base< Config > > operator->(void) const
Definition: bsdf_ptr.h:54
virtual std::string toString(void) const override final
Pointer-dereference passthrough of toString.
Definition: bsdf_ptr.h:128
bsdf_ptr(const pointer< bsdf_base< Config > > &ptr)
Construct from pointer.
Definition: bsdf_ptr.h:32
Definition: string_literal.h:16