예제 #1
0
 private void CalcOneLineXDatas(GeoCalcBound geoCalcBound, double tempX, double tempY, GeoPolygonRegion polygonRegion, short[] valueArray)
 {
     for (int i = 0; i < geoCalcBound.RectColumns; i++)
     {
         tempX = geoCalcBound.Left + (geoCalcBound.CalcWidth * i);
         if (this.m_CaculateFullMap || polygonRegion.IsPointInRegion(new GeoXYPoint(tempX, tempY)))
         {
             int indexOffsetIsCalcWidthMulti = geoCalcBound.GetIndexOffsetIsCalcWidthMulti(tempX, tempY);
             short key = valueArray[indexOffsetIsCalcWidthMulti];
             if (this.m_ClutterIDCountDict.ContainsKey(key))
             {
                 Dictionary<short, int> dictionary;
                 short num4;
                 (dictionary = this.m_ClutterIDCountDict)[num4 = key] = dictionary[num4] + 1;
             }
         }
     }
 }
예제 #2
0
파일: SimGroup.cs 프로젝트: xiaoyj/Space
 private void SelectValidUserByCalculationRegion(GeoPolygonRegion m_CalculationPolyRegion, List<User> snapshotUsers, List<User> trafficUsers)
 {
     GeoXYPoint geoXYPoint = new GeoXYPoint();
     foreach (User user in trafficUsers)
     {
         geoXYPoint.X = user.X;
         geoXYPoint.Y = user.Y;
         //如果用户在计算范围内则为用户配置属性
         //如果用户的IsCalculatInPolygon字段为true,则表示已分配好终端、服务等,不需要重新配置
         if (!(!m_CalculationPolyRegion.IsPointInRegion(geoXYPoint) || user.IsCalculatInPolygon))
         {
             user.Terminal = this.m_CloneTerminalDic[user.Terminal.Name];
             user.Service = this.m_CloneServiceDic[user.Service.Name];
             user.Mobility = this.m_CloneMobilityDic[user.Mobility.Name];
             user.IsCalculatInPolygon = true;
             snapshotUsers.Add(user);
         }
     }
    
 }
예제 #3
0
 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;
         }
     }
 }
예제 #4
0
 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, "");
     }
 }
예제 #5
0
 private bool IsFourTopPointInRegion(GeoXYPoint northWestPoint, GeoPolygonRegion region)
 {
     float resolution = this.m_Group.Resolution;
     bool flag = false;
     if (region.IsPointInRegion(northWestPoint))
     {
         return true;
     }
     GeoXYPoint geoXYPoint = new GeoXYPoint(northWestPoint.X + resolution, northWestPoint.Y);
     if (region.IsPointInRegion(geoXYPoint))
     {
         return true;
     }
     GeoXYPoint point2 = new GeoXYPoint(northWestPoint.X + resolution, northWestPoint.Y - resolution);
     if (region.IsPointInRegion(point2))
     {
         return true;
     }
     GeoXYPoint point3 = new GeoXYPoint(northWestPoint.X, northWestPoint.Y - resolution);
     return (region.IsPointInRegion(point3) || flag);
 }
예제 #6
0
 private bool CheckBinAvailable(GeoPolygonRegion region, int index)
 {
     GeoXYPoint xYPoint = this.m_TFMatrix.GetXYPoint(index);
     float resolution = this.m_Group.Resolution;
     if (region.IsPointInRegion(xYPoint))
     {
         return true;
     }
     GeoXYPoint geoXYPoint = new GeoXYPoint(xYPoint.X + resolution, xYPoint.Y);
     if (region.IsPointInRegion(geoXYPoint))
     {
         return true;
     }
     geoXYPoint = new GeoXYPoint(xYPoint.X + resolution, xYPoint.Y - resolution);
     if (region.IsPointInRegion(geoXYPoint))
     {
         return true;
     }
     geoXYPoint = new GeoXYPoint(xYPoint.X, xYPoint.Y - resolution);
     if (region.IsPointInRegion(geoXYPoint))
     {
         return true;
     }
     List<GeoPolygon> allPolygon = region.GetAllPolygon();
     foreach (GeoPolygon polygon in allPolygon)
     {
         foreach (GeoXYPoint point3 in polygon.Points)
         {
             if ((((point3.X > xYPoint.X) && (point3.X < (xYPoint.X + resolution))) && (point3.Y < xYPoint.Y)) && (point3.Y > (xYPoint.Y - resolution)))
             {
                 return true;
             }
         }
     }
     return false;
 }