SolidMaterial Class Reference

#include <solidmaterial.h>

Inheritance diagram for SolidMaterial:

Inheritance graph
[legend]
Collaboration diagram for SolidMaterial:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual Magick::Color get_color (const Point3D &intersection_point) const
virtual double get_diffuse (const Point3D &intersection_point) const
virtual double get_opacity (const Point3D &intersection_point) const
virtual double get_reflection (const Point3D &intersection_point) const
virtual double get_reflectivity (const Point3D &intersection_point) const
virtual double get_refraction_index (const Point3D &intersection_point) const
virtual bool is_light (const Point3D &intersection_point) const
virtual void set_diffuse (double diffuse)
virtual void set_is_light (bool v)
virtual void set_opacity (double opacity)
 SolidMaterial (const SolidMaterial &other)
 Copy constructor.
 SolidMaterial (Magick::Color m_color, bool is_light, double reflection, double diffuse, double reflectivity, double refraction, double opacity)
 Fully construct a material with no defaults.
 SolidMaterial (Magick::Color m_color, double reflect=1.0f, double diffuse=0.25f, bool is_light=false, double opacity=OPAQUE)
 SolidMaterial (bool is_light)
virtual ~SolidMaterial ()

Protected Member Functions

virtual void normalize_opacity ()
 Ensure m_opacity remains within the range of 0.0f to 1.0f.

Protected Attributes

Magick::Color m_color
 This is the color of the material.
double m_diffusion_factor
bool m_is_light_source
 Is this material a light source?
double m_opacity
double m_reflection_coefficient
double m_reflectivity
double m_refraction_index
 This describes the amount of refraction occuring within the object.

Static Private Attributes

static SolidMaterialStaticInit m_init
 Dummy variable to run static initialization.

Classes

class  SolidMaterialStaticInit
 Static initialization. Registers the material with the PluginFactory. More...

Detailed Description

This is the most basic material. It has a single set of attributes that return the same value regardless of the intersection point. Currently, this is the only material that can exist at the leaf nodes of a material tree.

Definition at line 15 of file solidmaterial.h.


Constructor & Destructor Documentation

SolidMaterial::SolidMaterial ( bool  is_light  )  [inline]

Definition at line 73 of file solidmaterial.h.

SolidMaterial::SolidMaterial ( Magick::Color  m_color,
double  reflect = 1.0f,
double  diffuse = 0.25f,
bool  is_light = false,
double  opacity = OPAQUE 
) [inline]

Definition at line 82 of file solidmaterial.h.

SolidMaterial::SolidMaterial ( Magick::Color  m_color,
bool  is_light,
double  reflection,
double  diffuse,
double  reflectivity,
double  refraction,
double  opacity 
) [inline]

Fully construct a material with no defaults.

Definition at line 94 of file solidmaterial.h.

SolidMaterial::SolidMaterial ( const SolidMaterial other  )  [inline]

Copy constructor.

Definition at line 110 of file solidmaterial.h.

virtual SolidMaterial::~SolidMaterial (  )  [inline, virtual]

Definition at line 118 of file solidmaterial.h.


Member Function Documentation

Color SolidMaterial::get_color ( const Point3D intersection_point  )  const [virtual]

Calculate color at given point on the material.

Returns:
Color at given point

Implements Material.

Definition at line 11 of file solidmaterial.cpp.

References m_color.

double SolidMaterial::get_diffuse ( const Point3D intersection_point  )  const [virtual]

Get the diffusion coefficient at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the diffusion coefficient at the given point.

Implements Material.

Definition at line 25 of file solidmaterial.cpp.

References m_diffusion_factor.

double SolidMaterial::get_opacity ( const Point3D intersection_point  )  const [virtual]

Get the opacity of this material at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
opacity at the given point

Implements Material.

Definition at line 50 of file solidmaterial.cpp.

References m_opacity.

double SolidMaterial::get_reflection ( const Point3D intersection_point  )  const [virtual]

Get reflection coefficient at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the reflection coefficient at the given point

Implements Material.

Definition at line 35 of file solidmaterial.cpp.

References m_reflection_coefficient.

