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 | Public Attributes | Properties
VisiMath.Geometry.GeoContainer< T > Class Template Reference

Generic container with several geometry objects of the same type. More...

Inheritance diagram for VisiMath.Geometry.GeoContainer< T >:

List of all members.

## Public Member Functions
| GeoContainer ()
| Default constructor.
| GeoContainer (System.Xml.XmlReader reader)
| XML reader constructor.
virtual void | Add (T geoobject)
| Adds new object to the container.
IEnumerator< IGeometry > | GetEnumerator ()
override float | Distance (ref Vector3 pos)
| Returns closest distance from the specified point to object.
override float | Distance (Ray ray, bool frontOnly=false)
| Returns closest distance to the ray.
override float | Distance (IGeometry obj)
| Returns closest distance from the generic geometric object.
override float | DistanceLineSegment (ref Vector3 pos1, ref Vector3 pos2)
| Returns closest distance to the line segment. Generic, from center, OVERRIDE!
override float | DistanceSphere (ref Vector3 center, float radius)
| Returns closest distance to the sphere.
override float | DistanceTriangle (ref Vector3 pos1, ref Vector3 pos2, ref Vector3 pos3)
| Returns closest distance to the triangle.
override bool | GetIntersectionInfo (Ray obj, ref IIntersectionInfo inters)
| Check for intersection and fills intersection info if intersection is closer to the origin of the ray then value before.
override bool | GetIntersectionInfo (Ray obj, IntersectionList ilist)
| Check for intersection and adds intersection info if there was any intersection.
override bool | Intersects (Ray ray)
| Checks for intersection between object and ray.
override bool | Intersects (IGeometry obj)
| Checks for intersection with generic geo object.
override bool | ContainsPosition (Vector3 pos)
| Checks if specified position is inside the object.
override float | IntersectionDistance (Ray ray)
| Returns distance to the intersection between object and ray.
override Vector3 | IntersectionPoint (Ray ray)
| Returns closest point of the intersection between object and ray.
override float | IntersectsMoving (float radius, Ray ray, float maxdistance)
| Checks for intersection between object and moving sphere.
override Point3DList | ToPoints (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of points.
override LineList | ToLines (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of lines.
override TriangleList | ToTriangles (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of triangles. Valid only for surface based objects, otherwise returns null.
override IndexedMesh | ToIndexedMesh (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to indexed triangle mesh. Valid only for surface based objects, otherwise returns null.
override void | ReadXml (System.Xml.XmlReader reader)
| Reads container from xml.
override void | WriteXml (System.Xml.XmlWriter writer)
| Writes container to xml.
override IGeometry | GetCopy ()
| Returns copy of the geometric data.
## Public Attributes
List< T > | GeoObjects
| List of all geometry objects in container.
## Properties
T | this[int index]`[get, set]`
| Indexing acessors for object.
int | Count`[get]`
| Number of the objects in the container.
override bool | IsPrimitive`[get]`
| Is object geometric renderable primitive from enumaration PrimitiveTypes?
override bool | IsContainer`[get]`
| If geometry object is container, it's made of several joined objects.
override Vector3 | Center`[get]`
| Center of the object.
override PrimitiveTypes | PreferredPrimitive`[get]`
| Preferred primitive type for rendering.
override Type | PreferredVertexType`[get]`
| Preferred type of the vertex.

## Detailed Description

### template<T>
class VisiMath::Geometry::GeoContainer< T >

Generic container with several geometry objects of the same type.

Template Parameters:

  T | Required geometry type

Type Constraints

  T | : | IGeometry |

## Member Function Documentation

template<T >

virtual void VisiMath.Geometry.GeoContainer< T >.Add | ( | T | geoobject | ) | `[virtual]`

Adds new object to the container.

Parameters:

  geoobject | new object to add

Implements VisiMath.Geometry.IGeoContainer< T >.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.ContainsPosition | ( | Vector3 | pos | ) | `[virtual]`

Checks if specified position is inside the object.

Parameters:

  pos | Position to check

Returns:
  True if vector is inside the object

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.Distance | ( | ref Vector3 | pos | ) | `[virtual]`

Returns closest distance from the specified point to object.

Parameters:

  pos | Closest distance to the object

Returns:

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.Distance | ( | Ray | ray,
|  | bool | frontOnly = `false`
| ) |  | `[virtual]`

Returns closest distance to the ray.

Parameters:

  ray | Ray to check distance to
  frontOnly | Check only objects in front of the origin

Returns:
  Closest distance to the ray, if frontOnly and object is behind the ray, returns NaN

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.Distance | ( | IGeometry | obj | ) | `[virtual]`

Returns closest distance from the generic geometric object.

Parameters:

  obj | Object to check distance with

Returns:
  Closest distance to the object

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.DistanceLineSegment | ( | ref Vector3 | pos1,
|  | ref Vector3 | pos2
| ) |  | `[virtual]`

Returns closest distance to the line segment. Generic, from center, OVERRIDE!

param name="pos1">Start of the line

param name="pos2">end of the line

Returns:
  Closest distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.DistanceSphere | ( | ref Vector3 | center,
|  | float | radius
| ) |  | `[virtual]`

Returns closest distance to the sphere.

Parameters:

  center | center of the sphere
  radius | radius of the sphere

Returns:
  Closest distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.DistanceTriangle | ( | ref Vector3 | pos1,
|  | ref Vector3 | pos2,
|  | ref Vector3 | pos3
| ) |  | `[virtual]`

Returns closest distance to the triangle.

Parameters:

  pos1 | First corner
  pos2 | Second corner
  pos3 | Third corner

Returns:
  Distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

VisiMath.Geometry.GeoContainer< T >.GeoContainer | ( | System.Xml.XmlReader | reader | ) |

XML reader constructor.

Parameters:

  reader | XML reader

template<T >

VisiMath.Geometry.GeoContainer< T >.GeoContainer | ( |  | ) |

Default constructor.

template<T >

override IGeometry VisiMath.Geometry.GeoContainer< T >.GetCopy | ( |  | ) | `[virtual]`

Returns copy of the geometric data.

Returns:
  Full copy of the geometry

Implements VisiMath.Geometry.BaseGeometry.

template<T >

IEnumerator<IGeometry> VisiMath.Geometry.GeoContainer< T >.GetEnumerator | ( |  | ) |

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.GetIntersectionInfo | ( | Ray | obj,
|  | ref IIntersectionInfo | inters
| ) |  | `[virtual]`

Check for intersection and fills intersection info if intersection is closer to the origin of the ray then value before.

Parameters:

  inters | Data structure with intersection info
  obj | Ray object

Returns:
  True if there was an intersection and it was closer then previous stored

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.GetIntersectionInfo | ( | Ray | obj,
|  | IntersectionList | ilist
| ) |  | `[virtual]`

Check for intersection and adds intersection info if there was any intersection.

Parameters:

  ilist | List for intersections
  obj | Ray object

Returns:
  True if there was an intersection

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.IntersectionDistance | ( | Ray | ray | ) | `[virtual]`

Returns distance to the intersection between object and ray.

Parameters:

  ray |

Returns:
  Distance from the origin to the point of intersection or double.NaN if no intersection

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override Vector3 VisiMath.Geometry.GeoContainer< T >.IntersectionPoint | ( | Ray | ray | ) | `[virtual]`

Returns closest point of the intersection between object and ray.

Parameters:

  ray |

Returns:
  Point of intersection or invalid Vector3 (with double.NaN as values)

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.Intersects | ( | Ray | ray | ) | `[virtual]`

Checks for intersection between object and ray.

Parameters:

  ray |

Returns:
  True if ray intersects the object

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.Intersects | ( | IGeometry | obj | ) | `[virtual]`

Checks for intersection with generic geo object.

Parameters:

  obj | Object to check with

Returns:
  True if intersection exists

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override float VisiMath.Geometry.GeoContainer< T >.IntersectsMoving | ( | float | radius,
|  | Ray | ray,
|  | float | maxdistance
| ) |  | `[virtual]`

Checks for intersection between object and moving sphere.

param name="radius">Radius of the sphere

Parameters:

  maxdistance | Maximal distance to travel
  ray | Ray describing movement of the sphere

Returns:
  Distance to the intersection or -1 if no intersection exists

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override void VisiMath.Geometry.GeoContainer< T >.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Reads container from xml.

Parameters:

  reader | XML reader

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override IndexedMesh VisiMath.Geometry.GeoContainer< T >.ToIndexedMesh | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to indexed triangle mesh. Valid only for surface based objects, otherwise returns null.

Returns:
  New geometry object containing triangle faces of the object surface

Parameters:

  quality | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  vertextype | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override LineList VisiMath.Geometry.GeoContainer< T >.ToLines | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of lines.

Returns:
  New geometry object containing edges of the object

Parameters:

  quality | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  vertextype | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override Point3DList VisiMath.Geometry.GeoContainer< T >.ToPoints | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of points.

Returns:
  New geometry object containing point based definition of the object

Parameters:

  quality | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  vertextype | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override TriangleList VisiMath.Geometry.GeoContainer< T >.ToTriangles | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of triangles. Valid only for surface based objects, otherwise returns null.

Returns:
  New geometry object containing triangle faces of the object surface.

Parameters:

  quality | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  vertextype | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

template<T >

override void VisiMath.Geometry.GeoContainer< T >.WriteXml | ( | System.Xml.XmlWriter | writer | ) | `[virtual]`

Writes container to xml.

Parameters:

  writer | XML writer

Implements VisiMath.Geometry.BaseGeometry.

## Member Data Documentation

template<T >

List<T> VisiMath.Geometry.GeoContainer< T >.GeoObjects

List of all geometry objects in container.

## Property Documentation

template<T >

override Vector3 VisiMath.Geometry.GeoContainer< T >.Center`[get]`

Center of the object.

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

int VisiMath.Geometry.GeoContainer< T >.Count`[get]`

Number of the objects in the container.

Implements VisiMath.Geometry.IGeoContainer< T >.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.IsContainer`[get]`

If geometry object is container, it's made of several joined objects.

Returns:
  True if container

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override bool VisiMath.Geometry.GeoContainer< T >.IsPrimitive`[get]`

Is object geometric renderable primitive from enumaration PrimitiveTypes?

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override PrimitiveTypes VisiMath.Geometry.GeoContainer< T >.PreferredPrimitive`[get]`

Preferred primitive type for rendering.

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

override Type VisiMath.Geometry.GeoContainer< T >.PreferredVertexType`[get]`

Preferred type of the vertex.

Reimplemented from VisiMath.Geometry.BaseGeometry.

template<T >

T VisiMath.Geometry.GeoContainer< T >.this[int index]`[get, set]`

Indexing acessors for object.

Parameters:

  index | index of object

Returns:
  Geoobject

Implements VisiMath.Geometry.IGeoContainer< T >.

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

- GeoContainer.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events