4#include "pybind11/pybind11.h"
5namespace py = pybind11;
27 template<
typename ARGS,
bool TYPE=false>
requires is_args_v<ARGS>
34 using arg = std::decay_t<decltype(std::declval<ARGS>().template get<idx>())>;
36 if constexpr (idx != 0) result +=
", ";
39 if constexpr (TYPE) result +=
bbm::toString(typestring<typename arg::type>) +
" ";
42 if constexpr (arg::name.empty) result +=
"<unnamed>";
46 if constexpr (std::is_constructible_v<arg>)
72 std::string msg =
"Constructs: " + name +
"(" + args_to_string<typename BSDFMODEL::constructor_args_t>() +
")";
75 m.def(name.c_str(), [](py::args
args, py::kwargs kwargs)
78 return make_bsdf_ptr( create_object<BSDFMODEL>(args, kwargs) );
Connects a BSDF model and a BSDF.
A shared_ptr wrapper for bsdfs.
bsdfmodel concept
Definition: bsdfmodel.h:33
constructor concept
Definition: constructor.h:23
#define CONSTFOR(IDX, NUMITR,...)
HELPER MACRO.
Definition: constfor.h:63
concept to check if a type has a valid string_converter.
std::string args_to_string(void)
Provide a human readable string of an bbm::args type.
Definition: py_bsdf.h:28
void def_bsdf(py::module &m)
export a BSDF model to Python
Definition: py_bsdf.h:67
Definition: aggregatebsdf.h:29
std::string toString(const T &)
toString alias
Definition: stringconvert.h:594
decltype(auto) value(T &&t)
return the value of an attribute, or if not an attribute the object
Definition: attribute_value.h:20
Forward declaration of bbm::arg.
Definition: arg.h:27
Create an object with a bbm constructor (with bbm::args) from py::args and py::kwargs arguments.
Forward declaration.
Definition: args.h:248
produce stringview of type name of a type. Avoids using typeid for GCC, MSVC, and CLANG....