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 | Properties | Events
VisimBox.Renderer.RenderMaterial Class Reference

Base rendering material. More...

Inheritance diagram for VisimBox.Renderer.RenderMaterial:

List of all members.

## Public Member Functions
virtual void | Dispose ()
virtual void | AddReference (IResourceConsumer consumer)
| Adds reference to this resource.
virtual void | RemoveReference (IResourceConsumer consumer)
| Removes reference to this resource.
virtual bool | ReplaceReferences (IResource newresource)
| Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.
abstract void | OnActivate (RendererEventArgs args)
| Activate material (called from Activate)
virtual void | Activate (RendererEventArgs args)
| Activate material for rendering (called by the renderer when using material) Calls registered events and then OnActivate.
abstract bool | HasColorElement (MaterialElement element)
| Returns true if material contains specified color element.
abstract bool | HasTextureElement (MaterialElement element)
| Returns true if material contains specified texture element.
abstract ColorByte | GetColorElement (MaterialElement element)
| Returns value of specified color element (or white if it doesn't contain this)
abstract Texture | GetTextureElement (MaterialElement element)
| Returns texture on specified element (or null)
abstract void | SetColorElement (MaterialElement element, ColorByte color)
| Sets value of specified color element (if supported by material)
abstract void | SetTextureElement (MaterialElement element, Texture tex)
| Sets value of specified texture element (if supported by material)
abstract IRenderMaterial | CreateCopy (string newname)
| Creates copy of self with new name.
System.Xml.Schema.XmlSchema | GetSchema ()
| Reqired by IXMLserializable.
abstract void | ReadXml (System.Xml.XmlReader reader)
| Deserializes object from XML.
abstract void | WriteXml (System.Xml.XmlWriter writer)
| Serializes object to XML.
## Protected Member Functions
| RenderMaterial ()
| No direct constructor allowd.
| RenderMaterial (string name, RenderMaterialType type)
virtual void | DisposeConsumers ()
## Protected Attributes
string | _name
string | _filename
string | _description
bool | _alpha
RenderMaterialType | _materialType
List< IResourceConsumer > | Consumers = new List<IResourceConsumer>()
## Properties
virtual bool | AlwaysStay`[get, set]`
| If true, resource will stay in memory even if it's not referenced.
ResourceType | ResourceType`[get]`
| Generic type of the resource.
ResourceUsage | Usage`[get]`
| Type of the resource usage (static/dynamic)
string | Name`[get, set]`
| Name of the material.
string | FileName`[get, set]`
| File used to create the resource (if it was loaded from the disk)
int | References`[get]`
| Number of current references.
int | NullReferences`[get]`
| Returns number of null generic references.
string | Description`[get, set]`
| Description of the material.
virtual bool | HasAlpha`[get, set]`
| Does material contain alpha values? (transparency) Required for renderer for correct drawing (alpha materials must be drawn last, in reverse order back to front as opposed to normal materials)
RenderMaterialType | MaterialType`[get]`
| Basic type of material.
## Events
RendererEvent | Activating
| This event is fired on the activation of the material - for user code for time changing materials.

## Detailed Description

Base rendering material.

## Constructor & Destructor Documentation

VisimBox.Renderer.RenderMaterial.RenderMaterial | ( |  | ) | `[protected]`

No direct constructor allowd.

VisimBox.Renderer.RenderMaterial.RenderMaterial | ( | string | name,
|  | RenderMaterialType | type
| ) |  | `[protected]`

## Member Function Documentation

virtual void VisimBox.Renderer.RenderMaterial.Activate | ( | RendererEventArgs | args | ) | `[virtual]`

Activate material for rendering (called by the renderer when using material) Calls registered events and then OnActivate.

Parameters:

  args | Renderer arguments

Implements VisimBox.Renderer.IRenderMaterial.

virtual void VisimBox.Renderer.RenderMaterial.AddReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Adds reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

abstract IRenderMaterial VisimBox.Renderer.RenderMaterial.CreateCopy | ( | string | newname | ) | `[pure virtual]`

Creates copy of self with new name.

Parameters:

  newname | name for the copy

Returns:
  new material

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

virtual void VisimBox.Renderer.RenderMaterial.Dispose | ( |  | ) | `[virtual]`

virtual void VisimBox.Renderer.RenderMaterial.DisposeConsumers | ( |  | ) | `[protected, virtual]`

abstract ColorByte VisimBox.Renderer.RenderMaterial.GetColorElement | ( | MaterialElement | element | ) | `[pure virtual]`

Returns value of specified color element (or white if it doesn't contain this)

Parameters:

  element | Element type

Returns:
  Color value

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, and VisimRenderGL.GLMaterialColored.

System.Xml.Schema.XmlSchema VisimBox.Renderer.RenderMaterial.GetSchema | ( |  | ) |

Reqired by IXMLserializable.

Returns:
  Null

abstract Texture VisimBox.Renderer.RenderMaterial.GetTextureElement | ( | MaterialElement | element | ) | `[pure virtual]`

Returns texture on specified element (or null)

Parameters:

  element | Element type

Returns:
  Texture object

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

abstract bool VisimBox.Renderer.RenderMaterial.HasColorElement | ( | MaterialElement | element | ) | `[pure virtual]`

Returns true if material contains specified color element.

Parameters:

  element | element type

Returns:
  True if material has this type of element

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, and VisimRenderGL.GLMaterialColored.

abstract bool VisimBox.Renderer.RenderMaterial.HasTextureElement | ( | MaterialElement | element | ) | `[pure virtual]`

Returns true if material contains specified texture element.

Parameters:

  element | element type

Returns:
  True if material has this type of element

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

abstract void VisimBox.Renderer.RenderMaterial.OnActivate | ( | RendererEventArgs | args | ) | `[pure virtual]`

Activate material (called from Activate)

Parameters:

  args | Rendering arguments

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

abstract void VisimBox.Renderer.RenderMaterial.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[pure virtual]`

Deserializes object from XML.

Parameters:

  reader | XML reader

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

virtual void VisimBox.Renderer.RenderMaterial.RemoveReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Removes reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

virtual bool VisimBox.Renderer.RenderMaterial.ReplaceReferences | ( | IResource | newresource | ) | `[virtual]`

Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.

Parameters:

  newresource | New resource

Returns:
  True if resource is compatible type and all consumers accepted resource changing, false otherwise

Implements VisimBox.Resources.IResource.

abstract void VisimBox.Renderer.RenderMaterial.SetColorElement | ( | MaterialElement | element,
|  | ColorByte | color
| ) |  | `[pure virtual]`

Sets value of specified color element (if supported by material)

Parameters:

  element | Element type
  color | Color value

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, and VisimRenderGL.GLMaterialColored.

abstract void VisimBox.Renderer.RenderMaterial.SetTextureElement | ( | MaterialElement | element,
|  | Texture | tex
| ) |  | `[pure virtual]`

Sets value of specified texture element (if supported by material)

Parameters:

  element | Element type
  tex | Texture value

Implements VisimBox.Renderer.IRenderMaterial.

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

abstract void VisimBox.Renderer.RenderMaterial.WriteXml | ( | System.Xml.XmlWriter | writer | ) | `[pure virtual]`

Serializes object to XML.

Parameters:

  writer | XML writer to save values

Implemented in VisimRenderGL.GLMaterialSimpleColor, VisimRenderGL.GLMaterialSimpleTex, VisimRenderGL.GLMaterialColored, and VisimRenderGL.GLMaterialColoredTex.

## Member Data Documentation

bool VisimBox.Renderer.RenderMaterial._alpha`[protected]`

string VisimBox.Renderer.RenderMaterial._description`[protected]`

string VisimBox.Renderer.RenderMaterial._filename`[protected]`

RenderMaterialType VisimBox.Renderer.RenderMaterial._materialType`[protected]`

string VisimBox.Renderer.RenderMaterial._name`[protected]`

List<IResourceConsumer> VisimBox.Renderer.RenderMaterial.Consumers = new List<IResourceConsumer>()`[protected]`

## Property Documentation

virtual bool VisimBox.Renderer.RenderMaterial.AlwaysStay`[get, set]`

If true, resource will stay in memory even if it's not referenced.

Implements VisimBox.Resources.IResource.

string VisimBox.Renderer.RenderMaterial.Description`[get, set]`

Description of the material.

Implements VisimBox.Renderer.IRenderMaterial.

string VisimBox.Renderer.RenderMaterial.FileName`[get, set]`

File used to create the resource (if it was loaded from the disk)

Implements VisimBox.Resources.IResource.

virtual bool VisimBox.Renderer.RenderMaterial.HasAlpha`[get, set]`

Does material contain alpha values? (transparency) Required for renderer for correct drawing (alpha materials must be drawn last, in reverse order back to front as opposed to normal materials)

Implements VisimBox.Renderer.IRenderMaterial.

RenderMaterialType VisimBox.Renderer.RenderMaterial.MaterialType`[get]`

Basic type of material.

Implements VisimBox.Renderer.IRenderMaterial.

string VisimBox.Renderer.RenderMaterial.Name`[get, set]`

Name of the material.

Implements VisimBox.Renderer.IRenderMaterial.

int VisimBox.Renderer.RenderMaterial.NullReferences`[get]`

Returns number of null generic references.

Implements VisimBox.Resources.IResource.

int VisimBox.Renderer.RenderMaterial.References`[get]`

Number of current references.

Implements VisimBox.Resources.IResource.

ResourceType VisimBox.Renderer.RenderMaterial.ResourceType`[get]`

Generic type of the resource.

Implements VisimBox.Resources.IResource.

ResourceUsage VisimBox.Renderer.RenderMaterial.Usage`[get]`

Type of the resource usage (static/dynamic)

Implements VisimBox.Resources.IResource.

## Event Documentation

RendererEvent VisimBox.Renderer.RenderMaterial.Activating

This event is fired on the activation of the material - for user code for time changing materials.

Implements VisimBox.Renderer.IRenderMaterial.

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

- Materials.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events