FreeCAD C++
Public Member Functions | List of all members
App::Material Class Reference

#include <App/Material.h>

Detailed Description

Material class

Public Member Functions

void set (const char *MatName)
 
void setType (const MaterialType MatType)
 
MaterialType getType () const
 
Constructors
 Material (void)
 
 Material (const char *MatName)
 
 Material (const MaterialType MatType)
 

Public Attributes

Properties
Color ambientColor
 
Color diffuseColor
 
Color specularColor
 
Color emissiveColor
 
float shininess
 
float transparency
 

Constructor & Destructor Documentation

◆ Material() [1/3]

App::Material::Material ( void  )

Sets the USER_DEFINED material type. The user must set the colors afterwards.

◆ Material() [2/3]

App::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.

◆ Material() [3/3]

App::Material::Material ( const MaterialType  MatType)

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

Member Function Documentation

◆ getType()

MaterialType App::Material::getType ( ) const

Returns the currently set material type.

◆ set()

void App::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 metallic 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.

◆ setType()

void App::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.

Member Data Documentation

◆ ambientColor

Color App::Material::ambientColor

Defines the ambient color.

◆ diffuseColor

Color App::Material::diffuseColor

Defines the diffuse color.

◆ emissiveColor

Color App::Material::emissiveColor

Defines the emissive color.

◆ specularColor

Color App::Material::specularColor

Defines the specular color.