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.Geometry.GeoFactory Class Reference

Geometric factory for making geometry objects. More...

List of all members.

## Static Public Member Functions
static IndexedMesh | CreateSphere< T > (Vector3 center, float radius, float quality=0.5f)
| Creates indexed mesh with sphere (with specified type of vertex)
static IndexedMesh | CreateSphere< T > (Vector3 center, float radius, out Sphere sph, float quality=0.5f)
| Creates indexed mesh with sphere (with specified type of vertex)
static IndexedMesh | CreateSphere (Vector3 center, float radius, float quality=0.5f)
| Creates indexed mesh with sphere (with NormalVertex)
static IndexedMesh | CreateSphere (Vector3 center, float radius, out Sphere sph, float quality=0.5f)
| Creates indexed mesh with sphere (with NormalVertex)
static IndexedMesh | CreateBox (Vector3 min, Vector3 max)
| Creates new indexed mesh (normalvertex) with simple box.
static IndexedMesh | CreateBox< T > (Vector3 min, Vector3 max)
| Creates new indexed mesh with simple box.
static IndexedMesh | CreateBox (Vector3 min, Vector3 max, out AABox box)
| Creates new indexed mesh (normalvertex) with simple box.
static IndexedMesh | CreateBox (Type VertexType, Vector3 min, Vector3 max, out AABox box)
| Creates new indexed mesh with simple box.
static IndexedMesh | CreateBox< T > (Vector3 min, Vector3 max, out AABox box)
| Creates new indexed mesh with simple box.
static IndexedMesh | CreateBox (Vector3 center, float xwidth, float ywidth, float zwidth)
| Creates new indexed mesh (normal vertex) with simple box.
static IndexedMesh | CreateBox< T > (Vector3 center, float xwidth, float ywidth, float zwidth)
| Creates new indexed mesh with simple box.
static IndexedMesh | CreateBox< T > (Vector3 center, float xwidth, float ywidth, float zwidth, out AABox box)
| Creates new indexed mesh with simple box.
static QuadList | CreateQuad (Vector3 center, float width, float height, Vector3 normal)
| Creates new Quad (texturedvertex type)
static QuadList | CreateQuad< T > (Vector3 center, float width, float height, Vector3 normal)
| Creates new Quad.
static QuadList | CreateQuad (Type VertexType, Vector3 center, float width, float height, Vector3 normal)
| Creates new Quad.
static IndexedMesh | CreateBoulder (ColorByte basecolor, float radius, float quality, Random rgen=null)
static void | RegisterGeometryType (Type geotype)
| For user loading geometry objects. Every IGeometry type in the assembly of the library is added automatically, but user types from different assemblies must be registered by hand with this function or with RegisterGeometryTypes(Assembly assembly) for assemblies.
static void | RegisterGeometryTypes (Assembly assembly)
| Registers all IGeometry objects in assembly to registered type database.
static Type | GetGeoTypeByName (string name)
| Returns geotype of specified typename.
static IGeometry | ReadXml (XmlReader reader)
| Tries to read IGeometry object from XML stream.
static T | ReadXml< T > (XmlReader reader)
| Strongly typed reading. Tries to read IGeometry object from XML stream and return it if type is correct. Otherwise throws argument exception (as null cannot be used for generic type)
static bool | ReadXml< T > (XmlReader reader, out T geometry, out IGeometry original, out bool converted)
| Strongly typed reading. Tries to read IGeometry object from XML stream and return it if type is correct. If not, tries to convert object.
static void | SaveOBJ (string filename, IndexedMesh mesh)
static AABox | CreateBoundingBox (IGeometry geoobject)
| Creates AA bounding box from generic geometry object (will use conversion to points!)
static AABox | CreateBoundingBox (Geometry geoobject)
| Calculates AA bounding box for any vertex based geometry.
static AABox | CreateBoundingBox (IndexedGeo geoobject)
| Calculates AA bounding box for current subset of indexed vertex based geometry.
static Sphere | CreateBoundingSphere (IGeometry geoobject)
| Creates bounding sphere from generic geometry object (will use conversion to points!)
static Sphere | CreateBoundingSphere (Geometry geoobject)
| Calculates bounding sphere for any vertex based geometry.
static Sphere | CreateBoundingSphere (IndexedGeo geoobject)
| Calculates bounding sphere for current subset of indexed vertex based geometry.
static IGeometry | CreateBoundingObject (IGeometry geoobject)
| Calculates best bounding object for current subset of generic geometry object (will use conversion to points)
static IGeometry | CreateBoundingObject (Geometry geoobject)
| Calculates best bounding object for current subset of vertex based geometry.
static IGeometry | CreateBoundingObject (IndexedGeo geoobject)
| Calculates best bounding object for current subset of indexed vertex based geometry.
static IGeometry | ChooseBoundingObject (Sphere sph, AABox box)

