Nori  24
NoriObject Class Referenceabstract

Base class of all objects. More...

#include <object.h>

Inheritance diagram for NoriObject:

Public Types

enum  EClassType {
  EScene = 0 , EMesh , ETexture , EBSDF ,
  EPhaseFunction , EEmitter , EMedium , ECamera ,
  EIntegrator , ESampler , ETest , EReconstructionFilter ,
  EClassTypeCount
}
 

Public Member Functions

virtual ~NoriObject ()
 Virtual destructor.
 
virtual EClassType getClassType () const =0
 Return the type of object (i.e. Mesh/BSDF/etc.) provided by this instance.
 
virtual void addChild (NoriObject *child)
 Add a child object to the current instance. More...
 
virtual void setParent (NoriObject *parent)
 Set the parent object. More...
 
virtual void activate ()
 Perform some action associated with the 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
 

Static Public Member Functions

static std::string classTypeName (EClassType type)
 Turn a class type into a human-readable string.
 

Protected Attributes

std::string m_idname
 

Detailed Description

Base class of all objects.

A Nori object represents an instance that is part of a scene description, e.g. a scattering model or emitter.

Definition at line 32 of file object.h.

Member Function Documentation

◆ activate()

virtual void NoriObject::activate ( )
inlinevirtual

Perform some action associated with the object.

The default implementation throws an exception. Certain objects may choose to override it, e.g. to implement initialization, testing, or rendering functionality.

This function is called by the XML parser once it has constructed an object and added all of its children using addChild().

Reimplemented in StudentsTTest, PerspectiveCamera, Diffuse, ChiSquareTest, Shape, Scene, and Mesh.

Definition at line 107 of file object.h.

◆ addChild()

virtual void NoriObject::addChild ( NoriObject child)
inlinevirtual

Add a child object to the current instance.

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

Reimplemented in StudentsTTest, PerspectiveCamera, Diffuse, ChiSquareTest, Scene, and Shape.

Definition at line 81 of file object.h.

◆ setParent()

virtual void NoriObject::setParent ( NoriObject parent)
inlinevirtual

Set the parent object.

Subclasses may choose to override this method to be notified when they are added to a parent object. The default implementation does nothing.

Definition at line 94 of file object.h.


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