public void Include() { var bound = new BoundingIntegerExtent2D(0, 0, 0, 0); bound.Include(0, 1000); bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 0, 1000)); bound.Include(1000, 0); bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 1000, 1000)); bound.Include(0, -1000); bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, -1000, 1000, 1000)); bound.Include(-1000, 0); bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(-1000, -1000, 1000, 1000)); }
/// <summary> /// Calculates the integer bounding rectangle within the bit mask sub grid that encloses all bits that /// are set to 1 (true) /// </summary> private BoundingIntegerExtent2D ComputeCellsExtents() { var SubGridCellsExtents = new BoundingIntegerExtent2D(); SubGridCellsExtents.SetInverted(); ScanAllSubGrids(x => { SubGridCellsExtents.Include(((SubGridTreeLeafBitmapSubGrid)x).ComputeCellsExtents()); return(true); }); return(SubGridCellsExtents); }