19 #include <nori/shape.h>
20 #include <nori/bsdf.h>
21 #include <nori/emitter.h>
46 "Shape: tried to register multiple BSDF instances!");
53 "Shape: tried to register multiple Emitter instances!");
59 throw NoriException(
"Shape::addChild(<%s>) is not supported!",
66 return "Intersection[invalid]";
Superclass of all bidirectional scattering distribution functions.
Superclass of all emitters.
void setShape(Shape *shape)
Set the shape if the emitter is attached to a shape.
Simple exception class, which stores a human-readable error description.
static NoriObject * createInstance(const std::string &name, const PropertyList &propList)
Construct an instance from the class of the given name.
Base class of all objects.
virtual void activate()
Perform some action associated with the object.
virtual std::string toString() const =0
Return a brief string summary of the instance (for debugging purposes)
static std::string classTypeName(EClassType type)
Turn a class type into a human-readable string.
virtual EClassType getClassType() const =0
Return the type of object (i.e. Mesh/BSDF/etc.) provided by this instance.
This is an associative container used to supply the constructors of NoriObject subclasses with parame...
Superclass of all shapes.
virtual void addChild(NoriObject *child) override
Add a child object to the current instance.
virtual void activate() override
Initialize internal data structures (called once by the XML parser)
BSDF * m_bsdf
BSDF of the surface.
Emitter * m_emitter
Associated emitter, if any.
virtual ~Shape()
Release all memory.
std::string toString() const
Return a human-readable string summary of this frame.
const Shape * mesh
Pointer to the associated shape.
std::string toString() const
Return a human-readable summary of the intersection record.
Frame shFrame
Shading frame (based on the shading normal)
float t
Unoccluded distance along the ray.
Frame geoFrame
Geometric frame (based on the true geometry)
Point3f p
Position of the surface intersection.
Point2f uv
UV coordinates, if any.
std::string toString() const
Return a human-readable string summary.