double SolidMaterial::get_reflectivity ( const Point3D intersection_point  )  const [virtual]

Get reflectivity at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the reflectivity at the given point

Implements Material.

Definition at line 40 of file solidmaterial.cpp.

References m_reflectivity.

double SolidMaterial::get_refraction_index ( const Point3D intersection_point  )  const [virtual]

Get the index of refraction at the given point. Note that varying the index of refraction across the material will most likely return results that are not accurate.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
refraction index at the given point

Implements Material.

Definition at line 45 of file solidmaterial.cpp.

References m_refraction_index.

bool SolidMaterial::is_light ( const Point3D intersection_point  )  const [virtual]

Determine if material emits light at given point. Note: due to the rendering algoritm currently being used, varying this value based on position might have unexpected results.

Returns:
true if material emits light

Implements Material.

Definition at line 16 of file solidmaterial.cpp.

References m_is_light_source.

virtual void SolidMaterial::normalize_opacity (  )  [inline, protected, virtual]

Ensure m_opacity remains within the range of 0.0f to 1.0f.

Definition at line 61 of file solidmaterial.h.

References m_opacity, OPAQUE, and TRANSPARENT.

Referenced by set_opacity().

Here is the caller graph for this function:

void SolidMaterial::set_diffuse ( double  diffuse  )  [virtual]

Set the diffusion coefficient for the object. Subclasses are not required to do anything useful with this information.

Implements Material.

Definition at line 30 of file solidmaterial.cpp.

References m_diffusion_factor.

void SolidMaterial::set_is_light ( bool  v  )  [virtual]

Set whether or not object emits light. Subclasses are not required to do anything useful with this information.

Parameters:
v True if material emits light

Implements Material.

Definition at line 20 of file solidmaterial.cpp.

References m_is_light_source.

void SolidMaterial::set_opacity ( double  opacity  )  [virtual]

Set opacity for the object. Subclasses are not required to do anything useful with this information.

Parameters:
opacity The suggested opacity for the material

Implements Material.

Definition at line 55 of file solidmaterial.cpp.

References m_opacity, and normalize_opacity().

Here is the call graph for this function:


Member Data Documentation

Magick::Color SolidMaterial::m_color [protected]

This is the color of the material.

Definition at line 48 of file solidmaterial.h.

Referenced by get_color().

double SolidMaterial::m_diffusion_factor [protected]

This describes how much this material scatters the light off the surface. This value is between 0 and 1, 0 means the material scatters 0% of the light, a 1 means the material scatters 100% of the light.

Definition at line 41 of file solidmaterial.h.

Referenced by get_diffuse(), and set_diffuse().

SolidMaterial::SolidMaterialStaticInit SolidMaterial::m_init [static, private]

Dummy variable to run static initialization.

Definition at line 30 of file solidmaterial.h.

bool SolidMaterial::m_is_light_source [protected]

Is this material a light source?

Definition at line 51 of file solidmaterial.h.

Referenced by is_light(), and set_is_light().

double SolidMaterial::m_opacity [protected]

This is how opaque the object is, or more correctly how transparent the object. A value of 0 is fully opaque, a value of 1.0 is fully transparent.

Definition at line 55 of file solidmaterial.h.

Referenced by get_opacity(), normalize_opacity(), and set_opacity().

double SolidMaterial::m_reflection_coefficient [protected]

This is the percentage of light that is reflected off this material. This value is between 0 and 1, 0 means the material reflects 0% of the light, a 1 means the material reflects 100% of the light.

Definition at line 36 of file solidmaterial.h.

Referenced by get_reflection().

double SolidMaterial::m_reflectivity [protected]

This number describes how reflective this material is. Higher numbers mean shinier objects.

Definition at line 45 of file solidmaterial.h.

Referenced by get_reflectivity().

double SolidMaterial::m_refraction_index [protected]

This describes the amount of refraction occuring within the object.

Definition at line 58 of file solidmaterial.h.

Referenced by get_refraction_index().


The documentation for this class was generated from the following files:
Generated on Tue Oct 30 22:12:25 2007 for mbrt by  doxygen 1.5.2