## Detailed Description

Geometric factory for making geometry objects.

## Member Function Documentation

static IGeometry VisiMath.Geometry.GeoFactory.ChooseBoundingObject | ( | Sphere | sph,
|  | AABox | box
| ) |  | `[static]`

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBoulder | ( | ColorByte | basecolor,
|  | float | radius,
|  | float | quality,
|  | Random | rgen = `null`
| ) |  | `[static]`

static AABox VisiMath.Geometry.GeoFactory.CreateBoundingBox | ( | IGeometry | geoobject | ) | `[static]`

Creates AA bounding box from generic geometry object (will use conversion to points!)

Parameters:

  geoobject | Geometry object

Returns:
  AA bounding box

static AABox VisiMath.Geometry.GeoFactory.CreateBoundingBox | ( | Geometry | geoobject | ) | `[static]`

Calculates AA bounding box for any vertex based geometry.

Parameters:

  geoobject | Vertex based geometry object

Returns:
  Bounding box

static AABox VisiMath.Geometry.GeoFactory.CreateBoundingBox | ( | IndexedGeo | geoobject | ) | `[static]`

Calculates AA bounding box for current subset of indexed vertex based geometry.

Parameters:

  geoobject | Indexed Vertex based geometry object

Returns:
  Bounding box

static IGeometry VisiMath.Geometry.GeoFactory.CreateBoundingObject | ( | IndexedGeo | geoobject | ) | `[static]`

Calculates best bounding object for current subset of indexed vertex based geometry.

Parameters:

  geoobject | Indexed Vertex based geometry object

Returns:
  Bounding box or bounding sphere (depending on which one better fits)

static IGeometry VisiMath.Geometry.GeoFactory.CreateBoundingObject | ( | IGeometry | geoobject | ) | `[static]`

Calculates best bounding object for current subset of generic geometry object (will use conversion to points)

Parameters:

  geoobject | Generic geometry object

Returns:
  Bounding box or bounding sphere (depending on which one better fits)

static IGeometry VisiMath.Geometry.GeoFactory.CreateBoundingObject | ( | Geometry | geoobject | ) | `[static]`

Calculates best bounding object for current subset of vertex based geometry.

Parameters:

  geoobject | Vertex based geometry object

Returns:
  Bounding box or bounding sphere (depending on which one better fits)

static Sphere VisiMath.Geometry.GeoFactory.CreateBoundingSphere | ( | Geometry | geoobject | ) | `[static]`

Calculates bounding sphere for any vertex based geometry.

Parameters:

  geoobject | Vertex based geometry object

Returns:
  Bounding sphere

static Sphere VisiMath.Geometry.GeoFactory.CreateBoundingSphere | ( | IGeometry | geoobject | ) | `[static]`

Creates bounding sphere from generic geometry object (will use conversion to points!)

Parameters:

  geoobject | Geometry object

Returns:
  bounding sphere

static Sphere VisiMath.Geometry.GeoFactory.CreateBoundingSphere | ( | IndexedGeo | geoobject | ) | `[static]`

Calculates bounding sphere for current subset of indexed vertex based geometry.

Parameters:

  geoobject | Indexed Vertex based geometry object

Returns:
  Bounding sphere

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox | ( | Vector3 | min,
|  | Vector3 | max
| ) |  | `[static]`

Creates new indexed mesh (normalvertex) with simple box.

Parameters:

  min | Minimal values of the aa box
  max | maximal values of the aa box

