Nori  23
Shape Class Referenceabstract

Superclass of all shapes. More...

#include <shape.h>

Inheritance diagram for Shape:
Collaboration diagram for Shape:

Public Member Functions

virtual ~Shape ()
 Release all memory.
 
virtual void addChild (NoriObject *child) override
 Add a child object to the current instance. More...
 
virtual void activate () override
 Initialize internal data structures (called once by the XML parser)
 
const BoundingBox3fgetBoundingBox () const
 
bool isEmitter () const
 Is this mesh an area emitter?
 
EmittergetEmitter ()
 Return a pointer to an attached area emitter instance.
 
const EmittergetEmitter () const
 Return a pointer to an attached area emitter instance (const version)
 
const BSDFgetBSDF () const
 Return a pointer to the BSDF associated with this mesh.
 
virtual uint32_t getPrimitiveCount () const
 Return the total number of primitives in this shape.
 
virtual BoundingBox3f getBoundingBox (uint32_t index) const =0
 
virtual Point3f getCentroid (uint32_t index) const =0
 
virtual bool rayIntersect (uint32_t index, const Ray3f &ray, float &u, float &v, float &t) const =0
 
virtual void setHitInformation (uint32_t index, const Ray3f &ray, Intersection &its) const =0
 Set the intersection information: hit point, shading frame, UVs, etc.
 
virtual void sampleSurface (ShapeQueryRecord &sRec, const Point2f &sample) const =0
 Sample a point on the surface (potentially using the point sRec.ref to importance sample) This method should set sRec.p, sRec.n and sRec.pdf Probability should be with respect to area.
 
virtual float pdfSurface (const ShapeQueryRecord &sRec) const =0
 Return the probability of sampling a point sRec.p by the sampleSurface() method (sRec.ref should be set before) sRec.n and sRec.pdf are ignored.
 
virtual EClassType getClassType () const override
 Return the type of object (i.e. Mesh/BSDF/etc.) provided by this instance.
 
- Public Member Functions inherited from NoriObject
virtual ~NoriObject ()
 Virtual destructor.
 
virtual void setParent (NoriObject *parent)
 Set the parent object. More...
 
virtual std::string toString () const =0
 Return a brief string summary of the instance (for debugging purposes)
 
void setIdName (const std::string &name)
 Allow to assign a name to the object.
 
const std::string & getIdName () const
 

Protected Attributes

BSDFm_bsdf = nullptr
 BSDF of the surface.
 
Emitterm_emitter = nullptr
 Associated emitter, if any.
 
BoundingBox3f m_bbox
 Bounding box of the mesh.
 
- Protected Attributes inherited from NoriObject
std::string m_idname
 

Additional Inherited Members

- Public Types inherited from NoriObject
enum  EClassType {
  EScene = 0 , EMesh , ETexture , EBSDF ,
  EPhaseFunction , EEmitter , EMedium , ECamera ,
  EIntegrator , ESampler , ETest , EReconstructionFilter ,
  EClassTypeCount
}
 
- Static Public Member Functions inherited from NoriObject
static std::string classTypeName (EClassType type)
 Turn a class type into a human-readable string.
 

Detailed Description

Superclass of all shapes.

Definition at line 97 of file shape.h.

Member Function Documentation

◆ addChild()

void Shape::addChild ( NoriObject child)
overridevirtual

Add a child object to the current instance.

The default implementation does not support children and simply throws an exception

Reimplemented from NoriObject.

Definition at line 41 of file shape.cpp.


The documentation for this class was generated from the following files: