< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Common.Components.Interaction
Assembly: ReFlex.Core.Common
File(s): D:\a\reflex\reflex\library\src\Core\Common\Components\Interaction.cs
Line coverage
100%
Covered lines: 42
Uncovered lines: 0
Coverable lines: 42
Total lines: 122
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_TouchId()100%11100%
get_Position()100%11100%
get_Type()100%11100%
get_ExtremumDescription()100%11100%
.ctor()100%11100%
get_Confidence()100%11100%
get_Time()100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
AsList()100%11100%
ToString()50%22100%

File(s)

D:\a\reflex\reflex\library\src\Core\Common\Components\Interaction.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using ReFlex.Core.Common.Util;
 4
 5namespace ReFlex.Core.Common.Components
 6{
 7    /// <summary>
 8    /// An interaction on an elastic display.
 9    /// </summary>
 10    public class Interaction
 11    {
 12        /// <summary>
 13        /// Id for tracking a touch point over time
 14        /// </summary>
 6773415        public int TouchId { get; set; } = -1;
 16
 17        /// <summary>
 18        /// Gets the position.
 19        /// </summary>
 20        /// <value>
 21        /// The position.
 22        /// </value>
 6125623        public Point3 Position { get; set; } = new Point3();
 24
 25        /// <summary>
 26        /// Gets the type.
 27        /// </summary>
 28        /// <value>
 29        /// The type.
 30        /// </value>
 2455431        public InteractionType Type { get; set; }
 32
 33        /// <summary>
 34        /// description of extremum to distinguish interactions from extremums between two interactions.
 35        /// </summary>
 2230636        public ExtremumDescription ExtremumDescription { get; set; } = new ExtremumDescription
 751437        {
 751438            Type = ExtremumType.Undefined,
 751439            NumFittingPoints = 0,
 751440            PercentageFittingPoints = 0
 751441        };
 42
 43        /// <summary>
 44        /// Gets or sets the confidence.
 45        /// </summary>
 46        /// <value>
 47        /// The confidence.
 48        /// </value>
 2313449        public float Confidence { get; set; }
 50
 51        /// <summary>
 52        /// Gets the time.
 53        /// </summary>
 54        /// <value>
 55        /// The time.
 56        /// </value>
 1551257        public long Time { get; set; }
 58
 59        /// <summary>
 60        /// Just for json serialization !
 61        /// </summary>
 12062        public Interaction()
 12063        {
 12064            Time = DateTime.Now.Ticks;
 12065        }
 66
 67        /// <summary>
 68        /// Initializes a new instance of the <see cref="Interaction"/> class.
 69        /// </summary>
 270        public Interaction(Point3 position, Interaction source)
 271        {
 272            Position = position;
 273            Type = source.Type;
 274            Confidence = source.Confidence;
 275            ExtremumDescription = source.ExtremumDescription;
 276            Time = source.Time;
 277            TouchId = source.TouchId;
 278        }
 79
 80        /// <summary>
 81        /// Initializes a new instance of the <see cref="Interaction"/> struct.
 82        /// </summary>
 83        /// <param name="position">The position.</param>
 84        /// <param name="type">The type.</param>
 85        /// <param name="confidence">The confidence.</param>
 12086        public Interaction(Point3 position, InteractionType type, float confidence)
 12087        {
 12088            Position = position;
 12089            Type = type;
 12090            Confidence = confidence;
 12091            Time = DateTime.Now.Ticks;
 12092        }
 93
 94        /// <summary>
 95        /// Initializes a new instance of the <see cref="Interaction"/> class.
 96        /// </summary>
 97        /// <param name="source">The source.</param>
 727298        public Interaction(Interaction source)
 727299        {
 7272100            TouchId = source.TouchId;
 7272101            Position = source.Position;
 7272102            Type = source.Type;
 7272103            ExtremumDescription = source.ExtremumDescription;
 7272104            Confidence = source.Confidence;
 7272105            Time = source.Time;
 7272106        }
 107
 108        /// <summary>
 109        /// Returns [this] as a list.
 110        /// </summary>
 111        /// <returns></returns>
 2112        public IList<Interaction> AsList() => new List<Interaction> { this };
 113
 114        /// <summary>
 115        /// Returns a <see cref="System.String" /> that represents this instance.
 116        /// </summary>
 117        /// <returns>
 118        /// A <see cref="System.String" /> that represents this instance.
 119        /// </returns>
 2120        public override string ToString() => $"TouchId: {TouchId}, Position: " + Position + ", Type: " + Type + " ,Confi
 121    }
 122}