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
VisimBox.Renderer.RenderObjects.Mesh Class Reference

Renderer object - mesh made from vertices (and optionally indices) stored in vertex / index buffer. More...

Inheritance diagram for VisimBox.Renderer.RenderObjects.Mesh:

List of all members.

## Public Member Functions
| Mesh (IVertexBuffer vert, IIndexBuffer ind, PrimitiveTypes type)
| Constructs new mesh.
abstract void | Render (IRenderContext irc)
| Pushes geometry inside the renderer.
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.
virtual void | Dispose ()
virtual void | ResourceDisposing (IResource resource)
| Callback for resource disposing - just before releasing itself from memory resource will call all it's consumers to notify them it will be no longer valid.
virtual bool | ResourceReplaced (IResource original, IResource newresource)
| Resource was replaced by another resource. Consumers can decide to keep new resource instead or hold to original value. If consumers wants to hold new resource instead, it should change it's pointers and return true, references in resources will be automatically updated. If false, consumer is not interested in new resource - depending on the nature of replace it may then get ResourceDisposing callback.
## Protected Member Functions
virtual void | DisposeConsumers ()
## Protected Attributes
IVertexBuffer | _Vertices
IIndexBuffer | _Indices
ResourceUsage | usage
string | _FileName
List< IResourceConsumer > | Consumers = new List<IResourceConsumer>()
## Properties
IVertexBuffer | Vertices`[get]`
| Vertices making the mesh.
IIndexBuffer | Indices`[get]`
| Indices for elements (can be null for list type meshes)
PrimitiveTypes | PrimitiveType`[get, set]`
| Primitive type. Accepted types are PointList, LineList, TriangleList, QuadList and IndexedLines, IndexedTriangles and IndexedQuads.
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 | 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.

## Detailed Description

Renderer object - mesh made from vertices (and optionally indices) stored in vertex / index buffer.

## Constructor & Destructor Documentation

VisimBox.Renderer.RenderObjects.Mesh.Mesh | ( | IVertexBuffer | vert,
|  | IIndexBuffer | ind,
|  | PrimitiveTypes | type
| ) |  |

Constructs new mesh.

Parameters:

  vert | Vertex buffer with vertices
  ind | Indexbuffer, can be null for nonindexed elements
  type | Type of the primitive

## Member Function Documentation

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

Adds reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

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

Reimplemented in VisimRenderGL.GLMesh.

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

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

Removes reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

abstract void VisimBox.Renderer.RenderObjects.Mesh.Render | ( | IRenderContext | irc | ) | `[pure virtual]`

Pushes geometry inside the renderer.

Implemented in VisimRenderGL.GLMesh.

virtual bool VisimBox.Renderer.RenderObjects.Mesh.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.

virtual void VisimBox.Renderer.RenderObjects.Mesh.ResourceDisposing | ( | IResource | resource | ) | `[virtual]`

Callback for resource disposing - just before releasing itself from memory resource will call all it's consumers to notify them it will be no longer valid.

Parameters:

  resource | Resource which is being disposed

Implements VisimBox.Resources.IResourceConsumer.

virtual bool VisimBox.Renderer.RenderObjects.Mesh.ResourceReplaced | ( | IResource | original,
|  | IResource | newresource
| ) |  | `[virtual]`

Resource was replaced by another resource. Consumers can decide to keep new resource instead or hold to original value. If consumers wants to hold new resource instead, it should change it's pointers and return true, references in resources will be automatically updated. If false, consumer is not interested in new resource - depending on the nature of replace it may then get ResourceDisposing callback.

Parameters:

  original | Original resource registered with consumer
  newresource | New resource

Returns:
  Consumer must return true if it want's to change reference to newresource, otherwise false.

Implements VisimBox.Resources.IResourceConsumer.

## Member Data Documentation

string VisimBox.Renderer.RenderObjects.Mesh._FileName`[protected]`

IIndexBuffer VisimBox.Renderer.RenderObjects.Mesh._Indices`[protected]`

IVertexBuffer VisimBox.Renderer.RenderObjects.Mesh._Vertices`[protected]`

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

ResourceUsage VisimBox.Renderer.RenderObjects.Mesh.usage`[protected]`

## Property Documentation

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

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

Implements VisimBox.Resources.IResource.

string VisimBox.Renderer.RenderObjects.Mesh.FileName`[get, set]`

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

Implements VisimBox.Resources.IResource.

IIndexBuffer VisimBox.Renderer.RenderObjects.Mesh.Indices`[get]`

Indices for elements (can be null for list type meshes)

int VisimBox.Renderer.RenderObjects.Mesh.NullReferences`[get]`

Returns number of null generic references.

Implements VisimBox.Resources.IResource.

PrimitiveTypes VisimBox.Renderer.RenderObjects.Mesh.PrimitiveType`[get, set]`

Primitive type. Accepted types are PointList, LineList, TriangleList, QuadList and IndexedLines, IndexedTriangles and IndexedQuads.

int VisimBox.Renderer.RenderObjects.Mesh.References`[get]`

Number of current references.

Implements VisimBox.Resources.IResource.

ResourceType VisimBox.Renderer.RenderObjects.Mesh.ResourceType`[get]`

Generic type of the resource.

Implements VisimBox.Resources.IResource.

ResourceUsage VisimBox.Renderer.RenderObjects.Mesh.Usage`[get]`

Type of the resource usage (static/dynamic)

Implements VisimBox.Resources.IResource.

IVertexBuffer VisimBox.Renderer.RenderObjects.Mesh.Vertices`[get]`

Vertices making the mesh.

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

- Mesh.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events