VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes
VisimBox.Renderer.MaterialManager Class Reference

Abstract material manager. More...

Inheritance diagram for VisimBox.Renderer.MaterialManager:

List of all members.

## Public Member Functions
| MaterialManager (IRenderer render)
| Manager constructor.
IRenderMaterial | Add (string key, ColorByte color)
| Creates, adds to manager and returns new simple colored material with specified color.
IRenderMaterial | Add (string key, Color color)
| Creates, adds to manager and returns new simple colored material with specified color.
IRenderMaterial | Add (string key, ref StandardColorValues values)
| Creates, adds to manager and returns new colored material with specified color values.
IRenderMaterial | Add (string key, StandardColorValues values)
| Creates, adds to manager and returns new colored material with specified color values.
IRenderMaterial | Add (string key, Texture tex)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | Add (string key, string tex)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | Add (string key, string texture, ref StandardColorValues values)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | Add (string key, string texture, StandardColorValues values)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | Add (string key, Texture texture, ref StandardColorValues values)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | Add (string key, Texture texture, StandardColorValues values)
| Creates, adds to manager and returns new simple textured material.
IRenderMaterial | CreateCopy (string originalkey, string newkey=null)
| creates copy of material with identifier original key, adds to manager and returns pointer
override string | Rename (string key, string newkey, bool uniquename=true)
| Renames key to new value.
bool | SaveLibrary (XmlTextWriter writer, bool allmaterials=true)
| Saves material library to XML document.
bool | SaveLibrary (string filename, bool allmaterials=true)
| Saves material library to disk.
bool | ReadMaterial (XmlTextReader reader, bool merge=true)
bool | CheckMaterialSameness (IRenderMaterial mat1, IRenderMaterial mat2)
bool | LoadLibrary (XmlTextReader reader, bool merge=true)
| Reads library from XML file.
bool | LoadLibrary (string filename, bool merge=true)
| Loads material library from disk.
void | ReplaceMaterial (IRenderMaterial mat1, IRenderMaterial mat2, bool deleteold=false)
| Replaces material mat1 with mat2 (exchanging names for named references, calling resourcereplaced callbacks of consumers) Note, mat2 must be referenceless, otherwise throws exception!
## Protected Member Functions
abstract IRenderMaterial | CreateSimpleColor (string name, ColorByte color)
| Creates new simple colored material (just one color, no lightning)
IRenderMaterial | CreateSimpleColor (string name, Color color)
| Creates new simple colored material (just one color, no lightning)
abstract IRenderMaterial | CreateColorMaterial (string name, ref StandardColorValues values)
| Creates standard colored material from color values.
IRenderMaterial | CreateColorMaterial (string name, StandardColorValues values)
| Creates standard colored material from color values.
abstract IRenderMaterial | CreateTexturedSimple (string name, Texture tex)
| Creates simple textured material (just one color texture)
IRenderMaterial | CreateTexturedSimple (string name, string texture)
| Creates simple textured material (just one color texture)
abstract IRenderMaterial | CreateTextured (string name, Texture tex, ref StandardColorValues values)
| Creates colored textured material (standard colors + one diffuse texture)
IRenderMaterial | CreateTextured (string name, Texture tex, StandardColorValues values)
| Creates colored textured material (standard colors + one diffuse texture)
IRenderMaterial | CreateTextured (string name, string texture, ref StandardColorValues values)
| Creates colored textured material (standard colors + one diffuse texture)
IRenderMaterial | CreateTextured (string name, string texture, StandardColorValues values)
| Creates colored textured material (standard colors + one diffuse texture)
## Protected Attributes
IRenderer | owner
string | MatVersionLibrary = "1.0"

## Detailed Description

Abstract material manager.

## Constructor & Destructor Documentation

VisimBox.Renderer.MaterialManager.MaterialManager | ( | IRenderer | render | ) |

Manager constructor.

Parameters:

  render | Required renderer

## Member Function Documentation

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | ColorByte | color
| ) |  |

Creates, adds to manager and returns new simple colored material with specified color.

Parameters:

  key | Requested name (will be made unique)
  color | Color

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | Color | color
| ) |  |

Creates, adds to manager and returns new simple colored material with specified color.

Parameters:

  key | Requested name (will be made unique)
  color | Color

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new colored material with specified color values.

Parameters:

  key | Requested name (will be made unique)
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | string | texture,
|  | StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  texture | Texture name
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | Texture | texture,
|  | ref StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  texture | Texture
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | Texture | tex
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  tex | Texture

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | Texture | texture,
|  | StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  texture | Texture
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | ref StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new colored material with specified color values.

Parameters:

  key | Requested name (will be made unique)
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | string | tex
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  tex | Texture name

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.Add | ( | string | key,
|  | string | texture,
|  | ref StandardColorValues | values
| ) |  |

Creates, adds to manager and returns new simple textured material.

Parameters:

  key | Requested name (will be made unique)
  texture | Texture name
  values | Color values

Returns:
  New material

bool VisimBox.Renderer.MaterialManager.CheckMaterialSameness | ( | IRenderMaterial | mat1,
|  | IRenderMaterial | mat2
| ) |  |

abstract IRenderMaterial VisimBox.Renderer.MaterialManager.CreateColorMaterial | ( | string | name,
|  | ref StandardColorValues | values
| ) |  | `[protected, pure virtual]`

Creates standard colored material from color values.

Parameters:

  values | Color values for standard lightning equation

Returns:
  New material

