App::Material Class Reference

Material class. More...

#include <Material.h>

List of all members.

Public Types

enum  MaterialType {
  BRASS, BRONZE, COPPER, GOLD,
  PEWTER, PLASTER, PLASTIC, SILVER,
  STEEL, STONE, SHINY_PLASTIC, SATIN,
  METALIZED, NEON_GNC, CHROME, ALUMINIUM,
  OBSIDIAN, NEON_PHC, JADE, RUBY,
  EMERALD, DEFAULT, USER_DEFINED
}

Public Member Functions

MaterialType getType () const
 Returns the currently set material type.
void set (const char *MatName)
 Set a material by name There are some standard materials defined which are:.
void setType (const MaterialType MatType)
 This method is provided for convenience which does basically the same as the method above unless that it accepts a MaterialType as argument.
 ~Material ()
Constructors



 Material (const MaterialType MatType)
 Does basically the same as the constructor above unless that it accepts a MaterialType as argument.
 Material (const char *MatName)
 Defines the colors and shininess for the material MatName.
 Material (void)
 Sets the USER_DEFINED material type.

Public Attributes

Properties



Color ambientColor
 Defines the ambient color.
Color diffuseColor
 Defines the diffuse color.
Color emissiveColor
 Defines the emissive color.
float shininess
Color specularColor
 Defines the specular color.
float transparency

Detailed Description

Material class.

Definition at line 111 of file Material.h.


Member Enumeration Documentation

Enumerator:
BRASS 
BRONZE 
COPPER 
GOLD 
PEWTER 
PLASTER 
PLASTIC 
SILVER 
STEEL 
STONE 
SHINY_PLASTIC 
SATIN 
METALIZED 
NEON_GNC 
CHROME 
ALUMINIUM 
OBSIDIAN 
NEON_PHC 
JADE 
RUBY 
EMERALD 
DEFAULT 
USER_DEFINED 

Definition at line 114 of file Material.h.


Constructor & Destructor Documentation

Material::Material ( void   ) 

Sets the USER_DEFINED material type.

The user must set the colors afterwards.

Definition at line 39 of file Material.cpp.

References setType(), STEEL, and USER_DEFINED.

Material::Material ( const char *  MatName  ) 

Defines the colors and shininess for the material MatName.

If MatName isn't defined then USER_DEFINED is set and the user must define the colors itself.

Definition at line 45 of file Material.cpp.

Material::Material ( const MaterialType  MatType  ) 

Does basically the same as the constructor above unless that it accepts a MaterialType as argument.

Definition at line 50 of file Material.cpp.

References setType().

Material::~Material (  ) 

Definition at line 55 of file Material.cpp.


Member Function Documentation

MaterialType App::Material::getType ( void   )  const [inline]

Returns the currently set material type.

Definition at line 192 of file Material.h.

void Material::set ( const char *  MatName  ) 

Set a material by name There are some standard materials defined which are:.

  • Brass
  • Bronze
  • Copper
  • Gold
  • Pewter
  • Plaster
  • Plastic
  • Silver
  • Steel
  • Stone
  • Shiny plastic
  • Satin
  • Metalized
  • Neon GNC
  • Chrome
  • Aluminium
  • Obsidian
  • Neon PHC
  • Jade
  • Ruby
  • Emerald Furthermore there two additional modes Default which defines a kind of grey metalic and user defined that does nothing. The Color and the other properties of the material are defined in the range [0-1]. If MatName is an unknown material name then the type USER_DEFINED is set and the material doesn't get changed.

Definition at line 59 of file Material.cpp.

References ALUMINIUM, BRASS, BRONZE, CHROME, COPPER, DEFAULT, EMERALD, GOLD, JADE, METALIZED, NEON_GNC, NEON_PHC, OBSIDIAN, PEWTER, PLASTER, PLASTIC, RUBY, SATIN, setType(), SHINY_PLASTIC, SILVER, STEEL, STONE, and USER_DEFINED.

Referenced by App::MaterialPy::set().

void Material::setType ( const MaterialType  MatType  ) 

This method is provided for convenience which does basically the same as the method above unless that it accepts a MaterialType as argument.

Definition at line 152 of file Material.cpp.

References ALUMINIUM, ambientColor, BRASS, BRONZE, CHROME, COPPER, diffuseColor, EMERALD, emissiveColor, SketcherExample::f, GOLD, JADE, METALIZED, NEON_GNC, NEON_PHC, OBSIDIAN, PEWTER, PLASTER, PLASTIC, RUBY, SATIN, App::Color::set(), shininess, SHINY_PLASTIC, SILVER, specularColor, STEEL, STONE, transparency, and USER_DEFINED.

Referenced by Material(), and set().


Member Data Documentation


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

Generated on Wed Nov 23 19:01:43 2011 for FreeCAD by  doxygen 1.6.1