public unsafe Bitmap Draw(GeoCalcBound bound, List<GeoRasterStyle> styles, int transparency, GeoTransformation transfor, HeightStyle heightStyle) { Bitmap bitmap; int key = this.DrawContextGetHashCode(bound, styles, transparency, heightStyle); if (!this.m_Cache.TryGetBitmap(key, out bitmap)) { bitmap = new Bitmap(bound.RectColumns, bound.RectRows, PixelFormat.Format8bppIndexed); this.SetPalette(bitmap, styles, transparency, heightStyle); short[] valueByCalcBound = this.m_HeightData.GetValueByCalcBound<short>(bound, true); Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height); BitmapData bitmapdata = bitmap.LockBits(rect, ImageLockMode.ReadWrite, bitmap.PixelFormat); byte* numPtr = (byte*) bitmapdata.Scan0.ToPointer(); int num2 = bitmapdata.Stride - bitmap.Width; List<MaxMinValue> heightIntervals = this.GetHeightIntervals(styles); for (int i = 0; i < bound.RectRows; i++) { for (int j = 0; j < bound.RectColumns; j++) { short heightValue = valueByCalcBound[(bound.RectColumns * i) + j]; numPtr++; numPtr[0] = (byte) ColorArray<short>.GetHeightIndexOfPalette(heightIntervals, heightValue, heightStyle); } numPtr += num2; } bitmap.UnlockBits(bitmapdata); this.GrayBitmap(bitmap, styles, heightStyle); this.m_Cache.UpdateCache(key, bitmap); } return bitmap; }
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 PolygonOperator(GeoUserVectorData polygonLayer, GeoTransformation trans, GeoNameControl nc) { this.m_BindingData = polygonLayer; this.m_geoNameControl = nc; this.Init(this.m_BindingData, trans); this.m_geoNameControl.PolygonRegionDict = this.m_PolyRegionDict; }
private GisSystemDataImp(SerializationInfo info, StreamingContext context) { this.m_PolygonRegion = new List<GeoDisplayPolygonRegion>(); this.m_LayerInfoDict = new Dictionary<NodeType, List<LayerSerializeInfo>>(); if (ProjectSingleton.Instance.OpenV3R5ProjectFile) { this.m_SubSystemName = info.GetString("m_SubSystemName"); this.m_PolygonRegion = info.GetValue("m_PolygonRegion", typeof(List<GeoDisplayPolygonRegion>)) as List<GeoDisplayPolygonRegion>; this.m_Points = info.GetValue("m_Points", typeof(List<GeoDisplayPoint>)) as List<GeoDisplayPoint>; this.m_GeoTransformation = info.GetValue("m_GeoTransformation", typeof(GeoTransformation)) as GeoTransformation; this.m_MapTypeToName2Path = info.GetValue("m_MapTypeToName2Path", typeof(KeyValuePair<NodeType, Dictionary<string, GisMapPath>>[])) as KeyValuePair<NodeType, Dictionary<string, GisMapPath>>[]; this.m_MapTypeToNameOrder = info.GetValue("m_MapTypeToNameOrder", typeof(KeyValuePair<NodeType, List<string>>[])) as KeyValuePair<NodeType, List<string>>[]; this.m_DefaultParameters = info.GetValue("m_DefaultParameters", typeof(ClutterParameters[])) as ClutterParameters[]; this.m_ActualParameters = info.GetValue("m_ActualParameters", typeof(ClutterParameters[])) as ClutterParameters[]; this.RemoveAtSymbol(this.m_DefaultParameters); this.RemoveAtSymbol(this.m_ActualParameters); List<GeoBitmapData> list = info.GetValue("m_SatelliticLayers", typeof(List<GeoBitmapData>)) as List<GeoBitmapData>; Dictionary<string, GisMapPath> dictionary = new Dictionary<string, GisMapPath>(); int num = 0; foreach (string str in this.m_MapTypeToNameOrder[5].Value) { GeoBitmapData data = list[num++]; GisMapPath path = new GisMapPath(); path.GisIndexPath = data.DataSource; path.ImageBound = data.Bound; dictionary.Add(str, path); } KeyValuePair<NodeType, Dictionary<string, GisMapPath>> pair = new KeyValuePair<NodeType, Dictionary<string, GisMapPath>>(NodeType.Image, dictionary); this.m_MapTypeToName2Path[5] = pair; this.m_ClutterColorDict = info.GetValue("m_ClutterColorDict", typeof(Dictionary<short, Color>)) as Dictionary<short, Color>; this.m_HeightColorDict = info.GetValue("m_HeightColorDict", typeof(Dictionary<MaxMinValue, Color>)) as Dictionary<MaxMinValue, Color>; this.m_BuidingColorDict = info.GetValue("m_BuidingColorDict", typeof(Dictionary<MaxMinValue, Color>)) as Dictionary<MaxMinValue, Color>; } else { //Added by wj 2010-11-5 this.m_ScaleIndex = info.GetInt32("m_ScaleIndex"); this.m_GeoEntityIDCreater = info.GetInt32("m_GeoEntityIDCreater"); this.m_GeoLayerIDCreater = info.GetInt32("m_GeoLayerIDCreater"); this.m_LayerInfoDict = info.GetValue("m_LayerInfoDict", typeof(Dictionary<NodeType, List<LayerSerializeInfo>>)) as Dictionary<NodeType, List<LayerSerializeInfo>>; this.m_Lines = info.GetValue("m_Lines", typeof(List<GeoDisplayLine>)) as List<GeoDisplayLine>; this.m_Points = info.GetValue("m_Points", typeof(List<GeoDisplayPoint>)) as List<GeoDisplayPoint>; this.m_GeoTransformation = info.GetValue("m_GeoTransformation", typeof(GeoTransformation)) as GeoTransformation; this.m_PolygonRegion = info.GetValue("m_PolygonRegion", typeof(List<GeoDisplayPolygonRegion>)) as List<GeoDisplayPolygonRegion>; this.m_SubSystemName = info.GetString("m_SubSystemName"); this.m_TypeMapOrderMgr = info.GetValue("m_TypeMapOrderMgr", typeof(Huawei.UNet.GIS.GeoInterface.TypeMapOrderMgr)) as Huawei.UNet.GIS.GeoInterface.TypeMapOrderMgr; this.m_DefaultParameters = info.GetValue("m_DefaultParameters", typeof(ClutterParameters[])) as ClutterParameters[]; this.m_ActualParameters = info.GetValue("m_ActualParameters", typeof(ClutterParameters[])) as ClutterParameters[]; this.ClutterElementsStatus = info.GetValue("ClutterElementsStatus", typeof(Dictionary<string, List<DiscreteElement>>)) as Dictionary<string, List<DiscreteElement>>; this.HeightsElementsStatus = info.GetValue("HeightsElementsStatus", typeof(Dictionary<string, List<IntervalsElement>>)) as Dictionary<string, List<IntervalsElement>>; this.BuildingElementsStatus = info.GetValue("BuildingElementsStatus", typeof(Dictionary<string, List<IntervalsElement>>)) as Dictionary<string, List<IntervalsElement>>; } }
public GeoTile(string id, int tileWidth, int tileHeight, Point screenPoint, GeoTransformation geoTransformation, bool drawGridLine) { this.m_isDrawGridLine = true; this.m_GridLinePen = new Pen(Color.LightBlue); this.m_GridLineDistance = 0x40; this.m_Id = id; this.m_TileWidth = tileWidth; this.m_TileHeight = tileHeight; this.m_OriginalScreenPoint = screenPoint; this.m_CurrentScreenPoint = screenPoint; this.m_GeoTransformation = geoTransformation; this.m_GridLinePen.DashStyle = DashStyle.Dash; this.m_isDrawGridLine = drawGridLine; }
public GlassPanel(GeoTransformation trans) { this.m_Transformation = trans; this.m_Render = new GeoVectorRender(this); }
public void SetNeededReSplitTiles(bool isNeedReSplitTiles, GeoTransformation transformationForTiles) { if (isNeedReSplitTiles) { this.m_TransformationForTiles = transformationForTiles; this.m_XOffset = 0; this.m_YOffset = 0; } }
public void Copy(GeoTransformation tranformation) { this.m_MapScale = tranformation.MapScale; this.m_InitialScale = tranformation.InitialScale; this.m_CurrentScale = tranformation.CurrentScale; this.m_MinScale = tranformation.MinScale; this.m_MaxScale = tranformation.MaxScale; this.m_ZoomValue = tranformation.ZoomValue; this.m_DispAreaWidth = tranformation.DispAreaWidth; this.m_DispAreaHeight = tranformation.DispAreaHeight; this.m_OriginX = tranformation.OriginX; this.m_OriginY = tranformation.OriginY; this.m_CurViewX1 = tranformation.CurViewX1; this.m_CurViewY1 = tranformation.CurViewY1; this.m_CurViewX2 = tranformation.CurViewX2; this.m_CurViewY2 = tranformation.CurViewY2; this.m_TempValue = tranformation.TempScale; this.m_OriginXOffset = tranformation.OriginXOffset; this.m_OriginYOffset = tranformation.OriginYOffset; this.m_IsMove = tranformation.m_IsMove; this.m_IsNeedReDraw = tranformation.m_IsNeedReDraw; this.m_MapHeight = tranformation.m_MapHeight; this.m_MapWidth = tranformation.m_MapWidth; this.m_CoordinateTransform = tranformation.CoordinateTransform.Clone(); this.m_BottomLeftOfMapBound = tranformation.m_BottomLeftOfMapBound.Clone(); this.m_TopRightOfMapBound = tranformation.m_TopRightOfMapBound.Clone(); }
public GeoTransformation Clone() { GeoTransformation transformation = new GeoTransformation(); transformation.m_BottomLeftOfMapBound = this.m_BottomLeftOfMapBound.Clone(); transformation.m_CoordinateTransform = this.m_CoordinateTransform.Clone(); transformation.m_CurrentScale = this.m_CurrentScale; transformation.m_CurViewX1 = this.m_CurViewX1; transformation.m_CurViewX2 = this.m_CurViewX2; transformation.m_CurViewY1 = this.m_CurViewY1; transformation.m_CurViewY2 = this.m_CurViewY2; transformation.m_DispAreaHeight = this.m_DispAreaHeight; transformation.m_DispAreaWidth = this.m_DispAreaWidth; transformation.m_InitialScale = this.m_InitialScale; transformation.m_IsMove = this.m_IsMove; transformation.m_IsNeedReDraw = this.m_IsNeedReDraw; transformation.m_MapHeight = this.m_MapHeight; transformation.m_MapScale = this.m_MapScale; transformation.m_MapWidth = this.m_MapWidth; transformation.m_MaxScale = this.m_MaxScale; transformation.m_MinScale = this.m_MinScale; transformation.m_OriginX = this.m_OriginX; transformation.m_OriginXOffset = this.m_OriginXOffset; transformation.m_OriginY = this.m_OriginY; transformation.m_OriginYOffset = this.m_OriginYOffset; transformation.m_TempValue = this.m_TempValue; transformation.m_TopRightOfMapBound = this.m_TopRightOfMapBound.Clone(); transformation.m_ZoomValue = this.m_ZoomValue; return transformation; }
public void InitWithXY(Bitmap bitmap, GeoXYPoint lowerLeftPoint, GeoXYPoint upperRightPoint, int transparentValue, GeoTransformation geoTransformation) { this.InitImage(bitmap, transparentValue); this.m_LeftOfBoundXY = lowerLeftPoint.X; this.m_RightOfBoundXY = upperRightPoint.X; this.m_TopOfBoundXY = upperRightPoint.Y; this.m_BottomOfBoundXY = lowerLeftPoint.Y; this.m_TransparentValue = transparentValue; this.m_GeoTransformation = geoTransformation; this.pictureBox1.Image = this.m_Bitmap; this.trackBarTransaprent.Value = Convert.ToInt32((double) ((((double) (0xff - transparentValue)) / 255.0) * 100.0)); this.lbPercent.Text = string.Format("{0}%", this.trackBarTransaprent.Value); this.tbEastXY.Text = this.m_RightOfBoundXY.ToString("f2"); this.tbWestXY.Text = this.m_LeftOfBoundXY.ToString("f2"); this.tbSouthXY.Text = this.m_BottomOfBoundXY.ToString("f2"); this.tbNorthXY.Text = this.m_TopOfBoundXY.ToString("f2"); this.InitBLWithXY(); }
private void Init(GeoUserVectorData polygonLayer, GeoTransformation trans) { this.InitializeComponent(); this.m_PolyRegionDict = new Dictionary<int, GeoPolygonRegion>(); this.m_PolygonDict = new Dictionary<int, List<Huawei.UNet.GIS.GeoUI.Polygon>>(); this.m_PolygonIDList = new List<int>(); this.m_PolyRegionExe = new PolyRegionExe(this.m_geoNameControl); this.m_PolyRegionList = polygonLayer.GetAllPolygons(); this.m_Transformation = trans.Clone(); foreach (GeoPolygonRegion region in this.m_PolyRegionList) { this.SetPolygonArea(region); } foreach (GeoPolygonRegion region in this.m_PolyRegionList) { this.m_PolyRegionDict.Add(region.ID, region); this.TransformPolygonDict(region.ID, region); } this.AddListViewItem(); this.rdbIntersect.Checked = true; }