#include <imagemap.h>
Inheritance diagram for ImageMap:
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... |
Definition at line 18 of file imagemap.h.
ImageMap::ImageMap | ( | std::string & | image_name, | |
bool | is_light, | |||
double | reflection, | |||
double | diffuse, | |||
double | reflectivity, | |||
double | refraction, | |||
double | opacity | |||
) | [inline] |
ImageMap::ImageMap | ( | ImageMap & | ) |
ImageMap::~ImageMap | ( | ) | [inline] |
Definition at line 82 of file imagemap.h.
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.
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.
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.
intersection_point | Point in space where ray intersected an object |
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.
intersection_point | Point in space where ray intersected an object |
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.
intersection_point | Point in space where ray intersected an object |
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.
intersection_point | Point in space where ray intersected an object |
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.
intersection_point | Point in space where ray intersected an object |
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.
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.
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.
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:
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] |
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().