Path Tracer
Public Member Functions | List of all members
DiffuseMaterial Class Reference

Models a diffuse material. More...

#include <DiffuseMaterial.h>

Inheritance diagram for DiffuseMaterial:
[legend]
Collaboration diagram for DiffuseMaterial:
[legend]

Public Member Functions

 DiffuseMaterial (const DoubleVec3D &albedo=DoubleVec3D(0.0), DoubleVec3D emittance=0)
 Default and main constructor. More...
 
 DiffuseMaterial (const DiffuseMaterial &material)
 Copy constructor. More...
 
DoubleVec3D getAlbedo () const
 Getter for the albedo attribute. More...
 
void setAlbedo (const DoubleVec3D &albedo)
 Getter for the albedo attribute. More...
 
MaterialdeepCopy () const
 Makes a deep copy of this material. More...
 
DoubleUnitVec3D getNewDirection (const Ray &previousRay, const DoubleUnitVec3D &normal) const
 Computes the new ray direction. More...
 
DoubleVec3D computeCurrentRadiance (const DoubleVec3D &recursiveRadiance, double cosAngleNewDirectionNormal, bool nextEventEstimation=false) const
 Computes the new radiance. More...
 
bool worksWithNextEventEstimation () const
 Returns whether this material works with next event estimation. More...
 
std::ostream & getDescription (std::ostream &stream) const
 Returns this material's description. More...
 
std::string getType () const
 Returns "Diffuse". More...
 
json getSpecificParametersJson () const
 Converts this material's specific parameters to json. More...
 
void setSpecificParametersJson (const json &j)
 Sets this material's specific parameters according to json. More...
 
- Public Member Functions inherited from Material
 Material (DoubleVec3D emittance=0)
 Default and main constructor. More...
 
 Material (const Material &material)
 Copy constructor. More...
 
DoubleVec3D getEmittance () const
 Getter for the emittance attribute. More...
 
void setEmittance (DoubleVec3D emittance)
 Setter for the emittance attribute. More...
 

Detailed Description

Models a diffuse material.

Constructor & Destructor Documentation

◆ DiffuseMaterial() [1/2]

DiffuseMaterial::DiffuseMaterial ( const DoubleVec3D albedo = DoubleVec3D(0.0),
DoubleVec3D  emittance = 0 
)

Default and main constructor.

Parameters
albedoThe albedo of this material.
emittanceThe radiance this material emits.

◆ DiffuseMaterial() [2/2]

DiffuseMaterial::DiffuseMaterial ( const DiffuseMaterial material)

Copy constructor.

Parameters
materialThe material that will be copied.

Member Function Documentation

◆ computeCurrentRadiance()

DoubleVec3D DiffuseMaterial::computeCurrentRadiance ( const DoubleVec3D recursiveRadiance,
double  cosAngleNewDirectionNormal,
bool  nextEventEstimation = false 
) const
virtual

Computes the new radiance.

Parameters
recursiveRadianceThe radiance recursively obtained.
cosAngleNewDirectionNormalThe cosine of the angle between the direction of the next ray and the normal at the intersection.
nextEventEstimationWhether the radiance is obtained using the next event estimation algorithm.
Returns
The new radiance.

Implements Material.

◆ deepCopy()

Material * DiffuseMaterial::deepCopy ( ) const
virtual

Makes a deep copy of this material.

Returns
A pointer to a deeply copied version of this material.

Implements Material.

◆ getAlbedo()

DoubleVec3D DiffuseMaterial::getAlbedo ( ) const

Getter for the albedo attribute.

Returns
The albedo of this material.
See also
setAlbedo()

◆ getDescription()

std::ostream & DiffuseMaterial::getDescription ( std::ostream &  stream) const
virtual

Returns this material's description.

Parameters
streamThe current stream.
Returns
The stream with the description.
See also
operator<<(std::ostream& stream, const Material& material)

Implements Material.

◆ getNewDirection()

DoubleUnitVec3D DiffuseMaterial::getNewDirection ( const Ray previousRay,
const DoubleUnitVec3D normal 
) const
virtual

Computes the new ray direction.

Parameters
previousRayThe ray that hits this material.
normalThe normal at the intersection.
Returns
The new ray direction.

Implements Material.

◆ getSpecificParametersJson()

json DiffuseMaterial::getSpecificParametersJson ( ) const
virtual

Converts this material's specific parameters to json.

Returns
This material's specific parameters converted to json.
See also
DiffuseMaterial::setSpecificParametersJson()

Implements Material.

◆ getType()

std::string DiffuseMaterial::getType ( ) const
virtual

Returns "Diffuse".

Returns
"Diffuse".

Implements Material.

◆ setAlbedo()

void DiffuseMaterial::setAlbedo ( const DoubleVec3D albedo)

Getter for the albedo attribute.

Parameters
albedoThe new albedo of this material.
See also
getAlbedo()

◆ setSpecificParametersJson()

void DiffuseMaterial::setSpecificParametersJson ( const json j)
virtual

Sets this material's specific parameters according to json.

Parameters
jThe json input.
See also
DiffuseMaterial::getSpecificParametersJson()

Implements Material.

◆ worksWithNextEventEstimation()

bool DiffuseMaterial::worksWithNextEventEstimation ( ) const
virtual

Returns whether this material works with next event estimation.

Returns
True.

Implements Material.


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