示例#1
0
 private GraphicsPath BuildLinePath(GeoXYLine line, GeoLineStyle lineStyle, Rectangle FormRectangle)
 {
     GraphicsPath path = new GraphicsPath();
     Point[] pts = this.FilterToPointArray(this.GetScreenPoints(line, new Point()).ToArray());
     Point[] points = null;
     if ((pts.Length <= 2) || this.IsAllPointsInRect(pts, FormRectangle))
     {
         points = pts;
     }
     else
     {
         Point[] pointArray = new Point[] { FormRectangle.Location, new Point(FormRectangle.Right, FormRectangle.Top), new Point(FormRectangle.Right, FormRectangle.Bottom), new Point(FormRectangle.Left, FormRectangle.Bottom) };
         Polygon polygon = this.BuildGpcPolygonFromPointArray(pointArray);
         if (pts.Length > 2)
         {
             Polygon polygon2 = this.BuildGpcPolygonFromPointArray(pts);
             points = GpcWrapper.Clip(GpcOperation.Intersection, polygon, polygon2).ToPointArray();
         }
     }
     if (points.Length > 1)
     {
         path.AddLines(points);
         this.m_WidenPen.Width = lineStyle.LineWidth + 6f;
         path.Widen(this.m_WidenPen);
     }
     return path;
 }
示例#2
0
 private void InitDrawingStyles()
 {
     this.m_FixedLineStyle = new GeoLineStyle();
     this.m_FixedLineStyle.Color = Color.Red;
     this.m_FixedLineStyle.LineWidth = 2f;
     this.m_MovingLineStyle = new GeoLineStyle();
     this.m_MovingLineStyle.Color = Color.Red;
     this.m_MovingLineStyle.LineWidth = 2f;
     this.m_MovingLineStyle.LineDashStyle = DashStyle.DashDot;
 }
示例#3
0
 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();
 }
示例#4
0
 private void InitDrawingStyles()
 {
     this.m_VetexPointStyle = new GeoPointStyle();
     this.m_VetexPointStyle.SymbolStyle = PointSymbolStyle.HollowSquare;
     this.m_VetexPointStyle.IconSize = new Size(6, 6);
     this.m_VetexPointStyle.Color = Color.DarkViolet;
     this.m_FixedLineStyle = new GeoLineStyle();
     this.m_FixedLineStyle.Color = Color.DarkViolet;
     this.m_FixedLineStyle.LineWidth = 2f;
     this.m_MovingLineStyle = new GeoLineStyle();
     this.m_MovingLineStyle.Color = Color.DarkViolet;
     this.m_MovingLineStyle.LineWidth = 2f;
     this.m_MovingLineStyle.LineDashStyle = DashStyle.DashDot;
 }
示例#5
0
 private GeoLineStyle BuildLineStyle(BrushStyle brStyle, PenStyle penStyle)
 {
     GeoLineStyle style = new GeoLineStyle();
     if (penStyle != null)
     {
         style.LineWidth = penStyle.PenWidth;
         style.Color = penStyle.PenColor;
         return style;
     }
     if (brStyle != null)
     {
         style.Color = brStyle.ForeColor;
     }
     return style;
 }
示例#6
0
 public static GeoLineStyle GenerateDefaultLineStyle()
 {
     GeoLineStyle style = new GeoLineStyle();
     style.LineWidth = 2f;
     style.LineDashStyle = DashStyle.Solid;
     style.Color = Color.DarkViolet;
     style.LabelFont = new Font("Arial", 9f);
     style.LabelColor = Color.Black;
     style.SelectedLabelColor = Color.MediumVioletRed;
     style.IsShowVertex = true;
     style.IsShowLabel = true;
     style.VertexSize = new Size(4, 4);
     style.VertexStyle = PointSymbolStyle.SolidSquare;
     style.VertexFillColor = Color.MediumVioletRed;
     style.VertexEdgeColor = Color.Transparent;
     style.VertexSelectedSize = new Size(6, 6);
     style.VertextSelectedStyle = PointSymbolStyle.HollowSquare;
     style.VertexSelectedFillColor = Color.White;
     style.VertexSelectedEdgeColor = Color.Blue;
     return style;
 }
示例#7
0
 public void AddLine(GeoXYLine line, GeoLineStyle lineStyle)
 {
     Dictionary<GeoXYLine, GeoLineStyle> lines = new Dictionary<GeoXYLine, GeoLineStyle>();
     lines.Add(line, lineStyle);
     this.AddLines(lines);
 }
示例#8
0
 public GeoDisplayLine(GeoXYLine line, GeoLineStyle style)
 {
     this.m_Line = line;
     base.m_Style = style;
     base.AddFeature("VectorStyle", style);
 }
示例#9
0
 private void GenerateDefaultStyle()
 {
     this.m_DefaultPointStyle = new GeoPointStyle();
     this.m_DefaultLineStyle = new GeoLineStyle();
     this.m_DefaultPolygonStyle = new GeoPolygonStyle();
 }
示例#10
0
 public bool Read()
 {
     if (string.IsNullOrEmpty(base.m_DataSource))
     {
         return false;
     }
     List<string> vectorLayerNameList = new List<string>();
     vectorLayerNameList.Add(this.m_VectorType);
     Dictionary<string, GeoLineStyle> dictionary = ColorArray<short>.GenerateVectorColor(vectorLayerNameList);
     if (this.m_DefaultLineStyle == null)
     {
         this.m_DefaultLineStyle = dictionary[this.m_VectorType];
     }
     FileStream fileStrm = null;
     try
     {
         fileStrm = new OpenFileAssist(base.m_DataSource).FileStrm;
     }
     catch (Exception)
     {
         return false;
     }
     StreamReader sr = new StreamReader(fileStrm, Encoding.Default);
     List<GeoXYLine> list2 = new List<GeoXYLine>();
     string[] delimiter = new string[] { " ", "\t" };
     try
     {
         this.AddVectorLines(sr, this.m_LineCollection, delimiter);
     }
     catch
     {
         throw new GeoVectorFileFormatErrorException();
     }
     finally
     {
         sr.Close();
     }
     return true;
 }