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; }
public override LayerImagePara GetImage(GeoXYRect bound, Rectangle clientRect, GeoTransformation trans) { if (this.m_Transparency == 0) { return null; } GeoXYRect joinGeoXYRect = this.m_RasterData.Bound.GetJoinGeoXYRect(bound); if (joinGeoXYRect == null) { return null; } System.Drawing.Point bmpLocation = trans.PlaneToScreen(joinGeoXYRect.Left, joinGeoXYRect.Top); bmpLocation.X -= clientRect.X; bmpLocation.Y -= clientRect.Y; int num = trans.PlaneDistanceToScreenDistance(joinGeoXYRect.Right - joinGeoXYRect.Left); int num2 = trans.PlaneDistanceToScreenDistance(joinGeoXYRect.Top - joinGeoXYRect.Bottom); if ((num < 1) || (num2 < 1)) { return null; } GeoCalcBound bound2 = new GeoCalcBound(joinGeoXYRect, 1.0 / trans.TempValue); Bitmap bitmap = this.m_Render.Draw(bound2, this.m_Styles, this.m_Transparency, trans, this.m_HeightRenderStyle); this.m_LayerImage = (Bitmap) bitmap.Clone(); return new LayerImagePara(bmpLocation, bitmap); }
public UserCollection Generate(EnvTrafficMap map,int index, int scalingFactor, bool isFixure) { ITrafficMapModelService service = map.ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService; IGeoPolygonAssist polygonRegionAssist = service.PolygonRegionAssist; this.InitRandom(isFixure); this.m_UserCollection = new UserCollection(); this.m_ScalingFactor = scalingFactor; foreach (GeoPolygonRegion region in map.PolygonRegionList) { try { this.m_Poly = this.getActuralPolyonRegion(polygonRegionAssist, region); this.m_Rect = this.m_Poly.GetMiniEnclosingRect(); foreach (UserMobilityBinding binding in map.PolygonEnvironmentBindings[region].UserDatas) { this.UserMobilityReader(index,binding, isFixure); } } catch (Exception exception) { WriteLog.Logger.Error(region.Name + " is not exist" + exception.Message); } } this.setUserIDProperty(); return this.m_UserCollection; }
private bool Equals(GeoXYRect other) { if ((((this.m_Left != other.m_Left) || (this.m_Right != other.m_Right)) || (this.m_Bottom != other.m_Bottom)) || (this.m_Top != other.m_Top)) { return false; } return true; }
protected GeoPlanetVectorData(SerializationInfo info, StreamingContext context) { this.m_LineCollection = new List<GeoDisplayLine>(); base.m_DataSource = info.GetString("DataSource"); this.m_VectorBound = (GeoXYRect) info.GetValue("VectorBound", typeof(GeoXYRect)); this.m_MenuFile = (GeoMenuFile) info.GetValue("MenuFile", typeof(GeoMenuFile)); this.m_VectorType = info.GetString("VectorType"); this.m_DefaultLineStyle = (GeoLineStyle) info.GetValue("DefaultLineStyle", typeof(GeoLineStyle)); this.m_VectorTypeCollection = (Dictionary<short, string>) info.GetValue("VectorTypeCollection", typeof(Dictionary<short, string>)); base.m_Name = info.GetString("Name"); base.m_FolderNodeName = info.GetString("FolderNodeName"); this.Read(); }
public GeoCalcBound(GeoXYRect geoXYRect, double calcWidth) { this.m_CalcWidth = 20.0; this.m_Left = 0.0; this.m_Right = 0.0; this.m_Bottom = 0.0; this.m_Top = 0.0; this.m_RectRows = 0; this.m_RectColumns = 0; this.m_ArrayLength = 0; this.m_CalcWidth = calcWidth; this.m_Left = geoXYRect.Left; this.m_Right = geoXYRect.Right; this.m_Bottom = geoXYRect.Bottom; this.m_Top = geoXYRect.Top; this.Init(); }
public GeoDemFile(string filePath, GeoXYRect geoBound, double resolution) { this.m_RowsCount = 0; this.m_ColumnsCount = 0; this.m_Resolution = 10.0; this.m_DimOffset = 0; this.m_IsExceptional = false; this.m_DimType = DimType.Binary16; this.m_DimOffset = 0; this.m_FilePath = filePath; this.m_Resolution = resolution; this.m_BottomOfBound = geoBound.Bottom; this.m_LeftOfBound = geoBound.Left; this.m_TopOfBound = geoBound.Top; this.m_RightOfBound = geoBound.Right; this.CalcRowsColums(); }
private void SetUserXY(User user, GeoXYRect Rect, GeoPolygonRegion Polygon) { while (true) { double x = this.RandomGen(Rect.Left, Rect.Right); double y = this.RandomGen(Rect.Bottom, Rect.Top); GeoXYPoint geoXYPoint = new GeoXYPoint(x, y); if (Polygon.IsPointInRegion(geoXYPoint)) { user.X = x; user.Y = y; return; } } }
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); } }
public void SetMapBound(GeoXYRect bound) { this.m_BottomLeftOfMapBound = new GeoXYPoint(bound.Left, bound.Bottom); this.m_TopRightOfMapBound = new GeoXYPoint(bound.Right, bound.Top); this.m_MapWidth = this.m_TopRightOfMapBound.X - this.m_BottomLeftOfMapBound.X; this.m_MapHeight = this.m_TopRightOfMapBound.Y - this.m_BottomLeftOfMapBound.Y; this.CalculateInitialScale(); this.CalculateCurViewBound(); }
public void GisMapRegionSelected(SelectedAreaArgs e) { if (e.SelectedArea != null) { this.m_SelectArea = e.SelectedArea; } }
private short[] GetDatas(GeoXYRect geoXYRect, IGeoRasterData rasterData) { if (rasterData == null) { return null; } GeoCalcBound geoCalcBound = new GeoCalcBound(geoXYRect, rasterData.Resolution); return rasterData.GetValueByCalcBound<short>(geoCalcBound); }
private short[] GetDatas(GeoXYRect geoXYRect, List<IGeoRasterData> rasterDataList) { if (rasterDataList == null) { return null; } rasterDataList = this.SortRasterDataList(rasterDataList); GeoCalcBound geoCalcBound = new GeoCalcBound(geoXYRect, rasterDataList[0].Resolution); Dictionary<double, List<short>> valueDict = new Dictionary<double, List<short>>(); foreach (IGeoRasterData data in rasterDataList) { short[] valueByCalcBound = data.GetValueByCalcBound<short>(geoCalcBound); valueDict.Add(data.Resolution, new List<short>(valueByCalcBound)); } return GeoInfo.GetGridData(valueDict).ToArray(); }
private List<GeoXYPoint> GetClutterPointInBound(short clutterID, List<int> clutterIDIndexList, GeoCalcBound geoCalcBound, bool isRandomPt) { double num; double num2; double num3; double num4; int num11; List<GeoXYPoint> list = new List<GeoXYPoint>(); GetMapBound(this.m_IGeoDataMgr.ClutterRasterData, out num, out num2, out num3, out num4); GeoXYRect rect = new GeoXYRect(num, num2, num3, num4); GeoXYRect rect2 = new GeoXYRect(geoCalcBound.Left, geoCalcBound.Right, geoCalcBound.Bottom, geoCalcBound.Top); GeoCalcBound bound = new GeoCalcBound(rect.GetJoinGeoXYRect(rect2), geoCalcBound.CalcWidth); double left = bound.Left; double top = bound.Top; int rectColumns = bound.RectColumns; int rectRows = bound.RectRows; double calcWidth = geoCalcBound.CalcWidth; if (isRandomPt) { Random random = new Random(); foreach (int num10 in clutterIDIndexList) { num11 = this.m_ClutterIDIndexDict[clutterID][num10 / 10]; list.Add(this.GetRadomPoint(num11, left, top, rectColumns, rectRows, calcWidth, random)); } return list; } foreach (int num10 in clutterIDIndexList) { num11 = this.m_ClutterIDIndexDict[clutterID][num10 / 10]; list.Add(this.GetFixPoint(num11, left, top, rectColumns, calcWidth)); } return list; }
private Dictionary<short, double> CalcPolygonClutterPercent(GeoPolygonRegion polygonRegion, SimulationProgressHandle simProgressHandle, List<IGeoRasterData> rasterDataList, Dictionary<short, string> clutterIDTypeDict, GeoXYRect resPolyRegion) { if (this.m_CaculateFullMap) { this.GetAllMapClutterPercent(rasterDataList, clutterIDTypeDict); return new Dictionary<short, double>(this.m_AllMapClutterIDPercentDict); } if (this.m_IsClutterPercentRun) { this.m_IsClutterPercentRun = polygonRegion.Equals(this.m_PolygonRegion); } if (!this.m_IsClutterPercentRun) { this.CalcPolygonClutterPercent(polygonRegion, resPolyRegion, rasterDataList); this.m_IsClutterPercentRun = true; this.GetPercent(polygonRegion); this.m_PolygonRegion = polygonRegion.Clone(); } this.m_SimulationProgressEvent = (SimulationProgressHandle) Delegate.Remove(this.m_SimulationProgressEvent, simProgressHandle); this.m_IsNeedReportProgress = false; return new Dictionary<short, double>(this.m_ClutterIDPercentDict); }
public void CalcPolygonClutterPercent(GeoPolygonRegion polygonRegion, GeoXYRect resPolyRegion, List<IGeoRasterData> rasterDataList) { rasterDataList = this.SortRasterDataList(rasterDataList); GeoCalcBound bound = new GeoCalcBound(resPolyRegion, rasterDataList[0].Resolution); double x = 0.0; double y = 0.0; x = bound.Left; y = bound.Top; short key = -1; int num4 = 0; num4 = (int) Math.Ceiling((double) (((double) bound.RectRows) / ((double) (this.m_ProgressEnd - this.m_ProgressStart)))); for (int i = 0; i < bound.RectRows; i++) { if (((i % num4) == 0) && (this.m_ProgressStart < this.m_ProgressEnd)) { this.m_ProgressStart++; this.m_SimulationProgressEvent("", this.m_ProgressStart, ""); } y = bound.Top - (i * bound.CalcWidth); for (int j = 0; j < bound.RectColumns; j++) { x = bound.Left + (bound.CalcWidth * j); GeoXYPoint geoXYPoint = new GeoXYPoint(x, y); if (this.m_CaculateFullMap || polygonRegion.IsPointInRegion(geoXYPoint)) { key = this.GetValueByPoint(geoXYPoint, rasterDataList); if (this.m_ClutterIDCountDict.ContainsKey(key)) { Dictionary<short, int> dictionary; short num7; (dictionary = this.m_ClutterIDCountDict)[num7 = key] = dictionary[num7] + 1; } } } } if (this.m_ProgressStart != this.m_ProgressEnd) { this.m_SimulationProgressEvent("", this.m_ProgressEnd, ""); } }
private void SetUserXY(User user, GeoXYRect Rect, double Resolution, GeoXYLine Line) { while (true) { double x = this.RandomGen(Rect.Left, Rect.Right); double y = this.RandomGen(Rect.Bottom, Rect.Top); GeoXYPoint point = new GeoXYPoint(x, y); for (int i = 0; i < (Line.PointsCount - 1); i++) { GeoXYLine line = new GeoXYLine(Line.Points[i], Line.Points[i + 1]); if (line.DistanceAsLineSegmentToPoint(point) < Resolution) { user.X = x; user.Y = y; break; } } if (user.X > 0.0) { return; } } }
private void GetDatas(GeoPolygonRegion polygonRegion, List<IGeoRasterData> rasterDataList, bool isSetPointDict, bool isRandomPt) { if ((rasterDataList != null) && (rasterDataList.Count != 0)) { double num; double num2; double num3; double num4; GeoXYRect miniEnclosingRect = polygonRegion.GetMiniEnclosingRect(); GeoXYRect resPolyRegion = null; GetMapBound(rasterDataList, out num, out num2, out num3, out num4); GeoXYRect rect = new GeoXYRect(num, num2, num3, num4); try { resPolyRegion = miniEnclosingRect.GetJoinGeoXYRect(rect); } catch { return; } if (null != resPolyRegion) { this.GetDatasCore(polygonRegion, rasterDataList, isSetPointDict, isRandomPt, resPolyRegion); } } }
private void LayerBoundAdd(string[] str, int index) { double result = 0.0; double num2 = 0.0; double num3 = 0.0; double num4 = 0.0; if (!double.TryParse(str[index], out result)) { throw new Exception(GISGlobalResourceEx.GIS_UI_INVALID_BOUND_IN_FILEFormat("left", base.m_DataSource)); } if (!double.TryParse(str[index + 1], out num2)) { throw new Exception(GISGlobalResourceEx.GIS_UI_INVALID_BOUND_IN_FILEFormat("right", base.m_DataSource)); } if (!double.TryParse(str[index + 2], out num3)) { throw new Exception(GISGlobalResourceEx.GIS_UI_INVALID_BOUND_IN_FILEFormat("bottom", base.m_DataSource)); } if (!double.TryParse(str[index + 3], out num4)) { throw new Exception(GISGlobalResourceEx.GIS_UI_INVALID_BOUND_IN_FILEFormat("top", base.m_DataSource)); } this.m_VectorBound = new GeoXYRect(result, num2, num3, num4); this.m_VectorType = str[index + 4]; base.m_Name = this.m_VectorType; }
private void GetDatasCore(GeoPolygonRegion polygonRegion, List<IGeoRasterData> rasterDataList, bool isSetPointDict, bool isRandomPt, GeoXYRect resPolyRegion) { GeoCalcBound geoCalcBound = new GeoCalcBound(resPolyRegion, rasterDataList[0].Resolution); short[] datas = this.GetDatas(resPolyRegion, rasterDataList); if (datas.Length != 0) { List<short> list = new List<short>(); double tempX = 0.0; double tempY = 0.0; tempX = geoCalcBound.Left; tempY = geoCalcBound.Top; this.InitialCLutterIDIndexDict(); GC.Collect(); int step = 0; if (this.m_IsNeedReportProgress) { step = (int) Math.Ceiling((double) (((double) geoCalcBound.RectRows) / ((double) (this.m_ProgressEnd - this.m_ProgressStart)))); } lock (this.m_ClutterIDIndexDict) { double random = 0.0; if (isRandomPt) { random = new Random().Next(0, 9); } for (int i = 0; i < geoCalcBound.RectRows; i++) { tempX = geoCalcBound.Left; tempY = geoCalcBound.Top - (i * geoCalcBound.CalcWidth); this.GetOneLineXDatas(geoCalcBound, tempX, tempY, polygonRegion, ref datas, isSetPointDict, random); this.ReportProgress(step, i); } } } }
private bool IsShapeIntersectGeoXYRect(GeoXYRect geoRect, IGeoEntity shape) { if (shape is GeoXYRect) { return geoRect.IsRectJoinGeoXYRect(shape as GeoXYRect); } if (shape is GeoXYLine) { return geoRect.IsLineIntersectRect(shape as GeoXYLine); } return ((shape is GeoXYPoint) && geoRect.IsPointInGeoXYRect(shape as GeoXYPoint)); }
public SelectedAreaArgs(GeoXYRect rect) { this.m_SelectedArea = rect; }
private void SelectAreaBtn_CheckedChanged(object sender, EventArgs e) { if (!this.m_SelectAreaBtn.Checked) { this.m_SelectArea = null; } }
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; }
private Dictionary<GeoXYPoint, short> GetNodeDatas(GeoXYRect geoXYRect, List<IGeoRasterData> rasterDataList) { if ((rasterDataList == null) || (rasterDataList.Count < 1)) { return null; } rasterDataList = this.SortRasterDataList(rasterDataList); GeoCalcBound geoCalcBound = new GeoCalcBound(geoXYRect, rasterDataList[0].Resolution); Dictionary<double, List<short>> valueDict = new Dictionary<double, List<short>>(); foreach (IGeoRasterData data in rasterDataList) { short[] valueByCalcBound = data.GetValueByCalcBound<short>(geoCalcBound); valueDict.Add(data.Resolution, new List<short>(valueByCalcBound)); } List<short> gridData = GeoInfo.GetGridData(valueDict); Dictionary<GeoXYPoint, short> dictionary2 = new Dictionary<GeoXYPoint, short>(); int rectRows = geoCalcBound.RectRows; int rectColumns = geoCalcBound.RectColumns; for (int i = 0; i < rectRows; i++) { double y = geoCalcBound.Top - (i * geoCalcBound.CalcWidth); for (int j = 0; j < rectColumns; j++) { double x = geoCalcBound.Left + (geoCalcBound.CalcWidth * j); dictionary2.Add(new GeoXYPoint(x, y), gridData[(i * rectColumns) + j]); } } return dictionary2; }
public GeoXYRect GetBound() { if (this.m_Points.Count < 2) { return null; } GeoXYRect rect = new GeoXYRect(); rect.Bottom = double.MaxValue; rect.Top = double.MinValue; rect.Left = double.MaxValue; rect.Right = double.MinValue; foreach (GeoXYPoint point in this.m_Points) { if (point.X > rect.Right) { rect.Right = point.X; } if (point.X < rect.Left) { rect.Left = point.X; } if (point.Y > rect.Top) { rect.Top = point.Y; } if (point.Y < rect.Bottom) { rect.Bottom = point.Y; } } return rect; }
public GeoPlanetClutterData(string demFilePath, Huawei.UNet.GIS.GeoData.GeoMenuFile geoMenuFile, GeoXYRect geoBound, double resolution) { base.m_DataSource = demFilePath; this.m_GeoMenuFile = geoMenuFile; base.m_GeoDemFile = new GeoDemFile(base.m_DataSource, geoBound, resolution); }
public Dictionary<short, double> GetPolygonClutterPercent(GeoPolygonRegion polygonRegion, SimulationProgressHandle simProgressHandle, int start, int end, string infoStr) { double num2; double num3; double num4; double num5; this.m_SimulationProgressEvent = (SimulationProgressHandle) Delegate.Combine(this.m_SimulationProgressEvent, simProgressHandle); this.m_IsNeedReportProgress = true; this.m_ProgressStart = start; this.m_ProgressEnd = end; this.m_ProgressStr = infoStr; List<IGeoRasterData> demData = this.GetDemData(DemDataType.Clutter); Dictionary<short, string> allClutter = this.GetAllClutter(); Dictionary<short, double> dictionary2 = new Dictionary<short, double>(); this.m_ClutterIDCountDict.Clear(); foreach (short num in allClutter.Keys) { this.m_ClutterIDCountDict.Add(num, 0); dictionary2.Add(num, 0.0); } GeoXYRect miniEnclosingRect = polygonRegion.GetMiniEnclosingRect(); GeoXYRect resPolyRegion = null; if ((demData == null) || (demData.Count == 0)) { return dictionary2; } GetMapBound(demData, out num2, out num3, out num4, out num5); GeoXYRect rect = new GeoXYRect(num2, num3, num4, num5); try { resPolyRegion = miniEnclosingRect.GetJoinGeoXYRect(rect); } catch { return dictionary2; } if (null == resPolyRegion) { return dictionary2; } if (resPolyRegion.IsRectInGeoXYRect(rect)) { this.m_CaculateFullMap = true; } else { this.m_CaculateFullMap = false; } return this.CalcPolygonClutterPercent(polygonRegion, simProgressHandle, demData, allClutter, resPolyRegion); }
public Bitmap DrawGlassPanelImage(Bitmap bitmap) { double left = this.m_Transformation.ScreenToPlaneOfX(0); double right = this.m_Transformation.ScreenToPlaneOfX(this.m_ImageWidth); double bottom = this.m_Transformation.ScreenToPlaneOfY(this.m_ImageHeight); double top = this.m_Transformation.ScreenToPlaneOfY(0); this.m_GlassPanelBound = new GeoXYRect(left, right, bottom, top); this.m_GlassPanelImage = this.m_Render.Draw(this.m_GlassPanelBound, this.m_Transformation, new Point(0, 0), bitmap); return bitmap; }
private Dictionary<short, double> GetRectClutterPercent(GeoXYRect rect) { List<short> clutterIDArray = new List<short>(); clutterIDArray.AddRange(this.GetDatas(rect, this.GetDemData(DemDataType.Clutter))); return this.GetPercent(clutterIDArray); }