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

Models a refractive material. More...

#include <RefractiveMaterial.h>

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

Public Member Functions

 RefractiveMaterial (double refractiveIndex=1.5, DoubleVec3D emittance=0)
 Default and main constructor. More...
 
 RefractiveMaterial (const RefractiveMaterial &material)
 Copy constructor. More...
 
double getRefractiveIndex () const
 Getter for the refractiveIndex attribute. More...
 
void setRefractiveIndex (double refractiveIndex)
 Setter for the refractiveIndex 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 "Refractive". 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 refractive material.

Constructor & Destructor Documentation

◆ RefractiveMaterial() [1/2]

RefractiveMaterial::RefractiveMaterial ( double  refractiveIndex = 1.5,
DoubleVec3D  emittance = 0 
)

Default and main constructor.

Parameters
refractiveIndexThe refractive index of this material.
emittanceThe radiance this material emits.

◆ RefractiveMaterial() [2/2]

RefractiveMaterial::RefractiveMaterial ( const RefractiveMaterial material)

Copy constructor.

Parameters
materialThe material that will be copied.

Member Function Documentation

◆ computeCurrentRadiance()

DoubleVec3D RefractiveMaterial::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 * RefractiveMaterial::deepCopy ( ) const
virtual

Makes a deep copy of this material.

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

Implements Material.

◆ getDescription()

std::ostream & RefractiveMaterial::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 RefractiveMaterial::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.

◆ getRefractiveIndex()

double RefractiveMaterial::getRefractiveIndex ( ) const

Getter for the refractiveIndex attribute.

Returns
The refractive index of this material.
See also
setRefractiveIndex()

◆ getSpecificParametersJson()

json RefractiveMaterial::getSpecificParametersJson ( ) const
virtual

Converts this material's specific parameters to json.

Returns
This material's specific parameters converted to json.

Implements Material.

◆ getType()

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

Returns "Refractive".

Returns
"Refractive".

Implements Material.

◆ setRefractiveIndex()

void RefractiveMaterial::setRefractiveIndex ( double  refractiveIndex)

Setter for the refractiveIndex attribute.

Parameters
refractiveIndexThe new refractive index of this material.
See also
getRefractiveIndex()

◆ setSpecificParametersJson()

void RefractiveMaterial::setSpecificParametersJson ( const json j)
virtual

Sets this material's specific parameters according to json.

Parameters
jThe json input.

Implements Material.

◆ worksWithNextEventEstimation()

bool RefractiveMaterial::worksWithNextEventEstimation ( ) const
virtual

Returns whether this material works with next event estimation.

Returns
False.

Implements Material.


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