Beispiel #1
0
        public override bool UpdateProcessingMapForSurveyedSurfaces(SubGridTreeBitmapSubGridBits processingMap, IList filteredSurveyedSurfaces, bool returnEarliestFilteredCellPass)
        {
            if (!(filteredSurveyedSurfaces is ISurveyedSurfaces surveyedSurfaces))
            {
                return(false);
            }

            processingMap.Assign(FilterMap);

            // If we're interested in a particular cell, but we don't have any surveyed surfaces later (or earlier)
            // than the cell production data pass time (depending on PassFilter.ReturnEarliestFilteredCellPass)
            // then there's no point in asking the Design Profiler service for an elevation

            processingMap.ForEachSetBit((x, y) =>
            {
                // ReSharper disable once CompareOfFloatsByEqualityOperator
                if (Cells[x, y] != Consts.NullHeight &&
                    !(returnEarliestFilteredCellPass ? surveyedSurfaces.HasSurfaceEarlierThan(Times[x, y]) : surveyedSurfaces.HasSurfaceLaterThan(Times[x, y])))
                {
                    processingMap.ClearBit(x, y);
                }
            });

            return(true);
        }
Beispiel #2
0
        public override bool ComputeFilterPatch(double startStn, double endStn, double leftOffset, double rightOffset,
                                                SubGridTreeBitmapSubGridBits mask,
                                                SubGridTreeBitmapSubGridBits patch,
                                                double originX, double originY,
                                                double cellSize,
                                                double offset)
        {
            var Heights = new float[SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension];

            if (InterpolateHeights(Heights, originX, originY, cellSize, offset))
            {
                mask.ForEachSetBit((x, y) =>
                {
                    if (Heights[x, y] == Common.Consts.NullHeight)
                    {
                        mask.ClearBit(x, y);
                    }
                });
                patch.Assign(mask);

                //SIGLogMessage.PublishNoODS(Self, Format('Filter patch construction successful with %d bits', [patch.CountBits]), ...);

                return(true);
            }

            //SIGLogMessage.PublishNoODS(Self, Format('Filter patch construction failed...', []), ...);
            return(false);
        }
Beispiel #3
0
        public void Test_SubGridTreeBitmapSubGridBitsTests_Assignment()
        {
            SubGridTreeBitmapSubGridBits bits  = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Unfilled);
            SubGridTreeBitmapSubGridBits bits2 = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Unfilled);
            SubGridTreeBitmapSubGridBits bits3 = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Filled);

            Assert.True(bits.Equals(bits2), "Bits does not equal bits2, which it should");
            Assert.False(bits.Equals(bits3), "Bits equals bits3, which it should not");

            bits2.Assign(bits3);
            Assert.True(bits2.Equals(bits3), "Bits2 does not equal bits3 after assignment of bits3 to bits2, which it should");
        }