Implemented in VisimRenderGL.GLMaterialMan.

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateColorMaterial | ( | string | name,
|  | StandardColorValues | values
| ) |  | `[protected]`

Creates standard colored material from color values.

Parameters:

  values | Color values for standard lightning equation
  name | Requested name for the material

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateCopy | ( | string | originalkey,
|  | string | newkey = `null`
| ) |  |

creates copy of material with identifier original key, adds to manager and returns pointer

Parameters:

  originalkey | original material
  newkey | name for copy, if null, will be "originalkey + copy"

Returns:

abstract IRenderMaterial VisimBox.Renderer.MaterialManager.CreateSimpleColor | ( | string | name,
|  | ColorByte | color
| ) |  | `[protected, pure virtual]`

Creates new simple colored material (just one color, no lightning)

Parameters:

  color | Required color
  name | Requested name for the material

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateSimpleColor | ( | string | name,
|  | Color | color
| ) |  | `[protected]`

Creates new simple colored material (just one color, no lightning)

Parameters:

  color | Required color
  name | Requested name for the material

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTextured | ( | string | name,
|  | Texture | tex,
|  | StandardColorValues | values
| ) |  | `[protected]`

Creates colored textured material (standard colors + one diffuse texture)

Parameters:

  tex | Texture
  values | Color values
  name | Requested name for the material

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTextured | ( | string | name,
|  | string | texture,
|  | StandardColorValues | values
| ) |  | `[protected]`

Creates colored textured material (standard colors + one diffuse texture)

Parameters:

  texture | Required texture name (either name in texture manager, or filename to load)
  values | Color values
  name | Requested name for the material

Returns:
  New material

abstract IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTextured | ( | string | name,
|  | Texture | tex,
|  | ref StandardColorValues | values
| ) |  | `[protected, pure virtual]`

Creates colored textured material (standard colors + one diffuse texture)

Parameters:

  tex | Texture
  values | Color values
  name | Requested name for the material

Returns:
  New material

Implemented in VisimRenderGL.GLMaterialMan.

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTextured | ( | string | name,
|  | string | texture,
|  | ref StandardColorValues | values
| ) |  | `[protected]`

Creates colored textured material (standard colors + one diffuse texture)

Parameters:

  texture | Required texture name (either name in texture manager, or filename to load)
  name | Requested name for the material
  values | Color values

Returns:
  New material

IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTexturedSimple | ( | string | name,
|  | string | texture
| ) |  | `[protected]`

Creates simple textured material (just one color texture)

Parameters:

  name | Requested name for the material
  texture | Required texture name (either name in texture manager, or filename to load)

Returns:
  New material

abstract IRenderMaterial VisimBox.Renderer.MaterialManager.CreateTexturedSimple | ( | string | name,
|  | Texture | tex
| ) |  | `[protected, pure virtual]`

Creates simple textured material (just one color texture)

Parameters:

  tex | Required texture
  name | Requested name for the material

Returns:
  New material

Implemented in VisimRenderGL.GLMaterialMan.

bool VisimBox.Renderer.MaterialManager.LoadLibrary | ( | XmlTextReader | reader,
|  | bool | merge = `true`
| ) |  |

Reads library from XML file.

Parameters:

  reader | XML reader, should be set to node "materiallibrary"
  merge | if true, materials with same name and same values in manager and file will be merged, otherwise copies will be made

Returns:
  True if load sucesfull

bool VisimBox.Renderer.MaterialManager.LoadLibrary | ( | string | filename,
|  | bool | merge = `true`
| ) |  |

Loads material library from disk.

Parameters:

  filename | Filename to load library from
  merge | if true, materials with same name and same values in manager and file will be merged, otherwise copies will be made

Returns:
  True if load sucesfull

bool VisimBox.Renderer.MaterialManager.ReadMaterial | ( | XmlTextReader | reader,
|  | bool | merge = `true`
| ) |  |

override string VisimBox.Renderer.MaterialManager.Rename | ( | string | key,
|  | string | newkey,
|  | bool | uniquename = `true`
| ) |  | `[virtual]`

Renames key to new value.

Parameters:

  key | Original key
  newkey | New key
  uniquename | If unique set to true, unique newkwey will be found

Returns:
  New used key or null (if object not found)

Reimplemented from VisimBox.Resources.AbstractResMan< T >.

void VisimBox.Renderer.MaterialManager.ReplaceMaterial | ( | IRenderMaterial | mat1,
|  | IRenderMaterial | mat2,
|  | bool | deleteold = `false`
| ) |  |

Replaces material mat1 with mat2 (exchanging names for named references, calling resourcereplaced callbacks of consumers) Note, mat2 must be referenceless, otherwise throws exception!

Parameters:

  mat1 |
  mat2 |

bool VisimBox.Renderer.MaterialManager.SaveLibrary | ( | XmlTextWriter | writer,
|  | bool | allmaterials = `true`
| ) |  |

Saves material library to XML document.

Parameters:

  writer | XML writer
  allmaterials | If true, even nonreferenced materials will be saved

Returns:
  True if save sucessful

bool VisimBox.Renderer.MaterialManager.SaveLibrary | ( | string | filename,
|  | bool | allmaterials = `true`
| ) |  |

Saves material library to disk.

Parameters:

  filename | Filename to save
  allmaterials | If true, even nonreferenced materials will be saved

Returns:
  True if save sucessful

## Member Data Documentation

string VisimBox.Renderer.MaterialManager.MatVersionLibrary = "1.0"`[protected]`

IRenderer VisimBox.Renderer.MaterialManager.owner`[protected]`

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

- MaterialManager.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events