Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

A3DL::Material Class Reference

Contains material (appearence) information for a 3D object. More...

#include <material.hh>

Inheritance diagram for A3DL::Material:

MetaObject List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Protected Attributes


Detailed Description

Contains material (appearence) information for a 3D object.

Todo:
Need to add functions for setting shading (CS mixmode |= CS_FX_GORAUD), keycolor (CS mixmode |= CS_FX_KEYCOLOR), tiling (CS mixmode |= CS_FX_TILING)

Definition at line 47 of file material.hh.


Member Enumeration Documentation

enum A3DL::Material::BlendModes
 

Enumeration values:
BLEND_ADD 
BLEND_MULTIPLY 
BLEND_DOUBLE_MULTIPLY 
BLEND_NORMAL 

Definition at line 160 of file material.hh.


Constructor & Destructor Documentation

Material::Material MetaObject superobject  ) 
 

Definition at line 30 of file material.cc.

Referenced by new_Material().

Material::~Material  )  [virtual]
 

Definition at line 35 of file material.cc.


Member Function Documentation

void Material::floatsToHexString float  r,
float  g,
float  b,
string &  str
[static]
 

Convert three normalized floats (0.0-1.0) to an HTML-style hex tripplet ("#RRGGBB).

If any input parameter is less than 0.0, it is considered to be 0. If any parameter is greater than 1.0, it is considered to be 1.

Todo:
Move this out into just the A3DL namespace?

Definition at line 111 of file material.cc.

void Material::getBlendColor double &  r,
double &  g,
double &  b
[virtual]
 

Get blend color

Exceptions:
Vobject::NoSuchObjectError if there is no "a3dl:blend-mode" property.

Definition at line 286 of file material.cc.

Property * Material::getBlendColorObj  )  [virtual]
 

Definition at line 291 of file material.cc.

short Material::getBlendMode  )  [virtual]
 

Get special blend mode.

Will be one of the following: MeshBase::BLEND_ADD MeshBase::BLEND_MULTIPLY MeshBase::BLEND_DOUBLE_MULTIPLY MeshBase::BLEND_NORMAL These blend modes determine how the background affects the object's material.

Exceptions:
Vobject::NoSuchObjectError if there is no "a3dl:blend-mode" property.

Definition at line 254 of file material.cc.

Property * Material::getBlendModeObj  )  [virtual]
 

Get blend mode property object.

Definition at line 269 of file material.cc.

void Material::getColor float &  r,
float &  g,
float &  b
[virtual]
 

Definition at line 69 of file material.cc.

PropertyAccessControl* A3DL::Material::getPropertyAccessControl  )  [inline]
 

Definition at line 60 of file material.hh.

Texture * Material::getTextureLayer int  idx  )  [virtual]
 

Use a vRef or call release on the returned object.

Returns:
0 if idx is greater than the number of texture layers.

Definition at line 195 of file material.cc.

vector< Texture * > Material::getTextureLayers  )  [virtual]
 

Definition at line 183 of file material.cc.

double Material::getTransparency  )  [virtual]
 

Get transparency.

Will be between 0 (no transparency) and 1 (fully transparent).

Exceptions:
Vobject:NoSuchObjectError if there is no "a3dl:transparency" object.

Definition at line 221 of file material.cc.

Property * Material::getTransparencyObj  )  [virtual]
 

Get transparency property.

Definition at line 225 of file material.cc.

const string Material::getType  )  [virtual]
 

Definition at line 44 of file material.cc.

void Material::hexStringToFloats const string &  str,
float &  r,
float &  g,
float &  b
[static]
 

Convert an HTML-style hex triplet ("#RRGGBB") to three normalized (0.0-1.0) floating-point values.

Todo:
Move this out into just the A3DL namespace?

Definition at line 105 of file material.cc.

Referenced by getColor().

virtual void A3DL::Material::insertTextureLayer int  idx,
Texture t
[inline, virtual]
 

Definition at line 74 of file material.hh.

void Material::insertTextureLayer int  idx,
Texture t
[virtual]
 

Definition at line 123 of file material.cc.

Referenced by insertTextureLayerFromFile().

Texture * Material::insertTextureLayerFromFile int  idx,
const string &  filename,
const string &  datatype
[virtual]
 

Insert a new texture layer into this material at the given index, using the given file as the image backend source (using FileProperty).

See also:
FileProperty
Exceptions:
FileAccessError if there is an error opening the file

Definition at line 139 of file material.cc.

MetaObject * Material::new_Material MetaObject superobject,
const string &  type
[static]
 

Definition at line 39 of file material.cc.

void Material::registerExtenders  )  [static]
 

Definition at line 49 of file material.cc.

void Material::removeTextureLayer int  idx  )  [virtual]
 

Definition at line 167 of file material.cc.

virtual void A3DL::Material::replaceTextureLayer int  idx,
Texture t
[inline, virtual]
 

Definition at line 79 of file material.hh.

void Material::replaceTextureLayer int  idx,
Texture t
[virtual]
 

Definition at line 151 of file material.cc.

void Material::setBlendColor double  r,
double  g,
double  b
[virtual]
 

Set blend color: this color modifies the blending of this object against its background.

Definition at line 282 of file material.cc.

void Material::setBlendColorObj Property obj  )  [virtual]
 

Definition at line 295 of file material.cc.

void Material::setBlendMode short  mode  )  [virtual]
 

Set special blend mode.

Must be one of the following: MeshBase::BLEND_ADD MeshBase::BLEND_MULTIPLY MeshBase::BLEND_DOUBLE_MULTIPLY MeshBase::BLEND_NORMAL These blend modes determine how the background affects the object's material.

Definition at line 238 of file material.cc.

void Material::setBlendModeObj Property obj  )  [virtual]
 

Set blend mode property object.

Definition at line 273 of file material.cc.

void Material::setColor float  r,
float  g,
float  b
[virtual]
 

Definition at line 57 of file material.cc.

void A3DL::Material::setPropertyAccessControl PropertyAccessControl pac  )  [inline]
 

Definition at line 59 of file material.hh.

void Material::setTransparency double  t,
PropertyAccessControl ac = &NoPropertyAccessControl::static_
[virtual]
 

Set transparency of the object.

Parameters:
t A value between 0 (no transparency) and 1 (fully transparent). Some renderers may round to certain values (e.g. 1.0, 0.75, 0.5, 0.25, 0.0) If t is > 1, 1 will be used. If t < 0, 0 will be used.

Definition at line 217 of file material.cc.

void Material::setTransparencyObj Property obj  )  [virtual]
 

Set transparency property object.

Definition at line 229 of file material.cc.


Member Data Documentation

PropertyAccessControl* A3DL::Material::accesscontrol [protected]
 

Definition at line 50 of file material.hh.

Referenced by insertTextureLayerFromFile(), setBlendColor(), setBlendMode(), and setColor().


The documentation for this class was generated from the following files:
Generated on Tue Aug 12 03:55:59 2003 for Interreality Project - VOS by doxygen 1.3.2