< Summary

Information
Class: FixedMathSharp.Geometry.ConeSurfaceSelection
Assembly: FixedMathSharp
File(s): /home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Wide/FiniteAxis/ConeSurfaceSelection.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 32
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Item(...)100%11100%
.ctor(...)100%11100%
Add(...)100%22100%

File(s)

/home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp/Geometry/Wide/FiniteAxis/ConeSurfaceSelection.cs

#LineLine coverage
 1//=======================================================================
 2// ConeSurfaceSelection.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using System;
 9using static FixedMathSharp.Geometry.CylinderContactAlgebra;
 10using static FixedMathSharp.Geometry.ContactQuadratic;
 11
 12namespace FixedMathSharp.Geometry;
 13
 14/// <summary>Caller-owned retained finite-support branches and degenerate families.</summary>
 15internal ref struct ConeSurfaceSelection
 16{
 17    private readonly Span<SegmentConeSurfaceCandidate> candidates;
 18    internal int Count { get; private set; }
 161519    internal SegmentConeSurfaceCandidate this[int index] => candidates[..Count][index];
 20
 21    internal ConeSurfaceSelection(Span<SegmentConeSurfaceCandidate> candidates)
 22    {
 36023        this.candidates = candidates; Count = 0;
 18024    }
 25
 26    internal void Add(in SegmentConeSurfaceCandidate candidate)
 27    {
 101228        if (Count == candidates.Length)
 129            throw new InvalidOperationException("The caller-owned surface candidate storage is full.");
 101130        candidates[Count++] = candidate;
 101131    }
 32}