< 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>
 3366715        public int TouchId { get; set; } = -1;
 16
 17        /// <summary>
 18        /// Gets the position.
 19        /// </summary>
 20        /// <value>
 21        /// The position.
 22        /// </value>
 3017323        public Point3 Position { get; set; } = new Point3();
 24
 25        /// <summary>
 26        /// Gets the type.
 27        /// </summary>
 28        /// <value>
 29        /// The type.
 30        /// </value>
 1216431        public InteractionType Type { get; set; }
 32
 33        /// <summary>
 34        /// description of extremum to distinguish interactions from extremums between two interactions.
 35        /// </summary>
 1093436        public ExtremumDescription ExtremumDescription { get; set; } = new ExtremumDescription
 369537        {
 369538            Type = ExtremumType.Undefined,
 369539            NumFittingPoints = 0,
 369540            PercentageFittingPoints = 0
 369541        };
 42
 43        /// <summary>
 44        /// Gets or sets the confidence.
 45        /// </summary>
 46        /// <value>
 47        /// The confidence.
 48        /// </value>
 1146049        public float Confidence { get; set; }
 50
 51        /// <summary>
 52        /// Gets the time.
 53        /// </summary>
 54        /// <value>
 55        /// The time.
 56        /// </value>
 766457        public long Time { get; set; }
 58
 59        /// <summary>
 60        /// Just for json serialization !
 61        /// </summary>
 2362        public Interaction()
 2363        {
 2364            Time = DateTime.Now.Ticks;
 2365        }
 66
 67        /// <summary>
 68        /// Initializes a new instance of the <see cref="Interaction"/> class.
 69        /// </summary>
 170        public Interaction(Point3 position, Interaction source)
 171        {
 172            Position = position;
 173            Type = source.Type;
 174            Confidence = source.Confidence;
 175            ExtremumDescription = source.ExtremumDescription;
 176            Time = source.Time;
 177            TouchId = source.TouchId;
 178        }
 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>
 6586        public Interaction(Point3 position, InteractionType type, float confidence)
 6587        {
 6588            Position = position;
 6589            Type = type;
 6590            Confidence = confidence;
 6591            Time = DateTime.Now.Ticks;
 6592        }
 93
 94        /// <summary>
 95        /// Initializes a new instance of the <see cref="Interaction"/> class.
 96        /// </summary>
 97        /// <param name="source">The source.</param>
 360698        public Interaction(Interaction source)
 360699        {
 3606100            TouchId = source.TouchId;
 3606101            Position = source.Position;
 3606102            Type = source.Type;
 3606103            ExtremumDescription = source.ExtremumDescription;
 3606104            Confidence = source.Confidence;
 3606105            Time = source.Time;
 3606106        }
 107
 108        /// <summary>
 109        /// Returns [this] as a list.
 110        /// </summary>
 111        /// <returns></returns>
 1112        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>
 1120        public override string ToString() => $"TouchId: {TouchId}, Position: " + Position + ", Type: " + Type + " ,Confi
 121    }
 122}