< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsInInterval(...)100%11100%
GetMaximumFamilyEventCount(...)100%11100%
AccumulateFamilyEvents(...)100%11100%
AccumulateFamilyEvents(...)100%11100%
get_IsSegmentInterior()100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
GetContact()100%1010100%
TryGetNormalDotSign(...)100%11100%

File(s)

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

#LineLine coverage
 1//=======================================================================
 2// SegmentConeSurfaceCandidate.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>One exact chart branch or a retained degenerate family.</summary>
 15internal readonly struct SegmentConeSurfaceCandidate
 16{
 17    /// <summary>Tests a unique retained parameter against the original segment's exact clip.</summary>
 18    /// <remarks>Interval families must instead be clipped before their family events are selected.</remarks>
 19    internal bool IsInInterval(in RationalSegmentInterval clip, bool interiorOnly = false) =>
 21720        SegmentConeSurfaceCandidates.IsInInterval(this, clip, interiorOnly);
 21
 22    internal int GetMaximumFamilyEventCount(int halfspaceCount) =>
 11223        SegmentConeSurfaceCandidates.GetMaximumFamilyEventCount(this, halfspaceCount);
 24
 25    internal bool AccumulateFamilyEvents(scoped ReadOnlySpan<WideAxis3> authoredHalfspaces,
 26        ConeSurfacePointLocation location, scoped ref ConeSurfaceFamilySelection selection) =>
 25727        SegmentConeSurfaceCandidates.AccumulateFamilyEvents(this, authoredHalfspaces, location, ref selection);
 28
 29    internal bool AccumulateFamilyEvents(scoped ReadOnlySpan<WideAxis3> authoredHalfspaces,
 30        ConeSurfacePointLocation location, in RationalSegmentInterval clip, scoped ref ConeSurfaceFamilySelection select
 1531        SegmentConeSurfaceCandidates.AccumulateFamilyEvents(this, authoredHalfspaces, location, ref selection, clip);
 32
 33    internal ConeSurfaceFeature Feature { get; }
 34    internal ConeSurfaceFamily Family { get; }
 35    internal ConeSurfacePointLocation PointLocation { get; }
 36    /// <summary>Whether a unique retained segment point is strictly interior; interval families have no unique point.</
 17237    internal bool IsSegmentInterior => PointLocation == ConeSurfacePointLocation.Interior;
 38    internal readonly SegmentConeSurfaceInput Input;
 39    internal readonly int Chart, RootOrdinal;
 40
 41    internal SegmentConeSurfaceCandidate(in SegmentConeSurfaceInput input, int chart, int rootOrdinal, ConeSurfacePointL
 42    {
 9043        Input = input; Chart = chart; RootOrdinal = rootOrdinal;
 9044        Feature = ConeSurfaceFeature.Rim; Family = ConeSurfaceFamily.None; PointLocation = location;
 3045    }
 46
 47    internal SegmentConeSurfaceCandidate(in SegmentConeSurfaceInput input, ConeSurfaceFeature feature, ConeSurfaceFamily
 48    {
 25249        Input = input; Feature = feature; Family = family;
 16850        PointLocation = ConeSurfacePointLocation.SegmentIntervalUnspecified; Chart = RootOrdinal = 0;
 8451    }
 52
 53    internal SegmentConeSurfaceCandidate(in SegmentConeSurfaceInput input, ConeSurfaceFeature feature,
 54        ConeSurfaceFamily family, int chart, int ordinal, ConeSurfacePointLocation location)
 55    {
 359256        Input = input; Feature = feature; Family = family; Chart = chart;
 179657        RootOrdinal = ordinal; PointLocation = location;
 89858    }
 59
 39560    internal FixedContactAnchors GetContact() => Family == ConeSurfaceFamily.None
 39561        ? Feature == ConeSurfaceFeature.Apex ? SegmentConeSurfaceCandidates.GetApexContact(this)
 39562            : Feature == ConeSurfaceFeature.Base ? SegmentConeSurfaceCandidates.GetBaseContact(this)
 39563            : Feature == ConeSurfaceFeature.Side ? SegmentConeSurfaceCandidates.GetSideContact(this)
 39564            : Chart >= 0 ? SegmentConeSurfaceCandidates.GetRimRootContact(this)
 39565                : SegmentConeSurfaceCandidates.GetRimPointContact(this)
 39566        : throw new InvalidOperationException("A family requires an admitted exact parameter before materialization.");
 67
 68    internal bool TryGetNormalDotSign(WideAxis3 authoredCovector, out int sign) =>
 20569        SegmentConeSurfaceCandidates.TryGetNormalDotSign(this, authoredCovector, out sign);
 70
 71}