예제 #1
0
 public override IEnumerable <Pnt> GetPoints(IBox box)
 {
     if (box.Contains((IPnt)_point))
     {
         yield return(_point);
     }
 }
 public override IEnumerable <Proximity> GetProximities(Pnt point,
                                                        bool as3D,
                                                        IBox box)
 {
     if (box.Contains((IPnt)_point))
     {
         yield return(new PointProximity(point, as3D, _point));
     }
 }
예제 #3
0
 public override IEnumerable <Pnt> GetPoints(IBox searchBox)
 {
     foreach (WKSPointZ wksPoint in _wksPoints)
     {
         Pnt point = QaGeometryUtils.CreatePoint3D(wksPoint);
         if (searchBox.Contains((IPnt)point))
         {
             yield return(point);
         }
     }
 }
            public override IEnumerable <Proximity> GetProximities(Pnt point,
                                                                   bool as3D,
                                                                   IBox box)
            {
                foreach (WKSPointZ wksPoint in _wksPoints)
                {
                    Pnt part = QaGeometryUtils.CreatePoint3D(wksPoint);

                    if (box.Contains((IPnt)part))
                    {
                        yield return(new PointProximity(point, as3D, part));
                    }
                }
            }
예제 #5
0
            internal bool VerifyPointTile(BoxTree tree)
            {
                IBox extent = tree.TileExtent(this);

                foreach (TileEntry entry in EnumElems())
                {
                    if (extent.Contains(entry.Box) == false)
                    {
                        return(false);
                    }
                }

                return(true);
            }
예제 #6
0
 public bool Intersects([NotNull] IBox box, [NotNull] int[] dimensionList)
 {
     return(box.Contains((IPnt)this, dimensionList));
 }
예제 #7
0
 public bool Intersects(IBox box)
 {
     return(box.Contains((IPnt)this));
 }
예제 #8
0
        private List <BoxTree <CachedRow> .TileEntry> SearchList(
            [NotNull] IGeometry searchGeometry, int tableIndex)
        {
            Assert.ArgumentNotNull(searchGeometry, nameof(searchGeometry));

            IBox searchGeometryBox = QaGeometryUtils.CreateBox(searchGeometry,
                                                               GetXYTolerance(tableIndex));

            BoxTree <CachedRow> boxTree = _rowBoxTrees[tableIndex];

            if (_currentRowNeighbors == null)
            {
                _currentRowNeighbors = new BoxSelection[_cachedTableCount];
            }

            BoxSelection currentRowBoxSelection = _currentRowNeighbors[tableIndex];

            if (currentRowBoxSelection == null)
            {
                currentRowBoxSelection = CreateCurrentRowToleranceSelection(tableIndex);

                _currentRowNeighbors[tableIndex] = currentRowBoxSelection;
            }

            IBox searchBox = null;
            var  isWithin  = false;

            if (currentRowBoxSelection != null)
            {
                isWithin = currentRowBoxSelection.Box.Contains(searchGeometryBox);
            }

            if (!isWithin)
            {
                searchBox = searchGeometryBox;
            }
            else if (currentRowBoxSelection.Selection == null)
            {
                searchBox = currentRowBoxSelection.Box;
            }

            List <BoxTree <CachedRow> .TileEntry> tileEntries;

            if (searchBox != null)
            {
                tileEntries = new List <BoxTree <CachedRow> .TileEntry>();

                foreach (
                    BoxTree <CachedRow> .TileEntry tileEntry in boxTree.Search(searchBox))
                {
                    tileEntries.Add(tileEntry);
                }

                if (isWithin)
                {
                    currentRowBoxSelection.Selection = tileEntries;
                }
            }
            else
            {
                tileEntries = currentRowBoxSelection.Selection;
            }

            if (!isWithin || searchGeometryBox.Contains(currentRowBoxSelection.Box))
            {
                return(tileEntries);
            }

            // drop non intersection lines
            Assert.NotNull(tileEntries, "tileEntries");

            var reducedList
                = new List <BoxTree <CachedRow> .TileEntry>(tileEntries.Count);

            foreach (BoxTree <CachedRow> .TileEntry tileEntry in tileEntries)
            {
                if (tileEntry.Box.Intersects(searchGeometryBox))
                {
                    reducedList.Add(tileEntry);
                }
            }

            return(reducedList);
        }