Esempio n. 1
0
 public static void RenderGeometrys(Graphics g, Pen pen, Brush brush, MG_MapView mapview, List <MG_Geometry> geometrys)
 {
     for (int i = 0; i < geometrys.Count; i++)
     {
         RenderGeometry(g, pen, brush, mapview, geometrys[i]);
     }
 }
Esempio n. 2
0
 public static void RenderMultiPoint(Graphics g, Brush brush, int radius, MG_MapView mapview, MG_MultiPoint multiPoint)
 {
     for (int i = 0; i < multiPoint.Count(); i++)
     {
         RenderPoint(g, brush, radius, mapview, multiPoint.GetAt(i));
     }
 }
Esempio n. 3
0
        public static void RenderGeometry(Graphics g, Pen pen, Brush brush, MG_MapView mapview, MG_Geometry geometry)
        {
            switch (geometry.Type)
            {
            case MG_GeometryType.NONE:
                break;

            case MG_GeometryType.POINT:
                MG_MapRender.RenderPoint(g, brush, MG_Constant.PointRadius, mapview, geometry as MG_Point);
                break;

            case MG_GeometryType.MULTIPOINT:
                MG_MapRender.RenderMultiPoint(g, brush, MG_Constant.PointRadius, mapview, geometry as MG_MultiPoint);
                break;

            case MG_GeometryType.LINESTRING:
                MG_MapRender.RenderLineString(g, pen, mapview, geometry as MG_LineString);
                break;

            case MG_GeometryType.MULTILINESTRING:
                MG_MapRender.RenderMultiLineString(g, pen, mapview, geometry as MG_MultiLineString);
                break;

            case MG_GeometryType.POLYGON:
                MG_MapRender.RenderPolygon(g, brush, mapview, geometry as MG_Polygon);
                //MG_MapRender.RenderPolygon(g, pen, mapview, geometry as MG_Polygon);
                break;

            case MG_GeometryType.MULTIPOLYGON:
                MG_MapRender.RenderMultiPolygon(g, brush, mapview, geometry as MG_MultiPolygon);
                //MG_MapRender.RenderMultiPolygon(g, pen, mapview, geometry as MG_MultiPolygon);
                break;
            }
        }
Esempio n. 4
0
 public static void RenderMultiPolygon(Graphics g, Pen pen, MG_MapView mapview, MG_MultiPolygon multiPolygon)
 {
     for (int i = 0; i < multiPolygon.Count(); i++)
     {
         RenderPolygon(g, pen, mapview, multiPolygon.GetAt(i));
     }
 }
Esempio n. 5
0
 public static void RenderMap(MG_Map map, MG_MapView mapview, Graphics g)
 {
     for (int i = 0; i < map.GetLayerCount(); i++)
     {
         RenderLayer(map.GetLayer(i), mapview, g);
     }
 }
Esempio n. 6
0
 public static void RenderMultiLineString(Graphics g, Pen pen, MG_MapView mapview, MG_MultiLineString multiLineString)
 {
     for (int i = 0; i < multiLineString.Count(); i++)
     {
         RenderLineString(g, pen, mapview, multiLineString.GetAt(i));
     }
 }
Esempio n. 7
0
        public static void RenderFeature(MG_Feature f, MG_MapView mapview, Graphics g)
        {
            //int realValue = GetRealValue(f.Symbol.LineWidth, mapview);
            Pen        pen   = new Pen(f.Symbol.OutlineColor, f.Symbol.LineWidth);
            SolidBrush brush = new SolidBrush(f.Symbol.FillColor);

            RenderGeometry(g, pen, brush, mapview, f.Geometry);
        }
Esempio n. 8
0
 public static void RenderLayer(MG_Layer layer, MG_MapView mapview, Graphics g)
 {
     if (layer.GetVisible())
     {
         for (int i = 0; i < layer.GetFeatureCount(); i++)
         {
             RenderFeature(layer.GetFeature(i), mapview, g);
         }
     }
 }
Esempio n. 9
0
        public static void RenderPoint(Graphics g, Brush brush, int radius, MG_MapView mapview, MG_Point point)
        {
            //int realValue = GetRealValue(radius, mapview);
            //if (realValue < MG_Constant.PointRadius)
            //{
            //    realValue = MG_Constant.PointRadius;
            //}
            Point sp = AsPoint(point, mapview);

            FillPoint(g, brush, sp, radius);
        }
