VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

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

Static Public Member Functions
VisiMath.VertexFactory Class Reference

Static class, factory automatically creating vertex descriptors from vertex structures using attributes and reflection Also returns informations about the vertex. More...

List of all members.

## Static Public Member Functions
static IVertex | CreateNewVertex (Type vertextype)
| Creates new vertex of specified type.
static Type | GetTypeFromName (string vertextypename)
| Returns vertex type from type name.
static IVertexArray | ReadFromXml (XmlReader reader)
static void | CopyVertex (ref IVertex source, ref IVertex target)
| Copies relevant portions of source vertex to target vertex.
static T | CopyVertex< T > (IVertex source)
| Returns copy of the vertex in the specified format.
static IVertex | CopyVertex (IVertex source, Type VertexType)
static void | CopyVertexArray< T > (IVertexArray source, out VertexArray< T > target)
| Copies source vertex array to vertex array of different vertex format.
static void | CopyVertexArray (Type VertexType, IVertexArray source, out IVertexArray target)
| Copies source vertex array to vertex array of different vertex format.
static IVertex[] | CreateNormalArray (Type vertextype, int count)
| Creates normal array of vertices of selected type.
static IVertexArray | CreateArray (Type vertextype, int count)
| Creates VertexArray of specified type.
static VertexList< IVertex > | CreateList (Type vertextype, int count=1)
| Creates VertexArray of specified type.
static int | GetByteSize (Type VertexType)
| Returns byte size of vertex type.
static VertexDescriptor | GetDescriptor (Type vertexType)
| Returns vertex descriptor for the specified vertextype. Either returns cached result from previous calls or creates new descriptor using reflection.
static bool | HasNormal (Type vertextype)
| Checks if specified vertex contains definition for normal.
static bool | HasColor (Type vertextype)
| Checks if vertex type contains color information.
static bool | HasTexCoord (Type vertextype)
| Checks if vertex type contains texture coordinates.

## Detailed Description

Static class, factory automatically creating vertex descriptors from vertex structures using attributes and reflection Also returns informations about the vertex.

## Member Function Documentation

static void VisiMath.VertexFactory.CopyVertex | ( | ref IVertex | source,
|  | ref IVertex | target
| ) |  | `[static]`

Copies relevant portions of source vertex to target vertex.

Parameters:

  source | source vertex
  target | target vertex

static IVertex VisiMath.VertexFactory.CopyVertex | ( | IVertex | source,
|  | Type | VertexType
| ) |  | `[static]`

static T VisiMath.VertexFactory.CopyVertex< T > | ( | IVertex | source | ) | `[static]`

Returns copy of the vertex in the specified format.

Template Parameters:

  T | Requested vertex format

Parameters:

  source | Source vertex

Returns:
  New vertex

Type Constraints

  T | : | IVertex |

static void VisiMath.VertexFactory.CopyVertexArray | ( | Type | VertexType,
|  | IVertexArray | source,
|  | out IVertexArray | target
| ) |  | `[static]`

Copies source vertex array to vertex array of different vertex format.

Parameters:

  source | Source vertex array
  target | target vertex array
  VertexType | Required vertex type

static void VisiMath.VertexFactory.CopyVertexArray< T > | ( | IVertexArray | source,
|  | out VertexArray< T > | target
| ) |  | `[static]`

Copies source vertex array to vertex array of different vertex format.

Template Parameters:

  T | Target vertex

Parameters:

  source | Source vertex array
  target | target vertex array

Type Constraints

  T | : | IVertex |

static IVertexArray VisiMath.VertexFactory.CreateArray | ( | Type | vertextype,
|  | int | count
| ) |  | `[static]`

Creates VertexArray of specified type.

Parameters:

  vertextype | requested type
  count | size of the array

Returns:
  new VertexArray

static VertexList<IVertex> VisiMath.VertexFactory.CreateList | ( | Type | vertextype,
|  | int | count = `1`
| ) |  | `[static]`

Creates VertexArray of specified type.

Parameters:

  vertextype | requested type
  count | starting size of the list

Returns:
  new VertexList

static IVertex VisiMath.VertexFactory.CreateNewVertex | ( | Type | vertextype | ) | `[static]`

Creates new vertex of specified type.

Parameters:

  vertextype |

Returns:

static IVertex [] VisiMath.VertexFactory.CreateNormalArray | ( | Type | vertextype,
|  | int | count
| ) |  | `[static]`

Creates normal array of vertices of selected type.

Parameters:

  vertextype | requested type
  count | size of the array

Returns:
  new IVertex[]

static int VisiMath.VertexFactory.GetByteSize | ( | Type | VertexType | ) | `[static]`

Returns byte size of vertex type.

Parameters:

  VertexType | Vertex type

Returns:
  Size in bytes

static VertexDescriptor VisiMath.VertexFactory.GetDescriptor | ( | Type | vertexType | ) | `[static]`

Returns vertex descriptor for the specified vertextype. Either returns cached result from previous calls or creates new descriptor using reflection.

Parameters:

  vertexType | Type of the vertex - must be struct using custom VertexElementAtttributes

Returns:
  Vertexdescriptor for the vertex

Exceptions:

  System.ArgumentException | Thrown if specified type: -is not a value type doesn't contain at least one recognized vertex element type

static Type VisiMath.VertexFactory.GetTypeFromName | ( | string | vertextypename | ) | `[static]`

Returns vertex type from type name.

Parameters:

  vertextypename | type name of vertex

Returns:
  Type or null if not IVertex

static bool VisiMath.VertexFactory.HasColor | ( | Type | vertextype | ) | `[static]`

Checks if vertex type contains color information.

Parameters:

  vertextype | type of the vertex

Returns:
  True if contains color, false if not or if type is not recognized vertex

static bool VisiMath.VertexFactory.HasNormal | ( | Type | vertextype | ) | `[static]`

Checks if specified vertex contains definition for normal.

Parameters:

  vertextype | type of the vertex

Returns:
  True if contains normal, false if not or if type is not recognized vertex

static bool VisiMath.VertexFactory.HasTexCoord | ( | Type | vertextype | ) | `[static]`

Checks if vertex type contains texture coordinates.

Parameters:

  vertextype | type of the vertex

Returns:
  True if contains texturecoordinates, false if not or if type is not recognized vertex

static IVertexArray VisiMath.VertexFactory.ReadFromXml | ( | XmlReader | reader | ) | `[static]`

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

- VertexDescriptors.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events