MaterialCatalog manages the material tables associated with a scene.
A scene may have multiple material tables, representing the sets of of materials available to the scene. Material tables are identified by specifying an ID when adding a table to the catalog.
MaterialCatalog is a singleton, with a reference accessible through the instance() method. The MaterialCatalog must be explicitly destroyed before program termination through the destruct() method.
#include <MaterialCatalog.h>
Public Member Functions |
|
void | setMaterialTable (const awString::IString &id, awScene::MaterialTableRef materials) |
Associates and stores the given material
table using the given ID. |
|
void | removeMaterialTable (const awString::IString &id) |
Removes the material table associated with
the given ID, if it exists. |
|
int | getMaterialTableCount () const |
Returns the number of material tables
currently in the catalog. |
|
bool | hasMaterialTable (const awString::IString &id) const |
Returns true if there is a table associated
with the given ID; false otherwise. |
|
awScene::MaterialTableRef | getMaterialTable (const awString::IString &id) |
Returns the material table associated with
the given ID; a NULL ref if the table for the given ID does not
exist. |
|
void | setDefaultMaterial (MaterialRef material) |
Set and get default material. |
|
const MaterialRef | getDefaultMaterial () const |
void | setSelectedMaterial (MaterialRef material) |
Set and get "selected" and "highlighted"
material. |
|
const MaterialRef | getSelectedMaterial () const |
void | setSelectedParentMaterial (MaterialRef material) |
const MaterialRef | getSelectedParentMaterial () const |
void | setHighlightMaterial (MaterialRef material) |
const MaterialRef | getHighlightMaterial () const |
void | setAffectedMaterial (MaterialRef material) |
const MaterialRef | getAffectedMaterial () const |
void | setSelectedDecalMaterial (MaterialRef material) |
const MaterialRef | getSelectedDecalMaterial () const |
void | setSelectedParentDecalMaterial (MaterialRef material) |
const MaterialRef | getSelectedParentDecalMaterial () const |
void | setHighlightDecalMaterial (MaterialRef material) |
const MaterialRef | getHighlightDecalMaterial () const |
void | setSelectionGridVelocity (double v) |
double | getSelectionGridVelocity () const |
void | setNormalAndDepthMaterial (MaterialRef material) |
This material is used in SSAO to generate
the (normal,depth) texture. |
|
const MaterialRef | getNormalAndDepthMaterial () const |
void | setNormalDepthIDMaterial (MaterialRef material) |
This material is used in NPR to generate the
(normal,depth, objectID) texture. |
|
const MaterialRef | getNormalDepthIDMaterial () const |
Static Public Member Functions |
|
static MaterialCatalog & | instance () |
Returns an instance of material catalog.
|
|
static void | destruct () |
Deletes the instance of material catalog if
one exists. |
|
Protected Member Functions |
|
MaterialCatalog () | |
virtual | ~MaterialCatalog () |
MaterialCatalog | ( | ) | [protected] |
virtual ~MaterialCatalog | ( | ) | [protected, virtual] |
static MaterialCatalog& instance | ( | ) | [static] |
Returns an instance of material catalog.
static void destruct | ( | ) | [static] |
Deletes the instance of material catalog if one exists.
void setMaterialTable | ( | const awString::IString & | id, |
awScene::MaterialTableRef | materials | ||
) |
Associates and stores the given material table using the given ID.
void removeMaterialTable | ( | const awString::IString & | id | ) |
Removes the material table associated with the given ID, if it exists.
int getMaterialTableCount | ( | ) | const |
Returns the number of material tables currently in the catalog.
bool hasMaterialTable | ( | const awString::IString & | id | ) | const |
Returns true if there is a table associated with the given ID; false otherwise.
awScene::MaterialTableRef getMaterialTable | ( | const awString::IString & | id | ) |
Returns the material table associated with the given ID; a NULL ref if the table for the given ID does not exist.
void setDefaultMaterial | ( | MaterialRef | material | ) |
Set and get default material.
const MaterialRef getDefaultMaterial | ( | ) | const |
void setSelectedMaterial | ( | MaterialRef | material | ) |
Set and get "selected" and "highlighted" material.
Be careful with set, not everything is appropriate for display :-)
const MaterialRef getSelectedMaterial | ( | ) | const |
void setSelectedParentMaterial | ( | MaterialRef | material | ) |
const MaterialRef getSelectedParentMaterial | ( | ) | const |
void setHighlightMaterial | ( | MaterialRef | material | ) |
const MaterialRef getHighlightMaterial | ( | ) | const |
void setAffectedMaterial | ( | MaterialRef | material | ) |
const MaterialRef getAffectedMaterial | ( | ) | const |
void setSelectedDecalMaterial | ( | MaterialRef | material | ) |
const MaterialRef getSelectedDecalMaterial | ( | ) | const |
void setSelectedParentDecalMaterial | ( | MaterialRef | material | ) |
const MaterialRef getSelectedParentDecalMaterial | ( | ) | const |
void setHighlightDecalMaterial | ( | MaterialRef | material | ) |
const MaterialRef getHighlightDecalMaterial | ( | ) | const |
void setSelectionGridVelocity | ( | double | v | ) |
double getSelectionGridVelocity | ( | ) | const |
void setNormalAndDepthMaterial | ( | MaterialRef | material | ) |
This material is used in SSAO to generate the (normal,depth) texture.
const MaterialRef getNormalAndDepthMaterial | ( | ) | const |
void setNormalDepthIDMaterial | ( | MaterialRef | material | ) |
This material is used in NPR to generate the (normal,depth, objectID) texture.
const MaterialRef getNormalDepthIDMaterial | ( | ) | const |