Returns:
  New indexed mesh containing the box

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox | ( | Type | VertexType,
|  | Vector3 | min,
|  | Vector3 | max,
|  | out AABox | box
| ) |  | `[static]`

Creates new indexed mesh with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  min | Minimal values of the aa box
  max | maximal values of the aa box
  box | Will be filled with used aabox (for bounding object)
  VertexType | Required type of the vertex

Returns:
  New indexed mesh containing the box

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox | ( | Vector3 | center,
|  | float | xwidth,
|  | float | ywidth,
|  | float | zwidth
| ) |  | `[static]`

Creates new indexed mesh (normal vertex) with simple box.

Parameters:

  center | Center of the box
  xwidth | Width in the x axis
  ywidth | Width in the y axis
  zwidth | Width in the z axis

Returns:
  New indexed mesh containing the box

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox | ( | Vector3 | min,
|  | Vector3 | max,
|  | out AABox | box
| ) |  | `[static]`

Creates new indexed mesh (normalvertex) with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  min | Minimal values of the aa box
  max | maximal values of the aa box
  box | Will be filled with used aabox (for bounding object)

Returns:
  New indexed mesh containing the box

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox< T > | ( | Vector3 | min,
|  | Vector3 | max
| ) |  | `[static]`

Creates new indexed mesh with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  min | Minimal values of the aa box
  max | maximal values of the aa box

Returns:
  New indexed mesh containing the box

Type Constraints

  T | : | IVertex |
  T | : | new() |

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox< T > | ( | Vector3 | min,
|  | Vector3 | max,
|  | out AABox | box
| ) |  | `[static]`

Creates new indexed mesh with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  min | Minimal values of the aa box
  max | maximal values of the aa box
  box | Will be filled with used aabox (for bounding object)

Returns:
  New indexed mesh containing the box

Type Constraints

  T | : | IVertex |
  T | : | new() |

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox< T > | ( | Vector3 | center,
|  | float | xwidth,
|  | float | ywidth,
|  | float | zwidth
| ) |  | `[static]`

Creates new indexed mesh with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  center | Center of the box
  xwidth | Width in the x axis
  ywidth | Width in the y axis
  zwidth | Width in the z axis

Returns:
  New indexed mesh containing the box

Type Constraints

  T | : | IVertex |
  T | : | new() |

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateBox< T > | ( | Vector3 | center,
|  | float | xwidth,
|  | float | ywidth,
|  | float | zwidth,
|  | out AABox | box
| ) |  | `[static]`

Creates new indexed mesh with simple box.

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  center | Center of the box
  xwidth | Width in the x axis
  ywidth | Width in the y axis
  zwidth | Width in the z axis
  box | Will be filled with used aabox (for bounding object)

Returns:
  New indexed mesh containing the box

Type Constraints

  T | : | IVertex |
  T | : | new() |

static QuadList VisiMath.Geometry.GeoFactory.CreateQuad | ( | Vector3 | center,
|  | float | width,
|  | float | height,
|  | Vector3 | normal
| ) |  | `[static]`

Creates new Quad (texturedvertex type)

Parameters:

  center | Center of the quad
  width | Width (in x)
  height | Height (in y)
  normal | Normal of the quad (0,0,-1) means quad in x/y plane facing up

Returns:
  New quad

static QuadList VisiMath.Geometry.GeoFactory.CreateQuad | ( | Type | VertexType,
|  | Vector3 | center,
|  | float | width,
|  | float | height,
|  | Vector3 | normal
| ) |  | `[static]`

Creates new Quad.

Parameters:

  center | Center of the quad
  width | Width (in x)
  height | Height (in y)
  normal | Normal of the quad (0,0,-1) means quad in x/y plane facing up
  VertexType | Required vertex type

Returns:
  New quad

static QuadList VisiMath.Geometry.GeoFactory.CreateQuad< T > | ( | Vector3 | center,
|  | float | width,
|  | float | height,
|  | Vector3 | normal
| ) |  | `[static]`

Creates new Quad.

Parameters:

  center | Center of the quad
  width | Width (in x)
  height | Height (in y)
  normal | Normal of the quad (0,0,-1) means quad in x/y plane facing up

Returns:
  New quad

