A class for representing the material properties of an object. More...
#include <Material.h>
Public Member Functions | |
Material () | |
Default constructor. | |
Material (const std::string &aFileName) | |
Material (const Material &aMaterial) | |
Copy constructor. | |
virtual | ~Material () |
Destructor. | |
virtual Object * | copy () const |
Virtual copy constructor. | |
Material & | operator= (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 Material & | GetDefaultMaterial () |
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. |
A class for representing the material properties of an object.
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 (
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.).
aObject | Object to be copied. |
Material::~Material | ( | ) | [virtual] |
Destructor.
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 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.
Assign this object to the values of another.
Reimplemented from OpenSim::Object.
bool Material::operator== | ( | const Material & | aObject | ) | [virtual] |
Determine if two objects are equal.
void Material::setAmbientColor | ( | const double | aAmbientColor[3] | ) |
void Material::setDiffuseColor | ( | const double | aDiffuseColor[3] | ) |
void Material::setSpecularColor | ( | const double | aSpecularColor[3] | ) |
void Material::setTranslucency | ( | const double | aTranslucency | ) |
void Material::setupProperties | ( | void | ) | [protected, virtual] |
Connect properties to local pointers.
Reimplemented from OpenSim::Object.
Array<double>& OpenSim::Material::_ambientColor |
Material * Material::_defaultMaterial = 0 [static] |
Array<double>& OpenSim::Material::_diffuseColor |
Ambient color.
Translucency.
Array<double>& OpenSim::Material::_specularColor |
double& OpenSim::Material::_translucency |