private GeoPolygonRegion GenerateFullMapPolygon() { double maxValue = double.MaxValue; double minValue = double.MinValue; double num3 = double.MaxValue; double num4 = double.MinValue; double num5 = 0.0; foreach (Transceiver transceiver in this.m_otherSubSysInterface.INet.TranceiverList) { num5 = 0.0; foreach (PropModelConfig config in transceiver.Cells[0].PropModels) { num5 = Math.Max(num5, (double) config.CalcRadius); } maxValue = Math.Min(maxValue, (transceiver.AntConfiguration[0].DX + transceiver.Parent.X) - num5); minValue = Math.Max(minValue, (transceiver.AntConfiguration[0].DX + transceiver.Parent.X) + num5); num4 = Math.Max(num4, (transceiver.AntConfiguration[0].DY + transceiver.Parent.Y) + num5); num3 = Math.Min(num3, (transceiver.AntConfiguration[0].DY + transceiver.Parent.Y) - num5); } GeoXYRect geoXYRect = new GeoXYRect(maxValue, minValue, num3, num4); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); region.Name = GeneralResource.GENERAL_FULL_MAP; return region; }
private GeoPolygonRegion CreatRegion() { GeoPolygonRegion region=new GeoPolygonRegion(); GeoPolygon polygon=new GeoPolygon(); List<GeoXYPoint> point_list=new List<GeoXYPoint>(); GeoXYPoint fpoint=new GeoXYPoint(1000,2500); point_list.Add(fpoint); GeoXYPoint spoint=new GeoXYPoint(3000,1000); point_list.Add(spoint); GeoXYPoint tpoint=new GeoXYPoint(3800,4000); point_list.Add(tpoint); GeoXYPoint lpoint=new GeoXYPoint(2200,4500); point_list.Add(lpoint); polygon.Points=point_list; region.AddGeoPolygon(polygon); return region; }
private GeoPolygonRegion CreatRegion() { GeoPolygonRegion region = new GeoPolygonRegion(); GeoPolygon polygon = new GeoPolygon(); List<GeoXYPoint> point_list = new List<GeoXYPoint>(); GeoXYPoint fpoint = new GeoXYPoint(0, 0); point_list.Add(fpoint); GeoXYPoint spoint = new GeoXYPoint(0, 50); point_list.Add(spoint); GeoXYPoint tpoint = new GeoXYPoint(50, 0); point_list.Add(tpoint); GeoXYPoint lpoint = new GeoXYPoint(50, 50); point_list.Add(lpoint); polygon.Points = point_list; region.AddGeoPolygon(polygon); return region; }
public GeoPolygonRegion GetRegionRectangle(GeoPolygonRegion polygon, float resolution) { this.GetPolygonRectangle(polygon, resolution); GeoXYRect geoXYRect = new GeoXYRect(this.m_polygonLeftTop.X, this.m_polygonRightBottom.X, this.m_polygonRightBottom.Y, this.m_polygonLeftTop.Y); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); return region; }
public bool GetCellCollection() { List<Transceiver> tranceiverList = this.m_otherSubSysInterface.INet.TranceiverList; try { foreach (GeoPolygonRegion region in this.m_param.PolygonList) { foreach (GeoPolygon polygon in region.GetAllPolygon()) { List<Transceiver> list2 = new List<Transceiver>(); GeoPolygonRegion region2 = new GeoPolygonRegion(); region2.AddGeoPolygon(polygon); list2 = this.m_otherSubSysInterface.CellFilterBuilder.GetCellFilter().GetCalculateCells(tranceiverList, region2, 10f); foreach (Transceiver transceiver in list2) { if (!this.m_calcCells.Contains(transceiver)) { this.m_calcCells.Add(transceiver); } } } } } catch (Exception exception) { this.m_otherSubSysInterface.EventViewService.WriteLog(SimulationResource.SIMULATION_THE_WRONG_IS + exception.Message.ToString(), Huawei.UNet.Frame.Interface.LogLevel.Error); return false; } return true; }
private void ReadPolygon(int numParts, int numPoints) { int[] numArray = new int[numParts]; for (int i = 0; i < numParts; i++) { numArray[i] = this.ReadInteger(ByteOrder.LittleEndian); } int index = 1; GeoPolygon geoPolygon = new GeoPolygon(); for (int j = 0; j < numPoints; j++) { double x = this.ReadDouble(ByteOrder.LittleEndian); double y = this.ReadDouble(ByteOrder.LittleEndian); GeoXYPoint point = new GeoXYPoint(x, y); if (index < numParts) { if (j < numArray[index]) { geoPolygon.Points.Add(point); } else { GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion region2 = new GeoDisplayPolygonRegion(region, this.m_DefaultPolygonStyle); index++; } } else { geoPolygon.Points.Add(point); } } GeoPolygonRegion region3 = new GeoPolygonRegion(); region3.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region3, this.m_DefaultPolygonStyle); item.AddFeature("ID", this.CreateMapUnitId()); this.m_RegionList.Add(item); }
private void GetBlockCellInfoColl(int blockCount, GeoPolygonRegion region) { BlockLTETransceiverColl coll; this.m_BlockTransceiverExCollArr = new List<BlockLTETransceiverColl>(); if (blockCount > 1) { double maxValue = double.MaxValue; double minValue = double.MinValue; double bottom = double.MaxValue; double top = double.MinValue; GeoPolygonRegion regionRectangle = this.m_ICellFilterBuilder.GetCellFilter().GetRegionRectangle(region, this.m_Group.Resolution); List<Transceiver> allTran = new List<Transceiver>(); foreach (LTETransceiverEX rex in this.m_CalTansceiverExColl.LTETransceiverEXList) { //modify 20110228 if (rex.LteCellExList.Count > 0) { allTran.Add(rex.Transceiver); } } int numOfPoint = (int)((regionRectangle.Top - regionRectangle.Bottom) / ((double)this.m_Group.Resolution)); int numOfblockPoint = numOfPoint % blockCount; int leftNumOfblockPoint = numOfPoint / blockCount; for (int i = 0; i < blockCount; i++) { maxValue = regionRectangle.Left; minValue = regionRectangle.Right; top = regionRectangle.Top - ((i * leftNumOfblockPoint) * this.m_Group.Resolution); if (i == (blockCount - 1)) { bottom = regionRectangle.Top - ((((i * leftNumOfblockPoint) + leftNumOfblockPoint) + numOfblockPoint) * this.m_Group.Resolution); } else { bottom = regionRectangle.Top - (((i * leftNumOfblockPoint) + leftNumOfblockPoint) * this.m_Group.Resolution); } GeoXYRect geoXYRect = new GeoXYRect(maxValue, minValue, bottom, top); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion polygon = new GeoPolygonRegion(PolygonCreationType.Other); polygon.AddGeoPolygon(geoPolygon); coll = new BlockLTETransceiverColl(); coll.BlockIndex = i; coll.TransceiverExColl = this.m_LteCellFilter.GetCalculateTransceiverInfo(ref allTran, polygon, this.m_Group.Resolution); this.FilterTranByFrequencyBand(coll.TransceiverExColl); this.InitialCalCarriers(coll.TransceiverExColl); this.m_BlockTransceiverExCollArr.Add(coll); } } else { coll = new BlockLTETransceiverColl(); coll.BlockIndex = 0; coll.TransceiverExColl = this.m_CalTansceiverExColl; this.m_BlockTransceiverExCollArr.Add(coll); } }
private void ReadRegion(string[] contents) { int num = int.Parse(contents[1]); int num2 = 0; GeoPolygonRegion region = new GeoPolygonRegion(); while (num2 < num) { GeoPolygon geoPolygon = new GeoPolygon(); int num3 = int.Parse(this.ReadValidLine()); int num4 = 0; string[] strArray = null; string[] separator = new string[] { " ", "\t" }; while (num4 < num3) { num4++; strArray = this.ReadValidLine().Split(separator, StringSplitOptions.RemoveEmptyEntries); double x = double.Parse(strArray[0]); double y = double.Parse(strArray[1]); geoPolygon.Points.Add(new GeoXYPoint(x, y)); } num2++; num2++; region.AddGeoPolygon(geoPolygon); } BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoPolygonStyle style = this.BuildPolygonStyle(brushStyle, penStyle); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region, style); this.m_RegionList.Add(item); }
private void ReadRectangle(string[] contents) { double x = double.Parse(contents[1]); double y = double.Parse(contents[2]); double num3 = double.Parse(contents[3]); double num4 = double.Parse(contents[4]); GeoPolygon geoPolygon = new GeoPolygon(); geoPolygon.Points.Add(new GeoXYPoint(x, y)); geoPolygon.Points.Add(new GeoXYPoint(num3, y)); geoPolygon.Points.Add(new GeoXYPoint(num3, num4)); geoPolygon.Points.Add(new GeoXYPoint(x, num4)); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); try { BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoPolygonStyle style = this.BuildPolygonStyle(brushStyle, penStyle); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region, style); this.m_RegionList.Add(item); } catch { } }
private GeoPolygonRegion CreateRegion(GisLine line) { GeoPolygonRegion region = new GeoPolygonRegion(true, PolygonCreationType.Union); GeoPolygon geoPolygon = new GeoPolygon(); double num = Math.Atan(line.Slope); double num2 = ((1.5707963267948966 + num) * 3.1415926535897931) / 180.0; for (int i = 0; i < 8; i++) { double a = num2 + (i * 0.39269908169872414); double num5 = (Math.Sin(a) * this.m_WidthOfStrip) / 2.0; double num6 = (Math.Cos(a) * this.m_WidthOfStrip) / 2.0; double x = line.StandardPt.X - num5; double y = line.StandardPt.Y - num6; geoPolygon.Points.Add(new GeoXYPoint(x, y)); } region.AddGeoPolygon(geoPolygon); return region; }
private GeoPolygonRegion CreatePolyRegion(List<GeoPolygon> polyList) { int num; for (num = 0; num < (polyList.Count - 1); num++) { for (int i = 0; i < polyList[num].Points.Count; i++) { for (int j = 0; j < polyList[num + 1].Points.Count; j++) { if ((Math.Abs((double) (polyList[num].Points[i].X - polyList[num + 1].Points[j].X)) < 0.1) && (Math.Abs((double) (polyList[num].Points[i].Y - polyList[num + 1].Points[j].Y)) < 0.1)) { polyList[num + 1].Points[j].X = polyList[num].Points[i].X; polyList[num + 1].Points[j].Y = polyList[num].Points[i].Y; } } } } GeoPolygonRegion origin = new GeoPolygonRegion(); GeoPolygonRegion corrspd = new GeoPolygonRegion(true, PolygonCreationType.Draw); origin.AddGeoPolygon(polyList[0]); for (num = 1; num < polyList.Count; num++) { corrspd.AddGeoPolygon(polyList[num]); origin = this.m_PolyRegionExe.GetCombineRegion(origin, corrspd); corrspd = new GeoPolygonRegion(true, PolygonCreationType.Draw); } if (origin != null) { this.CheckBadPoint(origin); this.m_BaseData.AddPolygonRegion(origin); this.m_BaseData.RaiseDataChangedEvent(this, null); return origin; } GlobalSingleton.WriteEventLog("Creating polygon from lines failed.The line is too complex.", Level.Error); GlobalSingleton.ShowWindow(); return origin; }
public bool CalcPolyRegionResult() { GeoPolygon polygon; GeoPolygonRegion region; for (int i = 0; i < (this.m_SourceLine.Points.Count - 1); i++) { this.CalcPairParallel(this.m_SourceLine.Points[i], this.m_SourceLine.Points[i + 1]); } if (this.m_ValidPairParallel == 0) { GeoXYRect geoXYRect = new GeoXYRect(this.m_SourceLine.Points[0].X - (this.m_WidthOfStrip / 2.0), this.m_SourceLine.Points[0].X + (this.m_WidthOfStrip / 2.0), this.m_SourceLine.Points[0].Y - (this.m_WidthOfStrip / 2.0), this.m_SourceLine.Points[0].Y + (this.m_WidthOfStrip / 2.0)); polygon = new GeoPolygon(geoXYRect); region = new GeoPolygonRegion(true, PolygonCreationType.Union); region.AddGeoPolygon(polygon); this.m_BaseData.AddPolygonRegion(region); this.m_BaseData.RaiseDataChangedEvent(this, null); return true; } if (this.m_ValidPairParallel == 1) { this.m_GisLinePairList.Clear(); polygon = new GeoPolygon(); GisLine line = this.CreateGisLine(this.m_SourceLine.Points[0], this.m_SourceLine.Points[1]); GisLine line2 = this.GetPositionLine(this.m_SourceLine.Points[0], this.m_SourceLine.Points[1], line.Slope, this.m_WidthOfStrip / 2.0); this.CalcPairParallel(this.m_SourceLine.Points[0], this.m_SourceLine.Points[1]); this.m_PositivePt = line2.GetJointPt(this.m_GisLinePairList[0].PositiveLine); this.m_OppositePt = line2.GetJointPt(this.m_GisLinePairList[0].OppositeLine); polygon.Points.Add(this.m_PositivePt); polygon.Points.Add(this.m_OppositePt); line2 = this.GetPositionLine(this.m_SourceLine.Points[1], this.m_SourceLine.Points[0], line.Slope, this.m_WidthOfStrip / 2.0); this.m_PositivePt = line2.GetJointPt(this.m_GisLinePairList[0].PositiveLine); this.m_OppositePt = line2.GetJointPt(this.m_GisLinePairList[0].OppositeLine); polygon.Points.Add(this.m_OppositePt); polygon.Points.Add(this.m_PositivePt); region = new GeoPolygonRegion(true, PolygonCreationType.Union); region.AddGeoPolygon(polygon); this.m_BaseData.AddPolygonRegion(region); this.m_BaseData.RaiseDataChangedEvent(this, null); return true; } this.CreateHeadPolygon(); this.CreateInsidePolygonList(); this.CreateTailPolygon(); this.CreatePolyRegion(this.m_PolyList); return true; }
private void GetBlockCellInfoColl(int blockCount, GeoPolygonRegion region) { this.m_BlockCellInfoArr = new List<PredictionBlockCellInfoColl>(); double maxValue = double.MaxValue; double minValue = double.MinValue; double bottom = double.MaxValue; double top = double.MinValue; ICellFilter cellFilter = this.m_Interfaces.CellFilterBuilder.GetCellFilter(); GeoPolygonRegion regionRectangle = cellFilter.GetRegionRectangle(region, this.m_Group.Resolution); List<Transceiver> list = new List<Transceiver>(); foreach (LTECellCalcInfo info in this.m_CalcLTECells) { list.Add(info.Tanceiver); } int num5 = (int)((regionRectangle.Top - regionRectangle.Bottom) / ((double)this.m_Group.Resolution)); int num6 = num5 % blockCount; int num7 = num5 / blockCount; for (int i = 0; i < blockCount; i++) { maxValue = regionRectangle.Left; minValue = regionRectangle.Right; top = regionRectangle.Top - ((i * num7) * this.m_Group.Resolution); if (i == (blockCount - 1)) { bottom = regionRectangle.Top - ((((i * num7) + num7) + num6) * this.m_Group.Resolution); } else { bottom = regionRectangle.Top - (((i * num7) + num7) * this.m_Group.Resolution); } GeoXYRect geoXYRect = new GeoXYRect(maxValue, minValue, bottom, top); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion region3 = new GeoPolygonRegion(); region3.AddGeoPolygon(geoPolygon); PredictionBlockCellInfoColl item = new PredictionBlockCellInfoColl(); item.BlockIndex = i; LTECalcCellsInfoCollection infos = new LTECalcCellsInfoCollection(); infos = cellFilter.GetCalculateCellsInfo(list, region3, this.m_Group.Resolution); item.CalCellColl = infos; this.m_BlockCellInfoArr.Add(item); } }