/* * @author Valentin Simonov / http://va.lent.in/ */ using TouchScript.InputSources; namespace TouchScript.Pointers { /// /// A pointer of type . /// public class ObjectPointer : Pointer { #region Public consts /// /// Default object id value when device doesn't provide it. /// public const int DEFAULT_OBJECT_ID = 0; /// /// Default width value when device doesn't provide it. /// public const float DEFAULT_WIDTH = 1f; /// /// Default height value when device doesn't provide it. /// public const float DEFAULT_HEIGHT = 1f; /// /// Default angle value when device doesn't provide it. /// public const float DEFAULT_ANGLE = 0f; #endregion #region Public properties /// /// The Id of the physical object this pointer represents. /// public int ObjectId { get; internal set; } /// /// The Width of the physical object this pointer represents. /// public float Width { get; internal set; } /// /// The height of the physical object this pointer represents. /// public float Height { get; internal set; } /// /// The Rotation of the physical object this pointer represents. /// public float Angle { get; internal set; } #endregion #region Constructor /// /// Initializes a new instance of the class. /// public ObjectPointer(IInputSource input) : base(input) { Type = PointerType.Object; } #endregion #region Public methods /// public override void CopyFrom(Pointer target) { base.CopyFrom(target); var obj = target as ObjectPointer; if (obj == null) return; ObjectId = obj.ObjectId; Width = obj.Width; Height = obj.Height; Angle = obj.Angle; } #endregion #region Internal functions /// internal override void INTERNAL_Reset() { base.INTERNAL_Reset(); ObjectId = DEFAULT_OBJECT_ID; Width = DEFAULT_WIDTH; Height = DEFAULT_HEIGHT; Angle = DEFAULT_ANGLE; } #endregion } }