Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private static IBox GetSearchBox([NotNull] IBox currentTileBox,
                                         double searchTolerance)
        {
            IBox searchBox = currentTileBox.Clone();

            searchBox.Min.X -= searchTolerance;
            searchBox.Min.Y -= searchTolerance;

            return(searchBox);
        }
Ejemplo n.º 3
0
        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);
        }