//----------------------------------------------------------------------------- public Boolean HasOverlap(Double prmUpperLeftEast, Double prmUpperLeftNorth, Double prmLowerRightEast, Double prmLowerRightNorth) { Int32 upperLeftEast = TileBlocks.Min(iter => iter.East); Int32 upperLeftNorth = TileBlocks.Max(iter => iter.North); Int32 lowerRightEast = TileBlocks.Max(iter => iter.East); Int32 lowerRightNorth = TileBlocks.Min(iter => iter.North); return(TcRectangle.HasOverlap(upperLeftEast, upperLeftNorth, lowerRightEast, lowerRightNorth, prmUpperLeftEast, prmUpperLeftNorth, prmLowerRightEast, prmLowerRightNorth)); }
//----------------------------------------------------------------------------- public List <TcTileBlockInfo> GetTileBlocks(TcRectangle prmRect) { List <TcTileBlockInfo> tileBlocks = new List <TcTileBlockInfo>(); foreach (TcTileBlockInfo info in TileBlocks) { if (prmRect.HasOverlap(info.East, info.North, info.East + TileInfo.TileSize, info.North - TileInfo.TileSize)) { tileBlocks.Add(info); } } return(tileBlocks); }
//----------------------------------------------------------------------------- public List <Int32> GetTileIndices(TcRectangle prmArea) { HashSet <Int32> indices = new HashSet <Int32>(); foreach (TcTileBlockInfo info in TileBlocks) { if (prmArea.HasOverlap(info.East, info.North, info.East + TileInfo.TileSize, info.North - TileInfo.TileSize)) { indices.Add(info.Row * TileInfo.Col + info.Col); } } return(indices.ToList()); }