ImageMap Class Reference

This class maps an image directly to a Renderable. More...

#include <imagemap.h>

Inheritance diagram for ImageMap:

Inheritance graph
[legend]
Collaboration diagram for ImageMap:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual Magick::Color get_color (const Point3D &intersection_point, const Renderable *const obj) const
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
 ImageMap (ImageMap &)
 ImageMap (std::string &image_name, bool is_light, double reflection, double diffuse, double reflectivity, double refraction, double opacity)
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)
 ~ImageMap ()

Protected Member Functions

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

Protected Attributes

double m_diffusion_factor
Magick::Image m_image
 This is the image that we will map to the Renderable.
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 StaticInit m_init
 Dummy variable to run static initialization.

Classes

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

Detailed Description

This class maps an image directly to a Renderable.

Definition at line 18 of file imagemap.h.


Constructor & Destructor Documentation

ImageMap::ImageMap ( std::string &  image_name,
bool  is_light,
double  reflection,
double  diffuse,
double  reflectivity,
double  refraction,
double  opacity 
) [inline]

Definition at line 72 of file imagemap.h.

References m_image.

ImageMap::ImageMap ( ImageMap  ) 

ImageMap::~ImageMap (  )  [inline]

Definition at line 82 of file imagemap.h.


Member Function Documentation

Color ImageMap::get_color ( const Point3D intersection_point,
const Renderable *const  obj 
) const [virtual]

Calculate color at given point on the material given the surface normal passed in. The default behavior of this is to call Material::get_color(Point3D) ignoring the normal. If this behavior is not desired, override this method in child classes.

Returns:
Color at given point

Reimplemented from Material.

Definition at line 16 of file imagemap.cpp.

References cross_product(), Ray::direction(), dot_product(), Renderable::get_normal(), and m_image.

Here is the call graph for this function:

virtual Magick::Color ImageMap::get_color ( const Point3D intersection_point  )  const [inline, virtual]

Calculate color at given point on the material.

Returns:
Color at given point

Implements Material.

Definition at line 84 of file imagemap.h.

double ImageMap::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 62 of file imagemap.cpp.

References m_diffusion_factor.

double ImageMap::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 87 of file imagemap.cpp.

References m_opacity.

double ImageMap::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 72 of file imagemap.cpp.

References m_reflection_coefficient.

double ImageMap::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 77 of file imagemap.cpp.

References m_reflectivity.

double ImageMap::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 82 of file imagemap.cpp.

References m_refraction_index.

bool ImageMap::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 53 of file imagemap.cpp.

References m_is_light_source.

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

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

Definition at line 64 of file imagemap.h.

References m_opacity, OPAQUE, and TRANSPARENT.

Referenced by set_opacity().

Here is the caller graph for this function:

void ImageMap::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 67 of file imagemap.cpp.

References m_diffusion_factor.

void ImageMap::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 57 of file imagemap.cpp.

References m_is_light_source.

void ImageMap::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 92 of file imagemap.cpp.

References m_opacity, and normalize_opacity().

Here is the call graph for this function:


Member Data Documentation

double ImageMap::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 47 of file imagemap.h.

Referenced by get_diffuse(), and set_diffuse().

Magick::Image ImageMap::m_image [protected]

This is the image that we will map to the Renderable.

Definition at line 37 of file imagemap.h.

Referenced by get_color(), and ImageMap().

ImageMap::StaticInit ImageMap::m_init [static, private]

Dummy variable to run static initialization.

Definition at line 33 of file imagemap.h.

bool ImageMap::m_is_light_source [protected]

Is this material a light source?

Definition at line 54 of file imagemap.h.

Referenced by is_light(), and set_is_light().

double ImageMap::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 58 of file imagemap.h.

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

double ImageMap::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 42 of file imagemap.h.

Referenced by get_reflection().

double ImageMap::m_reflectivity [protected]

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

Definition at line 51 of file imagemap.h.

Referenced by get_reflectivity().

double ImageMap::m_refraction_index [protected]

This describes the amount of refraction occuring within the object.

Definition at line 61 of file imagemap.h.

Referenced by get_refraction_index().


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