Esempio n. 10
0
        public static int GetRealValue(int value, MG_MapView mapview)
        {
            int realValue = value;

            if (mapview != null)
            {
                realValue = (int)mapview.GetValue(value);
                if (realValue <= 0)
                {
                    realValue = 1;
                }
            }
            return(realValue);
        }
Esempio n. 11
0
        public static MG_Point ToPoint(Point point, MG_MapView mapview)
        {
            MG_Point mp;

            if (mapview != null)
            {
                mp = mapview.Screent2Map(point);
            }
            else
            {
                mp = new MG_Point(point.X, point.Y);
            }
            return(mp);
        }
Esempio n. 12
0
        private static Point AsPoint(MG_Point point, MG_MapView mapview)
        {
            Point sp;

            if (mapview != null)
            {
                sp = mapview.Map2Screen(point);
            }
            else
            {
                sp = new Point((int)point.x, (int)point.y);
            }
            return(sp);
        }
Esempio n. 13
0
        public static void RenderLineString(Graphics g, Pen pen, MG_MapView mapview, MG_LineString lineString)
        {
            int count = lineString.Count();

            if (count < 2)
            {
                return;
            }
            Point[] points = new Point[count];
            for (int i = 0; i < count; i++)
            {
                MG_Point mp = lineString.GetAt(i);
                points[i] = AsPoint(mp, mapview);
            }
            DrawLineString(g, pen, points);
        }
Esempio n. 14
0
        public MG_BaseTool(MG_ToolType type, MG_Layer layer, MG_MapView mapview)
        {
            this.ToolType = type;

            this.Layer   = layer;
            this.MapView = mapview;
            if (layer != null)
            {// pan tool: layer==null
                this.Feature = new MG_Feature(this.Layer.GetFieldSet());
            }

            // empty point
            this.FromPoint  = Point.Empty;
            this.ToPoint    = Point.Empty;
            this.Point3     = Point.Empty;
            this.SelectRect = Rectangle.Empty;
        }
Esempio n. 15
0
        public static void RenderPolygon(Graphics g, Pen pen, MG_MapView mapview, MG_Polygon polygon)
        {
            int countLineString = polygon.Count();

            for (int i = 0; i < countLineString; i++)
            {
                MG_LineString lineString = polygon.GetAt(i);
                int           countPoint = lineString.Count();
                if (countPoint < 3)
                {
                    return;
                }
                Point[] points = new Point[countPoint];
                for (int j = 0; j < countPoint; j++)
                {
                    MG_Point mp = lineString.GetAt(j);
                    points[j] = AsPoint(mp, mapview);
                }
                //FillPolygon(g, brush, points);
                //Pen pen = new Pen(Color.Red, 1);
                DrawPolygon(g, pen, points);
            }
        }
Esempio n. 16
0
 public MG_ToolPan(MG_Map map, MG_MapView mapview)
     : base(MG_ToolType.Tool_Pan, null, mapview)
 {
     this.CurrentMap = map;
 }
Esempio n. 17
0
 public MG_ToolDrawPolygon(MG_Layer layer, MG_MapView mapview)
     : base(MG_ToolType.Tool_DrawPolygon, layer, mapview)
 {
     this.LineString = new MG_LineString();
     this.Polygon    = new MG_Polygon();
 }
Esempio n. 18
0
        protected bool IsStart = true; // start end

        public MG_ToolDrawRectangle(MG_Layer layer, MG_MapView mapview)
            : base(MG_ToolType.Tool_DrawRectangle, layer, mapview)
        {
        }
Esempio n. 19
0
        protected bool QuitEdit    = false; //if quit edit linestring

        public MG_ToolDrawDoubleLineString(MG_Layer layer, MG_MapView mapview)
            : base(MG_ToolType.Tool_DrawDoubleLineString, layer, mapview)
        {
            this.LineString      = new MG_LineString();
            this.LineStringOther = new MG_LineString();
        }
Esempio n. 20
0
 public MG_ToolDrawPoint(MG_Layer layer, MG_MapView mapview)
     : base(MG_ToolType.Tool_DrawPoint, layer, mapview)
 {
     this.MapPoint = new MG_Point();
 }