Beispiel #1
0
 public static void TryGetValue <TIndex, TValue>(IReadOnlyIndexable <TIndex, TValue> instance, TIndex index)
     where TIndex : IIndex
 {
     Contracts.Requires.That(instance != null);
     Contracts.Requires.That(index != null);
     Contracts.Requires.That(instance.Rank == index.Rank);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReusableVoxelProjection{TVoxel, TSurfaceData}" /> class.
        /// </summary>
        /// <param name="data">The container used to hold the temporary data that is generated while creating each surface.</param>
        /// <param name="voxels">The voxels to provide projections of.</param>
        /// <param name="stageIndexOrigin">The stage index of the zero index origin of the indexable voxels.</param>
        public ReusableVoxelProjection(TSurfaceData data, IReadOnlyIndexable <Index3D, TVoxel> voxels, Index3D stageIndexOrigin)
        {
            Contracts.Requires.That(data != null);
            Contracts.Requires.That(voxels != null);

            this.data             = data;
            this.voxels           = voxels;
            this.stageIndexOrigin = stageIndexOrigin;

            this.SetupProjectionTowardsNegativeZAxis(Index3D.Zero);
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EnumerableProjectionsIndexable{TVoxel, TSurfaceData}" /> class.
        /// </summary>
        /// <param name="contourDeterminer">The delegate used to determine the contour.</param>
        /// <param name="voxels">The voxels to contour.</param>
        /// <param name="startContourAtIndex">The index to start the contour at.</param>
        /// <param name="dimensionsToContour">The dimensions of the bounds to contour.</param>
        /// <param name="stageIndexOrigin">The stage index of the zero index origin of the indexable voxels.</param>
        public EnumerableProjectionsIndexable(
            IContourDeterminer <TVoxel> contourDeterminer,
            IReadOnlyIndexable <Index3D, TVoxel> voxels,
            Index3D startContourAtIndex,
            Index3D dimensionsToContour,
            Index3D stageIndexOrigin)
        {
            Contracts.Requires.That(contourDeterminer != null);
            Contracts.Requires.That(voxels != null);
            Contracts.Requires.That(voxels.IsIndexValid(startContourAtIndex));
            Contracts.Requires.That(dimensionsToContour.IsAllPositiveOrZero());

            this.determiner       = contourDeterminer;
            this.voxels           = voxels;
            this.start            = startContourAtIndex;
            this.end              = startContourAtIndex + dimensionsToContour;
            this.stageIndexOrigin = stageIndexOrigin;
        }
Beispiel #4
0
 public static void IndexerGet <TIndex, TValue>(IReadOnlyIndexable <TIndex, TValue> instance, TIndex index)
     where TIndex : IIndex
 {
     Contracts.Requires.That(instance != null);
     Contracts.Requires.That(instance.IsIndexValid(index));
 }