Type Constraints

  T | : | IVertex |
  T | : | new() |

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateSphere | ( | Vector3 | center,
|  | float | radius,
|  | float | quality = `0.5f`
| ) |  | `[static]`

Creates indexed mesh with sphere (with NormalVertex)

Parameters:

  center | Center of the sphere
  radius | Radius
  quality | Quality (0 to 1)

Returns:
  New indexed mesh containing the sphere

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateSphere | ( | Vector3 | center,
|  | float | radius,
|  | out Sphere | sph,
|  | float | quality = `0.5f`
| ) |  | `[static]`

Creates indexed mesh with sphere (with NormalVertex)

Parameters:

  sph | Will be filled with used sphere (for bounding object)
  center | Center of the sphere
  radius | Radius
  quality | Quality (0 to 1)

Returns:
  New indexed mesh containing the sphere

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateSphere< T > | ( | Vector3 | center,
|  | float | radius,
|  | float | quality = `0.5f`
| ) |  | `[static]`

Creates indexed mesh with sphere (with specified type of vertex)

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  center | Center of the sphere
  radius | Radius
  quality | Quality (0 to 1)

Returns:
  New indexed mesh containing the sphere

Type Constraints

  T | : | IVertex |
  T | : | new() |

static IndexedMesh VisiMath.Geometry.GeoFactory.CreateSphere< T > | ( | Vector3 | center,
|  | float | radius,
|  | out Sphere | sph,
|  | float | quality = `0.5f`
| ) |  | `[static]`

Creates indexed mesh with sphere (with specified type of vertex)

Template Parameters:

  T | Type of vertex (if it has texture coordinates, vertices will be assigned spherical UV texturing coords)

Parameters:

  sph | Will be filled with used sphere (for bounding object)
  center | Center of the sphere
  radius | Radius
  quality | Quality (0 to 1)

Returns:
  New indexed mesh containing the sphere

Type Constraints

  T | : | IVertex |
  T | : | new() |

static Type VisiMath.Geometry.GeoFactory.GetGeoTypeByName | ( | string | name | ) | `[static]`

Returns geotype of specified typename.

Parameters:

  name |

Returns:

static IGeometry VisiMath.Geometry.GeoFactory.ReadXml | ( | XmlReader | reader | ) | `[static]`

Tries to read IGeometry object from XML stream.

Parameters:

  reader | XML reader

Returns:
  IGeometry object or null if type is not recognized

static T VisiMath.Geometry.GeoFactory.ReadXml< T > | ( | XmlReader | reader | ) | `[static]`

Strongly typed reading. Tries to read IGeometry object from XML stream and return it if type is correct. Otherwise throws argument exception (as null cannot be used for generic type)

Parameters:

  reader | XML reader

Returns:
  IGeometry object or null

Type Constraints

  T | : | IGeometry |

static bool VisiMath.Geometry.GeoFactory.ReadXml< T > | ( | XmlReader | reader,
|  | out T | geometry,
|  | out IGeometry | original,
|  | out bool | converted
| ) |  | `[static]`

Strongly typed reading. Tries to read IGeometry object from XML stream and return it if type is correct. If not, tries to convert object.

Parameters:

  reader | XML reader
  original | Will be set to original loaded geometry
  converted | Will be set to true if original had to been converted
  geometry | Geometry to be readen from xml

Returns:
  True if reading sucessful

Type Constraints

  T | : | IGeometry |

static void VisiMath.Geometry.GeoFactory.RegisterGeometryType | ( | Type | geotype | ) | `[static]`

For user loading geometry objects. Every IGeometry type in the assembly of the library is added automatically, but user types from different assemblies must be registered by hand with this function or with RegisterGeometryTypes(Assembly assembly) for assemblies.

Parameters:

  geotype | Geometry type

static void VisiMath.Geometry.GeoFactory.RegisterGeometryTypes | ( | Assembly | assembly | ) | `[static]`

Registers all IGeometry objects in assembly to registered type database.

Parameters:

  assembly | Assembly with IGeometry types

static void VisiMath.Geometry.GeoFactory.SaveOBJ | ( | string | filename,
|  | IndexedMesh | mesh
| ) |  | `[static]`

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

- GeoFactory.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events