27 std::vector<const Material*> result;
29 result.push_back(p_material);
31 if (
const auto* sample =
dynamic_cast<const ISampleNode*
>(child)) {
32 for (
const Material* p_material : sample->containedMaterials())
33 result.push_back(p_material);
42 return std::any_of(materials.cbegin(), materials.cend(),
43 [](
const Material* mat) { return mat->isMagneticMaterial(); });
Defines interface class ISampleNode.
Defines and implements class Material.
Base class for tree-like structures containing parameterized objects.
virtual std::vector< const INode * > nodeChildren() const
Returns all children.
Abstract base class for sample components and properties related to scattering.
std::vector< const Material * > containedMaterials() const
Returns set of unique materials contained in this ISampleNode.
bool isMagnetic() const
Returns true if there is any magnetic material in this ISampleNode.
virtual const Material * material() const
Returns nullptr, unless overwritten to return a specific material.
A wrapper for underlying material implementation.