< Summary - ReFlex - Library

Information
Class: PointCloud.Benchmark.Benchmarks.Interactivity.ConfidenceFilterBenchmark
Assembly: ReFlex.PointCloud.Benchmark
File(s): D:\a\reflex\reflex\test\Library\Performance\PointCloud.Benchmark\Benchmarks\Interactivity\ConfidenceFilterBenchmark.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 44
Coverable lines: 44
Total lines: 88
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
FilterInteractions1()100%210%
FilterInteractions2()100%210%
FilterInteractions3()100%210%
FilterInteractions4()100%210%

File(s)

D:\a\reflex\reflex\test\Library\Performance\PointCloud.Benchmark\Benchmarks\Interactivity\ConfidenceFilterBenchmark.cs

#LineLine coverage
 1using BenchmarkDotNet.Attributes;
 2using Implementation.Components;
 3using PointCloud.Benchmark.Interactivity;
 4using PointCloud.Benchmark.Util;
 5using ReFlex.Core.Common.Components;
 6using ReFlex.Core.Common.Util;
 7
 8namespace PointCloud.Benchmark.Benchmarks.Interactivity;
 9
 10[MemoryDiagnoser]
 11public class ConfidenceFilterBenchmark
 12{
 13    private int _width;
 14    private int _height;
 15
 16    private readonly ReFlex.Core.Common.Components.PointCloud3 _pCloud3;
 17    private readonly VectorField2 _vectorfield;
 18
 19    private readonly MultiInteractionObserver _observer;
 20
 21    private Point3[] _data;
 22
 023    public ConfidenceFilterBenchmark()
 024    {
 025        var data = DataLoader.Load(0);
 026        _width = data.Item1;
 027        _height = data.Item2;
 028        _data = data.Item3;
 29
 030        _pCloud3 = new PointCloud3(_width, _height);
 031        _pCloud3.Update(data.Item3, 0f);
 32
 033        var filterMgr = new FilterManager();
 034        filterMgr.LimitationFilter.LeftBound = 42;
 035        filterMgr.LimitationFilter.RightBound = 613;
 036        filterMgr.LimitationFilter.LeftBound = 136;
 037        filterMgr.LimitationFilter.LeftBound = 413;
 38
 039        filterMgr.IsLimitationFilterEnabled = true;
 040        filterMgr.IsBoxFilterEnabled = true;
 041        filterMgr.IsValueFilterEnabled = true;
 042        filterMgr.MeasurePerformance = false;
 043        filterMgr.IsThresholdFilterEnabled = true;
 44
 045        filterMgr.LimitationFilterType = LimitationFilterType.LimitationFilter;
 46
 047        filterMgr.FilterAndUpdate(_data, _pCloud3);
 48
 049        _vectorfield = new VectorField2(_width, _height, 1);
 050        _vectorfield.Populate(_pCloud3);
 51
 052        _observer = new MultiInteractionObserver();
 053        _observer.PointCloud = _pCloud3;
 054        _observer.VectorField = _vectorfield;
 55
 056        _observer.MinDistance = 0.04f;
 057        _observer.MaxDistance = 0.3f;
 058        _observer.Distance = 1.45f;
 059        _observer.MinAngle = 0.5f;
 060        _observer.TouchMergeDistance2D = 19;
 61
 062        Task.WaitAny(_observer.Update());
 063    }
 64
 65    [Benchmark]
 66    public Interaction[] FilterInteractions1()
 067    {
 068        return _observer.ApplyConfidenceFilter1().ToArray();
 069    }
 70
 71    [Benchmark]
 72    public Interaction[] FilterInteractions2()
 073    {
 074        return _observer.ApplyConfidenceFilter2().ToArray();
 075    }
 76
 77    [Benchmark]
 78    public Interaction[] FilterInteractions3()
 079    {
 080        return _observer.ApplyConfidenceFilter3().ToArray();
 081    }
 82
 83    [Benchmark]
 84    public Interaction[] FilterInteractions4()
 085    {
 086        return _observer.ApplyConfidenceFilter4().ToArray();
 087    }
 88}