private IBox GetCurrentRowToleranceBox(int tableIndex) { if (CurrentTestRow == null) { return(null); } if (_cachedRow == null) { return(QaGeometryUtils.CreateBox(CurrentTestRow.DataReference.Extent)); } IBox currentBox = _cachedRow.Extent; double searchTolerance = GetSearchTolerance(_cachedTableIndex, tableIndex); IBox toleranceBox = currentBox.Clone(); toleranceBox.Min.X -= searchTolerance; toleranceBox.Min.Y -= searchTolerance; toleranceBox.Max.X += searchTolerance; toleranceBox.Max.Y += searchTolerance; return(toleranceBox); }
private static IBox GetSearchBox([NotNull] IBox currentTileBox, double searchTolerance) { IBox searchBox = currentTileBox.Clone(); searchBox.Min.X -= searchTolerance; searchBox.Min.Y -= searchTolerance; return(searchBox); }
public static IBox CreateBox([NotNull] IBox box, double expansionDistance = 0) { Assert.ArgumentNotNull(box, nameof(box)); IBox clone = box.Clone(); for (var dim = 0; dim < clone.Dimension; dim++) { clone.Min[dim] = box.Min[dim] - expansionDistance; clone.Max[dim] = box.Max[dim] + expansionDistance; } return(clone); }