OpenSim::Material Class Reference

A class for representing the material properties of an object. More...

#include <Material.h>

Inheritance diagram for OpenSim::Material:
OpenSim::Object

List of all members.

Public Member Functions

 Material ()
 Default constructor.
 Material (const std::string &aFileName)
 Material (const Material &aMaterial)
 Copy constructor.
virtual ~Material ()
 Destructor.
virtual Objectcopy () const
 Virtual copy constructor.
Materialoperator= (const Material &aObject)
 Assign this object to the values of another.
virtual bool operator== (const Material &aObject)
 Determine if two objects are equal.
void setTranslucency (const double aTranslucency)
 Set the Translucency for this Material.
double getTranslucency () const
 Get the Translucency for this Material.
void setAmbientColor (const double aAmbientColor[3])
 Set the Ambient Color for this Material.
const double * getAmbientColor () const
 Get the Ambient Color for this Material.
void setDiffuseColor (const double aDiffuseColor[3])
 Set the Diffuse Color for this Material.
const double * getDiffuseColor () const
 Get the Diffuse Color for this Material.
void setSpecularColor (const double aSpecularColor[3])
 Set the Specular Color for this Material.
const double * getSpecularColor () const
 Get the Specular Color for this Material.

Static Public Member Functions

static const std::string & GetDefaultMaterialName ()
 These methods use lazy evaluation so the default is created only on demand.
static const MaterialGetDefaultMaterial ()
 Return the default Material.

Public Attributes

PropertyDbl _propTranslucency
 Translucency.
PropertyDblArray _propAmbientColor
 Ambient color.
PropertyDblArray _propDiffuseColor
PropertyDblArray _propSpecularColor
double & _translucency
Array< double > & _ambientColor
Array< double > & _diffuseColor
Array< double > & _specularColor

Static Public Attributes

static Material_defaultMaterial = 0

Protected Member Functions

virtual void setupProperties ()
 Connect properties to local pointers.

Detailed Description

A class for representing the material properties of an object.

Author:
Ayman Habib
Version:
1.0

Constructor & Destructor Documentation

Material::Material (  ) 

Default constructor.

OpenSim::Material::Material ( const std::string &  aFileName  ) 
Material::Material ( const Material aObject  ) 

Copy constructor.

Copy constructors for all Material's only copy the non-XML variable members of the object; that is, the object's DOMnode and XMLDocument are not copied but set to NULL. The reason for this is that for the object and all its derived classes to establish the correct connection to the XML document nodes, the the object would need to reconstruct based on the XML document not the values of the object's member variables.

There are three proper ways to generate an XML document for an Material:

1) Construction based on XML file (

See also:
Material(const char *aFileName)). In this case, the XML document is created by parsing the XML file.

2) Construction by Material(const XMLDocument *aDocument). This constructor explictly requests construction based on an XML document. In this way the proper connection between an object's node and the corresponding node within the XML document is established. This constructor is a copy constructor of sorts because all essential Material member variables should be held within the XML document. The advantage of this style of construction is that nodes within the XML document, such as comments that may not have any associated Material member variable, are preserved.

3) A call to generateXMLDocument(). This method generates an XML document for the VisibleObject from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).

Parameters:
aObject Object to be copied.
See also:
Material(const XMLDocument *aDocument)
Material(const char *aFileName)
generateXMLDocument()
Material::~Material (  )  [virtual]

Destructor.


Member Function Documentation

Object * Material::copy (  )  const [virtual]

Virtual copy constructor.

Reimplemented from OpenSim::Object.

const double * Material::getAmbientColor (  )  const

Get the Ambient Color for this Material.

const Material & Material::GetDefaultMaterial (  )  [static]

Return the default Material.

const string & Material::GetDefaultMaterialName (  )  [static]

These methods use lazy evaluation so the default is created only on demand.

const double * Material::getDiffuseColor (  )  const

Get the Diffuse Color for this Material.

const double * Material::getSpecularColor (  )  const

Get the Specular Color for this Material.

double Material::getTranslucency (  )  const

Get the Translucency for this Material.

Material & Material::operator= ( const Material aObject  ) 

Assign this object to the values of another.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

bool Material::operator== ( const Material aObject  )  [virtual]

Determine if two objects are equal.

Returns:
True if the two objects are equal, false otherwise.
void Material::setAmbientColor ( const double  aAmbientColor[3]  ) 

Set the Ambient Color for this Material.

void Material::setDiffuseColor ( const double  aDiffuseColor[3]  ) 

Set the Diffuse Color for this Material.

void Material::setSpecularColor ( const double  aSpecularColor[3]  ) 

Set the Specular Color for this Material.

void Material::setTranslucency ( const double  aTranslucency  ) 

Set the Translucency for this Material.

void Material::setupProperties ( void   )  [protected, virtual]

Connect properties to local pointers.

Reimplemented from OpenSim::Object.


Member Data Documentation

Ambient color.

Translucency.


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

Generated on Sun Sep 25 00:19:48 2011 for OpenSim by  doxygen 1.6.1