Vicon Subject Library

<< Back to the Vicon Toolkit page

The ILAB Vicon Subject Library is the upper level of the ILAB Vicon Toolkit, providing higher level object tracking functionality.

SubjectManager Component

Description

This is an abstract class that is used as a base class for subjects. Note that a new class has to be programmed for each subject with a different marker configuration. The SubjectManager Component provides stubs for common properties of a subject, including location, orientation, and pointing. This class inherits from Component so that it can be easily dropped onto a Form and configured in Form Designer mode.

Properties

  • ViconManager ViconManager - Gets the ViconManager object to which this subject belongs.
  • string SubjectName - Gets the unique identifier for this subject.
  • bool IsPresent - Indicates whether the subject has been seen by the Vicon yet. Returns false if not.
  • bool IsVisible - Indicates whether the subject is currently seen by the Vicon. Returns false if not.
  • int MarkerCount - Returns the number of markers that constitute this subject.
  • int ActiveMarkerCount - Returns the number of markers currently seen by the Vicon.
  • double Integrity - Returns the ratio of visible markers to total markers. Can be used to assess whether the object data is accurate enough to be useful.
  • int MinimumUpdateIntegrity - Gets or sets the minimum number of active markers for the subject data to updated.
  • Vector3 Location - Gets the current point location of the subject in world space. This may correspond to a marker location, or a centroid, or any other trivial subject-relative anchor point that the programmer decides to use.
  • Vector3 DirectionOrigin - Gets the current point location of the front or pointing end of an object in world space.
  • bool CanPoint - Returns true if the object can be used to point, otherwise it returns false.
  • Vector3 Direction - Gets the current direction that the object is pointing. If the object cannot point, a 0-vector is returned.
  • double Pitch - Gets the current pitch rotation of the object (in degrees).
  • double Yaw - Gets the current yaw rotation of the object (in degrees).
  • double Roll - Gets the current roll rotation of the object (in degrees).

Methods

  • ViconMarkerGetAvailableMarker(string name) - Returns a marker if it is active. If it is not active, this method returns the last known active location of the marker.
  • bool InFrontOf(DisplayPlane display) - Returns true if the subject is in front of the display plane. Otherwise if it is behind or parallel to the plane, it returns false.
  • bool PointsToward(DisplayPlane display) - Returns true if the subject is pointing toward the display plane (from the front side). Otherwise returns false. Note that pointing toward the screen does not imply that it is pointing within the bounds of the display, only in the general direction of the display.
  • bool PointsInto(DisplayPlane display) - Returns true if the subject is pointing within the bounds of the display plane (front the front side). Otherwise returns false.
  • Vector3 GetPointedDisplayLocation(DisplayPlane display) - Returns a vector that indicates where on the display plane the subject is pointing (even if outside the bounds of the display). Returns a 0 vector if the object is behind or parallel to the display, or if it is not pointing toward the display. The vector returned is in plane coordinates, so X and Y components are double values between 0 to 1. Simply multiply these by the pixel width and height of the display to find the exact pixel location.
  • void RenderToDisplay(DisplayPlane display, Graphics g) - A method used to render a representation of the subject as a projection onto the display plane.

Events

  • ViconSubjectEventHandler SubjectLost(ISubjectEventHandler subject) - Triggered when the subject is no longer seen by the Vicon, or has lost enough marker integrity to not be trackable.
  • ViconSubjectEventHandler SubjectFound(ISubjectEventHandler subject) - Triggered when the subject is recaptured after a period in a lost state.
  • EventHandler SubjectUpdated - Triggered when the subject data has been refreshed.

SubjectDisplay Control

Description

A control that displays specified subject as a projection view onto a specified display plane. Note that when this control renders itself, it calls the RenderToDisplay method of any subject that is added.

Properties

  • ViconManager ViconManager - Gets or sets the active ViconManager object.
  • DisplayPlane DisplayPlane - Gets or sets the desired DisplayPlane object.

Methods

  • void AddSubject(SubjectBase newsubject) - Adds a subject to the list of subjects to be displayed in this visualization.
  • void RemoveSubject(SubjectBase oldsubject) - Removes a subject from the list of subjects to be display in this visualization.
  • void ClearSubjects() - Clears all subjects from the list of subjects to be display in this visualization.

Miscellaneous

ViconSubjectEventHandler

Return type: void. Parameters: ISubjectEventHandler subject - the pertinent subject to which the event applies.

ISubjectEventHandler

An interface used by the ViconSubjectEventHandler to pass the relevant subject to the event handler. This interface requires the following properties: ViconManager, SubjectName, IsPresent, MarkerCount, ActiveMarkerCount, Integrity. See SubjectBase for more information about these properties.