예제 #1
0
        /// <summary>
        /// 设置绘制过程中的线符号
        /// </summary>
        private void SetNewLineFeedBack()
        {
            m_pLineFeedback = new NewLineFeedback();
            IRgbColor pColor = new RgbColor();

            pColor.Red   = 0;
            pColor.Green = 0;
            pColor.Blue  = 0;

            m_LineSym       = new SimpleLineSymbol();
            m_LineSym.Color = pColor;
            m_LineSym.Width = 1;
            m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

            ISymbol pSym = m_LineSym as ISymbol;

            pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            m_pLineFeedback.Symbol = pSym;

            m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
            m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
            m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();

            m_pLineFeedback.Display = m_hookHelper.ActiveView.ScreenDisplay;
        }
예제 #2
0
        public RenderLayerLine(IFeatureLayer featureLayer, MainForm frm)
        {
            InitializeComponent();
            m_featureLayer = featureLayer;
            m_fraMain      = frm;

            //Get properties of the current symbol
            IGeoFeatureLayer geoFeatureLayer = featureLayer as IGeoFeatureLayer;
            IFeatureRenderer featureRenderer = geoFeatureLayer.Renderer;

            if (featureRenderer is ISimpleRenderer)
            {
                ISimpleRenderer   simpleRenderer   = geoFeatureLayer.Renderer as ISimpleRenderer;
                ISimpleLineSymbol simpleLineSymbol = simpleRenderer.Symbol as ISimpleLineSymbol;

                if (simpleLineSymbol != null)
                {
                    //Get the width of line
                    tbSize.Text = simpleLineSymbol.Width.ToString();

                    //Get the color of line
                    IRgbColor rgbColor = new RgbColorClass();
                    rgbColor     = simpleLineSymbol.Color as IRgbColor;
                    tbRed.Text   = rgbColor.Red.ToString();
                    tbGreen.Text = rgbColor.Green.ToString();
                    tbBlue.Text  = rgbColor.Blue.ToString();

                    //Change the value of track bar
                    tkbSize.Value = int.Parse(tbSize.Text);
                }
            }
        }
예제 #3
0
        private void method_7(IActiveView pView, IPoint point, IPoint point2)
        {
            IGraphicsContainer graphicsContainer = (IGraphicsContainer)pView;
            double             num = Math.Sqrt(Math.Pow(point2.X - point.X, 2.0) + Math.Pow(point2.Y - point.Y, 2.0));

            num = Math.Round(num, 3);
            IPoint point3 = new ESRI.ArcGIS.Geometry.Point();

            point3.X = (point.X + (point2.X - point.X) / 2.0);
            point3.Y = (point.Y + (point2.Y - point.Y) / 2.0);
            IElement textElement = this.GetTextElement(string.Concat(num), point3);

            graphicsContainer.AddElement(textElement, 0);
            IPolyline polyline = new Polyline() as IPolyline;

            polyline.FromPoint = (point);
            polyline.ToPoint   = (point2);
            ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol();
            ISimpleLineSymbol arg_FF_0         = simpleLineSymbol;
            IRgbColor         rgbColorClass    = new RgbColor();

            rgbColorClass.Red      = (255);
            rgbColorClass.Green    = (0);
            rgbColorClass.Blue     = (0);
            arg_FF_0.Color         = (rgbColorClass);
            simpleLineSymbol.Width = (8.0);
            simpleLineSymbol.Style = (esriSimpleLineStyle)(2);
            IGraphicsContainer arg_130_0        = graphicsContainer;
            ILineElement       lineElementClass = new LineElement() as ILineElement;

            ((IElement)lineElementClass).Geometry = (polyline);
            arg_130_0.AddElement(lineElementClass as IElement, 0);
        }
예제 #4
0
        private void addCenterLine()
        {
            CSpatialSubs       oSpatialSubs = new CSpatialSubs();
            ISimpleLineSymbol  pLineSym     = null;
            IMxDocument        pMxDoc       = (IMxDocument)ArcMap.Document;
            IGraphicsContainer pGC          = (IGraphicsContainer)pMxDoc.PageLayout;

            try
            {
                pLineSym = (ISimpleLineSymbol)oSpatialSubs.createSimpleLineSymbol(oSpatialSubs.createRGB(0, 0, 0), (1 * base.XFactor), esriSimpleLineStyle.esriSLSSolid);
                oSpatialSubs.addLineToGraphicsContainer(pGC,
                                                        pLineSym,
                                                        SPrintConst.LeftLine_X * base.XFactor,
                                                        SPrintConst.Neatline_XMax * base.XFactor,
                                                        SPrintConst.CenterLine_Y * base.YFactor,
                                                        SPrintConst.CenterLine_Y * base.YFactor);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Errors: CPortraitLayout:addCenterLine()\r\n" + ex.Message, "Errors occurred", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
            finally
            {
                oSpatialSubs.Dispose();
                pLineSym = null;
                pMxDoc   = null;
                pGC      = null;
            }
        }
예제 #5
0
        //鼠标在Map的事件
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            IPoint pPt = m_ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);

            if (m_NewLineFeedBack == null)
            {
                m_NewLineFeedBack = new NewLineFeedbackClass();

                ISimpleLineSymbol pSimLineSymbol = null;
                IRgbColor         pRGBColor      = null;

                pSimLineSymbol            = m_NewLineFeedBack.Symbol as ISimpleLineSymbol;
                pRGBColor                 = new RgbColorClass();
                pRGBColor.Red             = 255;
                pRGBColor.Blue            = 0;
                pRGBColor.Green           = 0;
                pSimLineSymbol.Color      = pRGBColor as IColor;
                pSimLineSymbol.Style      = esriSimpleLineStyle.esriSLSSolid;
                m_NewLineFeedBack.Display = m_ScreenDisplay;
                m_NewLineFeedBack.Start(pPt);
            }
            else
            {
                m_NewLineFeedBack.AddPoint(pPt);
            }
        }
예제 #6
0
        /// <summary>
        /// 绘制圆弧
        /// </summary>
        /// <param name="pCircleArc"></param>
        private void DrawArc(ICircularArc pCircleArc)
        {
            if (pCircleArc == null)
            {
                return;
            }

            ISegmentCollection pSegColl;
            IPolyline          pPolyline;

            pSegColl = new PolylineClass();
            pSegColl.AddSegment(pCircleArc as ISegment);
            pPolyline = pSegColl as IPolyline;

            IRgbColor pColor = new RgbColor();

            pColor.Red   = 0;
            pColor.Green = 0;
            pColor.Blue  = 0;

            m_LineSym       = new SimpleLineSymbol();
            m_LineSym.Color = pColor;
            m_LineSym.Width = 1;
            m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

            ISymbol pSym = m_LineSym as ISymbol;

            pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            m_pLineFeedback.Symbol = pSym;

            m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
            m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
            m_hookHelper.ActiveView.ScreenDisplay.DrawPolyline(pPolyline);
            m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();
        }
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button != 1)
            {
                return;
            }

            IPoint pPnt = m_MapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);

            if (m_pNewLineFeedback == null) //第一次按下
            {
                m_pNewLineFeedback = new NewLineFeedbackClass();

                IRgbColor         pRGB    = new RgbColorClass();
                ISimpleLineSymbol pSLnSym = m_pNewLineFeedback.Symbol as ISimpleLineSymbol;
                pRGB.Red   = 255;
                pRGB.Blue  = 0;
                pRGB.Green = 0;

                pSLnSym.Color = pRGB;
                pSLnSym.Style = esriSimpleLineStyle.esriSLSSolid;
                m_pNewLineFeedback.Display = m_MapControl.ActiveView.ScreenDisplay;
                m_pNewLineFeedback.Start(pPnt);
                if (m_frmBufferSet != null)
                {
                    SysCommon.ScreenDraw.list.Remove(m_frmBufferSet.BufferSetAfterDraw);
                    m_frmBufferSet.setBufferGeometry(null);
                    m_frmBufferSet = null;
                }
            }
            else                    //将点加入到工具中去
            {
                m_pNewLineFeedback.AddPoint(pPnt);
            }
        }
예제 #8
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_graphicsLayer">图层</param>
        /// <parparam name="polygonKml">面的kml</parparam>
        public Polygon_ArcGlobe(IGlobeGraphicsLayer _graphicsLayer, KmlPolygon polygonKml)
        {
            this.graphicsLayer = _graphicsLayer;

            this.ElementType = ElementTypeEnum.Polygon;           //图元类型
            this.Description = polygonKml.Description;            //图元描述

            #region  符号

            simpleFillSymbol = new SimpleFillSymbolClass();
            simpleLineSymbol = new SimpleLineSymbolClass();

            IRgbColor fillColor = new RgbColorClass();
            fillColor.Transparency = polygonKml.FillColor.A;
            fillColor.Red          = polygonKml.FillColor.R;
            fillColor.Green        = polygonKml.FillColor.G;
            fillColor.Blue         = polygonKml.FillColor.B;
            this.opacity           = polygonKml.FillColor.A;

            IRgbColor outlineColor = new RgbColorClass();
            outlineColor.Transparency = polygonKml.OutLineColor.A;
            outlineColor.Red          = polygonKml.OutLineColor.R;
            outlineColor.Green        = polygonKml.OutLineColor.G;
            outlineColor.Blue         = polygonKml.OutLineColor.B;

            simpleLineSymbol.Color   = outlineColor;
            simpleLineSymbol.Width   = polygonKml.OutLineSize;
            simpleFillSymbol.Color   = fillColor;
            simpleFillSymbol.Outline = simpleLineSymbol;

            this.fillColor    = polygonKml.FillColor;
            this.outlineColor = polygonKml.OutLineColor;
            this.outLineSize  = polygonKml.OutLineSize;

            #endregion

            #region  位置

            IGeometry        geometry        = new PolygonClass();
            IPointCollection pointCollection = geometry as IPointCollection;
            IPoint           point           = new PointClass();
            foreach (var item in polygonKml.PositionList)
            {
                point.PutCoords(item.Lng, item.Lat);
                point.Z = item.Alt;
                pointCollection.AddPoint(point);
            }

            (pointCollection as IZAware).ZAware = true;

            #endregion

            base.Geometry = pointCollection as IGeometry;           //指定位置
            base.Symbol   = simpleFillSymbol;                       //指定符号

            flashTimer          = new System.Timers.Timer();
            flashTimer.Elapsed += new System.Timers.ElapsedEventHandler(flashTimer_Elapsed);
            flashTimer.Interval = 500;
        }
예제 #9
0
 /// <summary>
 /// 获取简单填充符号样式 内部填充透明
 /// </summary>
 /// <param name="lineSymbol">边框样式</param>
 /// <returns>返回简单填充符号样式对象</returns>
 private static ISimpleFillSymbol getFillSymbol(ISimpleLineSymbol lineSymbol = null)
 {
     return(new SimpleFillSymbolClass()
     {
         Color = getFillRGB(),
         Outline = lineSymbol
     });
 }
예제 #10
0
 public RailwayBrush()
 {
     _outlineSymbol               = new SimpleLineSymbol(Color.FromArgb(64, 64, 64), _width);
     _fillSymbolBlack             = new SimpleLineSymbol(Color.Black, _width - 0.8f);
     _fillSymbolWhite             = new SimpleLineSymbol(Color.White, _width - 0.8f);
     _fillSymbolWhite.DashStyle   = DashStyle.DashDot;
     _fillSymbolWhite.DashPattern = new float[] { 10, 10 };
 }
예제 #11
0
 public static IFillSymbol CreateFillSymbol(Color fillColor, esriSimpleFillStyle eFillStyle, ISimpleLineSymbol aOutline)
 {
     SimpleFillSymbolClass class2 = new SimpleFillSymbolClass();
     class2.Style = eFillStyle;
     class2.Color = ColorHelper.CreateColor(fillColor);
     class2.Outline = aOutline;
     return class2;
 }
예제 #12
0
        public static IFillSymbol CreateTransparentFillSymbol(ISimpleLineSymbol aOutline)
        {
            SimpleFillSymbolClass class2 = new SimpleFillSymbolClass();

            class2.Style   = esriSimpleFillStyle.esriSFSNull;
            class2.Outline = aOutline;
            return(class2);
        }
예제 #13
0
        public void SymbolInit()
        {
            IRgbColor pFcolor     = new RgbColorClass();
            IRgbColor pOcolor     = new RgbColorClass();
            IRgbColor pTrackcolor = new RgbColorClass();
            IRgbColor pVcolor     = new RgbColorClass();

            pFcolor.Red   = 255;
            pFcolor.Green = 0;
            pFcolor.Blue  = 0;

            pOcolor.Red   = 0;
            pOcolor.Green = 0;
            pOcolor.Blue  = 255;

            pTrackcolor.Red   = 0;
            pTrackcolor.Green = 255;
            pTrackcolor.Blue  = 255;

            pVcolor.Red   = 0;
            pVcolor.Green = 255;
            pVcolor.Blue  = 0;

            m_MarkerSym              = new SimpleMarkerSymbolClass();
            m_MarkerSym.Style        = esriSimpleMarkerStyle.esriSMSCircle;
            m_MarkerSym.Color        = pFcolor;
            m_MarkerSym.Outline      = true;
            m_MarkerSym.OutlineColor = pOcolor;
            m_MarkerSym.OutlineSize  = ScaleChange(1, m_pMap);

            m_VertexSym       = new SimpleMarkerSymbolClass();
            m_VertexSym.Style = esriSimpleMarkerStyle.esriSMSSquare;
            m_VertexSym.Color = pVcolor;
            m_VertexSym.Size  = ScaleChange(4, m_pMap);

            m_EndPointSym       = new SimpleMarkerSymbolClass();
            m_EndPointSym.Style = esriSimpleMarkerStyle.esriSMSSquare;
            m_EndPointSym.Color = pFcolor;
            m_EndPointSym.Size  = ScaleChange(4, m_pMap);

            m_LineSym       = new SimpleLineSymbolClass();
            m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;
            m_LineSym.Color = pFcolor;
            m_LineSym.Width = ScaleChange(1, m_pMap);

            m_TracklineSym       = new SimpleLineSymbolClass();
            m_TracklineSym.Color = pTrackcolor;
            m_TracklineSym.Width = ScaleChange(1, m_pMap);

            m_Osym       = new SimpleLineSymbolClass();
            m_Osym.Color = pOcolor;
            m_Osym.Width = ScaleChange(1, m_pMap);

            m_FillSym         = new SimpleFillSymbolClass();
            m_FillSym.Color   = pFcolor;
            m_FillSym.Style   = esriSimpleFillStyle.esriSFSVertical;
            m_FillSym.Outline = m_Osym;
        }
예제 #14
0
        internal static ISymbol getFeedBackLineSymbol(INewLineFeedback lfb)
        {
            ISimpleLineSymbol sym = lfb.Symbol as ISimpleLineSymbol;

            sym.Color = getColorSetting(Names.LineFeedbackColor);
            sym.Style = esriSimpleLineStyle.esriSLSSolid;
            sym.Width = 2.0d;
            return((ISymbol)sym);
        }
예제 #15
0
 public RailwayBrush(float width, ISimpleLineSymbol sym1, ISimpleLineSymbol sym2, ISimpleLineSymbol sym3)
 {
     _width                       = width;
     _outlineSymbol               = sym3;
     _fillSymbolBlack             = sym1;
     _fillSymbolWhite             = sym2;
     _fillSymbolWhite.DashStyle   = DashStyle.DashDot;
     _fillSymbolWhite.DashPattern = new float[] { 10, 10 };
 }
예제 #16
0
        public override void OnCreate(object hook)
        {
            _context        = hook as IAppContext;
            base.m_caption  = "距离量测";
            base.m_category = "View";
            base.m_bitmap   = Properties.Resources.icon_measure_distance;
            base.m_cursor   =
                new Cursor(base.GetType().Assembly.GetManifestResourceStream("Yutai.Resource.Cursor.Measure.cur"));
            base.m_name    = "View_MeasureLength";
            base._key      = "View_MeasureLength";
            base.m_toolTip = "距离量测";
            base.m_checked = false;
            base.m_enabled = true;
            base._itemType = RibbonItemType.Tool;

            IRgbColor pRgb = new RgbColor() as IRgbColor;

            pRgb.Red   = 200;
            pRgb.Green = 0;
            pRgb.Blue  = 0;

            pSimpleLineSymbol = new SimpleLineSymbolClass()
            {
                Color = pRgb, Width = 1.5, Style = esriSimpleLineStyle.esriSLSSolid
            };
            IRgbColor pRgb2 = new RgbColor() as IRgbColor;

            pRgb2.Red    = 255;
            pRgb2.Green  = 0;
            pRgb2.Blue   = 0;
            pAngleSymbol = new TextSymbolClass()
            {
                Color = pRgb2,
                Size  = 10
            };
            ITextPath         textPath       = new SimpleTextPathClass();
            ISimpleTextSymbol simpleTextPath = (ISimpleTextSymbol)pAngleSymbol;

            simpleTextPath.TextPath            = textPath;
            simpleTextPath.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
            simpleTextPath.VerticalAlignment   = esriTextVerticalAlignment.esriTVABaseline;
            simpleTextPath.YOffset             = 3;

            pDistSymbol = new TextSymbolClass()
            {
                Color = pRgb2,
                Size  = 10
            };
            ITextPath textPath2 = new SimpleTextPathClass();

            simpleTextPath                     = (ISimpleTextSymbol)pDistSymbol;
            simpleTextPath.TextPath            = textPath;
            simpleTextPath.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
            simpleTextPath.VerticalAlignment   = esriTextVerticalAlignment.esriTVATop;
            simpleTextPath.YOffset             = -3;
        }
예제 #17
0
        public static IFillSymbol CreateFillSymbol(Color fillColor, esriSimpleFillStyle eFillStyle,
                                                   ISimpleLineSymbol aOutline)
        {
            SimpleFillSymbol class2 = new SimpleFillSymbol();

            class2.Style   = eFillStyle;
            class2.Color   = ColorHelper.CreateColor(fillColor);
            class2.Outline = aOutline;
            return(class2);
        }
예제 #18
0
        public static ISymbol GenerateLayerSymbol(LayerDef layerDef,
                                                  GeometryType geometryType)
        {
            if (layerDef == null)
            {
                return(GetDefaultSymbol(geometryType));
            }

            if (layerDef.GeometryType == GeometryType.Point ||
                layerDef.GeometryType == GeometryType.Multipoint)
            {
                ISimpleLineSymbol outline =
                    Runtime.graphicEngine.newSimpleLineSymbol();
                outline.Color = layerDef.OutlineColor;
                outline.Style = layerDef.LineStyle;
                outline.Width = layerDef.LineWidth;

                ISimpleMarkerSymbol symbol =
                    Runtime.graphicEngine.newSimpleMarkerSymbol();
                symbol.Color   = layerDef.Color;
                symbol.Size    = layerDef.MarkerSize;
                symbol.Style   = layerDef.MarkerStyle;
                symbol.Outline = outline;

                return(symbol);
            }
            else if (layerDef.GeometryType == GeometryType.Polyline)
            {
                ISimpleLineSymbol symbol =
                    Runtime.graphicEngine.newSimpleLineSymbol();
                symbol.Color = layerDef.Color;
                symbol.Style = layerDef.LineStyle;
                symbol.Width = layerDef.LineWidth;

                return(symbol);
            }
            else if (layerDef.GeometryType == GeometryType.Polygon)
            {
                ISimpleLineSymbol outline =
                    Runtime.graphicEngine.newSimpleLineSymbol();
                outline.Color = layerDef.OutlineColor;
                outline.Style = layerDef.LineStyle;
                outline.Width = layerDef.LineWidth;

                ISimpleFillSymbol symbol =
                    Runtime.graphicEngine.newSimpleFillSymbol();
                symbol.Color   = layerDef.Color;
                symbol.Style   = layerDef.FillStyle;
                symbol.Outline = outline;

                return(symbol);
            }

            return(null);
        }
예제 #19
0
        // Get the default fill symbol - light cyan fill
        public static ISimpleFillSymbol GetDefaultFillSymbol()
        {
            ISimpleLineSymbol lineSymbol = GetDefaultLineSymbol();

            if (_defaultFillSymbol == null)
            {
                _defaultFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol(
                    Colors.LightCyan, SimpleFillStyle.Solid, lineSymbol);
            }
            return(_defaultFillSymbol);
        }
예제 #20
0
 // Get the default line symbol - dark gray and solid line with 1.0 width.
 public static ISimpleLineSymbol GetDefaultLineSymbol()
 {
     if (_defaultLineSymbol == null)
     {
         _defaultLineSymbol = 
             Runtime.graphicEngine.newSimpleLineSymbol(
             Colors.DarkGray,
             Core.Graphics.SimpleLineStyle.Solid, 1.0);
     }
     return _defaultLineSymbol;
 }
예제 #21
0
 // Get the default drawing line symbol - blue and solid line with 3.0 width.
 public static ISimpleLineSymbol GetDefaultDrawingLineSymbol()
 {
     if (_defaultDrawingLineSymbol == null)
     {
         _defaultDrawingLineSymbol =
             Runtime.graphicEngine.newSimpleLineSymbol(
                 Colors.Blue,
                 Core.Graphics.SimpleLineStyle.Solid, 3.0);
     }
     return(_defaultDrawingLineSymbol);
 }
예제 #22
0
 // Get the default line symbol - dark gray and solid line with 1.0 width.
 public static ISimpleLineSymbol GetDefaultLineSymbol()
 {
     if (_defaultLineSymbol == null)
     {
         _defaultLineSymbol =
             Runtime.graphicEngine.newSimpleLineSymbol(
                 Colors.DarkGray,
                 Core.Graphics.SimpleLineStyle.Solid, 1.0);
     }
     return(_defaultLineSymbol);
 }
예제 #23
0
        private static void SymbolInit()
        {
            //设置各种地图符号的颜色
            IRgbColor pFcolor;
            IRgbColor pOcolor;
            IRgbColor pTrackcolor;
            IRgbColor pVcolor;
            IRgbColor pSColor;

            pFcolor     = new RgbColor();
            pOcolor     = new RgbColor();
            pTrackcolor = new RgbColor();
            pVcolor     = new RgbColor();
            pSColor     = new RgbColor();
            pFcolor     = MapManager.GetRgbColor(255, 0, 0);
            pOcolor     = MapManager.GetRgbColor(0, 0, 255);
            pTrackcolor = MapManager.GetRgbColor(0, 255, 255);
            pVcolor     = MapManager.GetRgbColor(0, 255, 0);
            pSColor     = MapManager.GetRgbColor(0, 0, 0);
            //设置各种地图符号的属性
            m_markerSym              = new SimpleMarkerSymbol();
            m_markerSym.Style        = esriSimpleMarkerStyle.esriSMSCircle;
            m_markerSym.Color        = pFcolor;
            m_markerSym.Outline      = true;
            m_markerSym.OutlineColor = pOcolor;
            m_markerSym.OutlineSize  = 1;
            m_vertexSym              = new SimpleMarkerSymbol();
            m_vertexSym.Style        = esriSimpleMarkerStyle.esriSMSSquare;
            m_vertexSym.Color        = pVcolor;
            m_vertexSym.Size         = 4;
            m_selPointSym            = new SimpleMarkerSymbol();
            m_selPointSym.Style      = esriSimpleMarkerStyle.esriSMSSquare;
            m_selPointSym.Color      = pSColor;
            m_selPointSym.Size       = 4;
            m_endPointSym            = new SimpleMarkerSymbol();
            m_endPointSym.Style      = esriSimpleMarkerStyle.esriSMSSquare;
            m_endPointSym.Color      = pFcolor;
            m_endPointSym.Size       = 4;
            m_lineSym            = new SimpleLineSymbol();
            m_lineSym.Color      = pFcolor;
            m_lineSym.Width      = 1;
            m_tracklineSym       = new SimpleLineSymbol();
            m_tracklineSym.Color = pTrackcolor;
            m_tracklineSym.Width = 1;
            ISimpleLineSymbol pOsym = default(ISimpleLineSymbol);

            pOsym             = new SimpleLineSymbol();
            pOsym.Color       = pOcolor;
            pOsym.Width       = 1;
            m_fillSym         = new SimpleFillSymbol();
            m_fillSym.Color   = pFcolor;
            m_fillSym.Style   = esriSimpleFillStyle.esriSFSVertical;
            m_fillSym.Outline = pOsym;
        }
예제 #24
0
        //根据评估等级获取样式
        ISymbol GetSymbol(int grade)
        {
            ISimpleLineSymbol linesymbol = Runtime.graphicEngine.newSimpleLineSymbol(
                Colors.Black, SimpleLineStyle.Solid, 1.0);
            Color color = Colors.Green;

            if (grade == 1)
            {
                color = Colors.Red;
            }
            return(Runtime.graphicEngine.newSimpleFillSymbol(color, SimpleFillStyle.Solid, linesymbol));
        }
        public ISimpleFillSymbol newSimpleFillSymbol(Color color,
                                                     iS3.Core.Graphics.SimpleFillStyle style,
                                                     ISimpleLineSymbol outline)
        {
            IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();

            symbol.Color   = color;
            symbol.Outline = outline as IS3SimpleLineSymbol;
            symbol.Style   = style;

            return(symbol);
        }
        private ISymbol GetSymbolByColor(Color color)
        {
            ISymbol sym = null;

            color = Color.FromArgb((byte)(255 - 255 * ((float)txtTranspert.Value / 100f)), color.R, color.G, color.B);
            IFeatureClass fetclass = _layer.Class as IFeatureClass;

            switch (fetclass.ShapeType)
            {
            case enumShapeType.Point:
                sym = new SimpleMarkerSymbol();
                break;

            case enumShapeType.Polyline:
                sym = new SimpleLineSymbol();
                ISimpleLineSymbol lineSym = sym as ISimpleLineSymbol;
                if (_publicSybmobl != null)
                {
                    ISimpleLineSymbol publicSym = _publicSybmobl as ISimpleLineSymbol;
                    lineSym.DashStyle    = publicSym.DashStyle;
                    lineSym.LineJoin     = publicSym.LineJoin;
                    lineSym.StartLineCap = publicSym.StartLineCap;
                    lineSym.EndLineCap   = publicSym.EndLineCap;
                    if (publicSym.DashPattern != null)
                    {
                        lineSym.DashPattern = publicSym.DashPattern.Clone() as float[];
                    }
                    lineSym.Width = publicSym.Width;
                }
                break;

            case enumShapeType.Polygon:
                if (_publicSybmobl != null)
                {
                    sym = new SimpleFillSymbol(Color.Yellow, new SimpleLineSymbol((_publicSybmobl as IFillSymbol).OutlineSymbol.Color, (_publicSybmobl as IFillSymbol).OutlineSymbol.Width));
                }
                else
                {
                    sym = new SimpleFillSymbol();
                }
                break;

            default:
                sym = null;
                break;
            }
            if (sym != null)
            {
                sym.Color = color;
            }
            return(sym);
        }
예제 #27
0
        public static RailwayBrush FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            float             width = float.Parse(ele.Attribute("width").Value);
            ISimpleLineSymbol sym1  = PersistObject.ReflectObjFromXElement(ele.Element("FillSymbol1").Element("Symbol")) as ISimpleLineSymbol;
            ISimpleLineSymbol sym2  = PersistObject.ReflectObjFromXElement(ele.Element("FillSymbol2").Element("Symbol")) as ISimpleLineSymbol;
            ISimpleLineSymbol sym3  = PersistObject.ReflectObjFromXElement(ele.Element("OutlineSymbol").Element("Symbol")) as ISimpleLineSymbol;

            return(new RailwayBrush(width, sym1, sym2, sym3));
        }
예제 #28
0
        // Get the default mark symbol - blue dot mark with 12 pixels.
        public static ISimpleMarkerSymbol GetDefaultMarkSymbol()
        {
            ISimpleLineSymbol lineSymbol = GetDefaultLineSymbol();

            if (_defaultMarkSymbol == null)
            {
                _defaultMarkSymbol =
                    Runtime.graphicEngine.newSimpleMarkerSymbol(
                        Colors.Blue, 0, MarkerAngleAlignment.Screen, 12.0,
                        SimpleMarkerStyle.Circle, lineSymbol, 0, 0);
            }
            return(_defaultMarkSymbol);
        }
예제 #29
0
        private void Class_Initialize()
        {
            INewLineFeedback pNewLineFeedback;

            bBegineMove        = false;
            m_pOffsetTraceLine = new PolygonClass();
            pNewLineFeedback   = new NewLineFeedbackClass();
            m_pSymbol          = (ISimpleLineSymbol)pNewLineFeedback.Symbol;
            m_pGraph           = new SegmentGraphClass();

            //获得状态栏的服务
            //m_pStatusBarService = (IStatusBarService)ServiceManager.Services.GetService(typeof(WSGRI.DigitalFactory.Services.UltraStatusBarService));
        }
예제 #30
0
        public static bool RenderSimply(ILayer player, IColor pcolor)
        {
            ISymbol          psymbol       = GetSymbolFromLayer(player);
            IFeatureLayer    pfeaturelayer = player as IFeatureLayer;
            IFeatureClass    pfeatureclass = pfeaturelayer.FeatureClass;
            esriGeometryType geotype       = pfeatureclass.ShapeType;

            switch (geotype)
            {
            case esriGeometryType.esriGeometryPoint:
            {
                IMarkerSymbol pmarksymbol = psymbol as IMarkerSymbol;
                pmarksymbol.Color = pcolor;
                break;
            }

            case esriGeometryType.esriGeometryMultipoint:
            {
                IMarkerSymbol pmarksymbol = psymbol as IMarkerSymbol;
                pmarksymbol.Color = pcolor;
                break;
            }

            case esriGeometryType.esriGeometryPolyline:
            {
                ISimpleLineSymbol psimplelinesymbol = psymbol as ISimpleLineSymbol;
                psimplelinesymbol.Color = pcolor;
                break;
            }

            case esriGeometryType.esriGeometryPolygon:
            {
                IFillSymbol pfillsymbol = psymbol as IFillSymbol;
                pfillsymbol.Color = pcolor;
                break;
            }

            default: return(false);
            }

            ISimpleRenderer psimolerenderer = new SimpleRenderer();

            psimolerenderer.Symbol = psymbol;
            IFeatureRenderer pfeaturerender = psimolerenderer as IFeatureRenderer;

            IGeoFeatureLayer pgeofeaturelayer = pfeaturelayer as IGeoFeatureLayer;

            pgeofeaturelayer.Renderer = pfeaturerender;
            return(true);
        }
예제 #31
0
        public static bool RenderSimply(ILayer layer, IColor color)
        {
            IFeatureLayer    featureLayer = (IFeatureLayer)layer;
            esriGeometryType geotype      = featureLayer.FeatureClass.ShapeType;
            ISymbol          symbol       = GetSymbolFromLayer(layer);

            switch (geotype)
            {
            case esriGeometryType.esriGeometryPoint: {
                IMarkerSymbol markerSymbol = symbol as IMarkerSymbol;
                markerSymbol.Color = color;
                break;
            }

            case esriGeometryType.esriGeometryMultipoint: {
                IMarkerSymbol markerSymbol = symbol as IMarkerSymbol;
                markerSymbol.Color = color;
                break;
            }

            case esriGeometryType.esriGeometryPolyline: {
                ISimpleLineSymbol simpleLineSymbol = symbol as ISimpleLineSymbol;
                simpleLineSymbol.Color = color;
                break;
            }

            case esriGeometryType.esriGeometryPolygon: {
                IFillSymbol fillSymbol = symbol as IFillSymbol;
                fillSymbol.Color = color;
                break;
            }

            default:
                return(false);
            }

            ISimpleRenderer simpleRenderer = new SimpleRendererClass();

            simpleRenderer.Symbol = symbol;
            IFeatureRenderer featureRender = simpleRenderer as IFeatureRenderer;

            if (featureRender == null)
            {
                return(false);
            }
            IGeoFeatureLayer geoFeatureLayer = featureLayer as IGeoFeatureLayer;

            geoFeatureLayer.Renderer = featureRender;
            return(true);
        }
예제 #32
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            m_application = hook as IApplication;

            //Set up
            m_geomEnv = new GeometryEnvironmentClass();

            m_feedbackSymbol = new SimpleLineSymbolClass();
            ((ISymbol)m_feedbackSymbol).ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            IRgbColor solidColor = new RgbColorClass();

            solidColor.Red         = 255;
            m_feedbackSymbol.Color = solidColor;
            m_feedbackSymbol.Width = 2;
        }
    protected override void OnMouseDown(MouseEventArgs Args)
    {
      //initialize all the variables.
      feedbackEnv = new EnvelopeClass();
      feedbackStartPoint = new ESRI.ArcGIS.Geometry.PointClass();
      feedbackMovePoint = new ESRI.ArcGIS.Geometry.PointClass();
      feedbackLineSymbol = new SimpleLineSymbolClass();
      feedbackScreenDisplay = ArcMap.Document.ActiveView.ScreenDisplay;

      feedbackLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;

      //initialize a new Envelope feedback class and pass it the symbol and display
      NewEnvelopeFeedback = new NewEnvelopeFeedbackClass();
      NewEnvelopeFeedback.Display = feedbackScreenDisplay;
      NewEnvelopeFeedback.Symbol = feedbackLineSymbol as ISymbol;


      //pass the start point from the mouse position, transforming it to an appropriate map point.
      feedbackStartPoint = feedbackScreenDisplay.DisplayTransformation.ToMapPoint(Args.X, Args.Y) as ESRI.ArcGIS.Geometry.Point;
      NewEnvelopeFeedback.Start(feedbackStartPoint);
    }
예제 #34
0
        private void DrawArc(IEllipticArc pEllipArc)
        {
            if (pEllipArc == null) return;

            try
            {
                ISegmentCollection pSegColl;
                IPolyline pPolyline;
                pSegColl = new PolylineClass();
                pSegColl.AddSegment(pEllipArc as ISegment);
                pPolyline = pSegColl as IPolyline;

                IRgbColor pColor = new RgbColor();
                pColor.Red = 0;
                pColor.Green = 0;
                pColor.Blue = 0;

                m_LineSym = new SimpleLineSymbol();
                m_LineSym.Color = pColor;
                m_LineSym.Width = 1;
                m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

                ISymbol pSym = m_LineSym as ISymbol;
                pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
                m_pEnvFeedback.Symbol = pSym;

                m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
                m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
                m_hookHelper.ActiveView.ScreenDisplay.DrawPolyline(pPolyline);
                m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();
            }
            catch (Exception)
            {
                return;
            }
        }
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            m_application = hook as IApplication;

            //Set up
            m_geomEnv = new GeometryEnvironmentClass();

            m_feedbackSymbol = new SimpleLineSymbolClass();
            ((ISymbol)m_feedbackSymbol).ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            IRgbColor solidColor = new RgbColorClass();
            solidColor.Red = 255;
            m_feedbackSymbol.Color = solidColor;
            m_feedbackSymbol.Width = 2;
        }
예제 #36
0
        //���ƣȣ��ԣã�
        public static void HatchDraw(AxMapControl ppAxMapControl, ISimpleLineSymbol pHatchSymMajor, ISimpleLineSymbol pHatchSymMinor, ITextSymbol pTxtSym, IFeatureLayer pFeatLayer, bool bEnds, bool bEndsOnly, double dHatchLen, double dTxtInterval, double dHatchOffset, double dMajorAngle, bool bOverRideMajor, string graphicslayername)
        {
            //����ͼ��ͼ��ΪSEWER TV���ͼ��
            IFeatureCursor pFeatCursor = pFeatLayer.Search(null, true);
            SetGraphicsLayer(ppAxMapControl, pFeatLayer.Name, graphicslayername);
            //����SEWER TV���ͼ��ͼ��
            IGraphicsContainer pGraphicsContainer = ppAxMapControl.ActiveView.FocusMap.ActiveGraphicsLayer as IGraphicsContainer;
            //���ͼ��ͼ��
            pGraphicsContainer.DeleteAllElements();

            IFeature pFeature = pFeatCursor.NextFeature();
            IPolyline pMajorHatchPL = new PolylineClass();
            IPolyline pMinorHatchPL = new PolylineClass();
            IPolyline pPL;
            IMAware pPLM;
            //IMCollection pMColl;
            IGeometryCollection pGeomColl;
            ILineElement pLineElement;
            IElement pElement = null;
            int cnt;
            IPath pPath;
            string txt;
            double txtlen;
            IPath pTxtPath;
            double angle;
            //IPoint pTxtPt;
            ISegmentCollection pSC;
            ISegment pSeg;
            ISegmentM pSegM;
            double m1 = 0;
            //double m2 = 0;
            //IPoint pFromPt;
            //IMarkerSymbol pMSym;
            IMask pMask;
            ITextElement pTextElement;
            ISegmentCollection pSegment;
            ISegmentCollection pPolyline;
            while (pFeature != null)
            {
                pPL = pFeature.Shape as IPolyline;
                pPLM = pPL as IMAware;
                if (pPLM.MAware)
                {
                    if (bEndsOnly)
                    {
                        MakeHatchesEndsOnly(pPL, bEnds, pMajorHatchPL, pMinorHatchPL, dHatchLen, dTxtInterval, dHatchOffset);
                    }
                    else
                    {

                    }
                    // Draw the major hatches if they are lines
                    if (pHatchSymMajor is ILineSymbol)
                    {
                        pLineElement = new LineElementClass();
                        pLineElement.Symbol = pHatchSymMajor;
                        pElement = pLineElement as IElement;
                        pElement.Geometry = pMajorHatchPL as IGeometry;
                        pGraphicsContainer.AddElement(pElement, 0);
                    }
                    // Draw the major hatches if they are markers and the text...
                    pGeomColl = pMajorHatchPL as IGeometryCollection;
                    cnt = pGeomColl.GeometryCount - 1;
                    for (int j = 0; j <= cnt; j++)
                    {
                        pPath = pGeomColl.get_Geometry(j) as IPath;
                        if (bOverRideMajor)
                            angle = dMajorAngle;
                        else
                            angle = GetAngle(pPath) + dMajorAngle;
                        pSC = pPath as ISegmentCollection;
                        pSeg = pSC.get_Segment(0);
                        pSegM = pSeg as ISegmentM;
                        txt = Convert.ToString(Math.Round(m1, 1));
                        txtlen = pTxtSym.Size;
                        angle = GetAngle(pPath as ICurve);
                        if (ShouldFlip(angle))
                        {
                            pTxtPath = MakeTextPath(pPath, txtlen * 2);
                            angle += 180;
                            pTxtSym.RightToLeft = false;
                            pTxtSym.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
                            pTxtSym.VerticalAlignment = esriTextVerticalAlignment.esriTVACenter;

                        }
                        else
                        {
                            //angle = angle;
                            pTxtPath = MakeTextPath(pPath, txtlen);
                            pTxtSym.RightToLeft = false;
                            pTxtSym.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
                            pTxtSym.VerticalAlignment = esriTextVerticalAlignment.esriTVACenter;
                        }
                        pTxtSym.Angle = angle;
                        //Ϊ�ı�����MASK�����û�з��ţ�����Ϊ����
                        pMask = pTxtSym as IMask;
                        pMask.MaskSize = 2;
                        pMask.MaskStyle = esriMaskStyle.esriMSHalo;

                        pTextElement = new TextElementClass();
                        pTextElement.Symbol = pTxtSym;
                        pTextElement.Text = txt + " ";
                        pElement = pTextElement as IElement;

                        pSegment = pTxtPath as ISegmentCollection;
                        pPolyline = new PolylineClass();
                        pPolyline.AddSegmentCollection(pSegment);
                        pElement.Geometry = pPolyline as IGeometry;
                        pGraphicsContainer.AddElement(pElement, 0);
                    }
                }
                pFeature = pFeatCursor.NextFeature();
            }
        }
예제 #37
0
 // Get the default drawing line symbol - blue and solid line with 3.0 width.
 public static ISimpleLineSymbol GetDefaultDrawingLineSymbol()
 {
     if (_defaultDrawingLineSymbol == null)
     {
         _defaultDrawingLineSymbol = 
             Runtime.graphicEngine.newSimpleLineSymbol(
             Colors.Blue,
             Core.Graphics.SimpleLineStyle.Solid, 3.0);
     }
     return _defaultDrawingLineSymbol;
 }
예제 #38
0
        public ISimpleFillSymbol newSimpleFillSymbol(Color color,
            IS3.Core.Graphics.SimpleFillStyle style,
            ISimpleLineSymbol outline)
        {
            IS3SimpleFillSymbol symbol = new IS3SimpleFillSymbol();
            symbol.Color = color;
            symbol.Outline = outline as IS3SimpleLineSymbol;
            symbol.Style = style;

            return symbol;
        }
예제 #39
0
        public ISimpleMarkerSymbol newSimpleMarkerSymbol(Color color,
            double angle, IS3.Core.Graphics.MarkerAngleAlignment angleAlignment,
            double size, IS3.Core.Graphics.SimpleMarkerStyle style,
            ISimpleLineSymbol outline,
            double xOffset, double yOffset)
        {
            IS3SimpleMarkerSymbol symbol = new IS3SimpleMarkerSymbol();
            symbol.Color = color;
            symbol.Angle = angle;
            symbol.AngleAlignment = angleAlignment;
            symbol.Size = size;
            symbol.Style = style;
            symbol.Outline = outline as IS3SimpleLineSymbol;
            symbol.XOffset = xOffset;
            symbol.YOffset = yOffset;

            return symbol;
        }
예제 #40
0
 public static IFillSymbol CreateTransparentFillSymbol(ISimpleLineSymbol aOutline)
 {
     SimpleFillSymbolClass class2 = new SimpleFillSymbolClass();
     class2.Style = esriSimpleFillStyle.esriSFSNull;
     class2.Outline = aOutline;
     return class2;
 }
        HashSet<string> _tunnelLayerIDs; // tunnel layer IDs

        #endregion Fields

        #region Constructors

        public TunnelDepthAnalysisWindow()
        {
            InitializeComponent();

            //Initialize
            _linesymbol = Runtime.graphicEngine.newSimpleLineSymbol(
                                Colors.Blue, Core.Graphics.SimpleLineStyle.Solid, 1.0);
            _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>();
            _depthGraphics = new Dictionary<int, IGraphicCollection>();

            Loaded += TunnelDepthAnalysisWindow_Loaded;
            Unloaded += TunnelDepthAnalysisWindow_Unloaded;

            _mainFrame = Globals.mainframe;
            _prj = Globals.project;

            if (_mainFrame == null || _prj == null) { _initFailed = true; return; }

            _structureDomain = _prj.getDomain(DomainType.Structure);
            if (_structureDomain == null) { _initFailed = true; return; }

            _allTunnels = _structureDomain.getObjects("Tunnel");
            _tunnelLayerIDs = new HashSet<string>();
            foreach (DGObjects objs in _allTunnels)
                _tunnelLayerIDs.Add(objs.definition.GISLayerName);
        }
예제 #42
0
        private void SetNewLineFeedBack()
        {
            m_pEnvFeedback = new NewEnvelopeFeedback();
            IRgbColor pColor = new RgbColor();
            pColor.Red = 0;
            pColor.Green = 0;
            pColor.Blue = 0;

            m_LineSym = new SimpleLineSymbol();
            m_LineSym.Color = pColor;
            m_LineSym.Width = 1;
            m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

            ISymbol pSym = m_LineSym as ISymbol;
            pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            m_pEnvFeedback.Symbol = pSym;

            m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
            m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
            m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();

            m_pEnvFeedback.Display = m_hookHelper.ActiveView.ScreenDisplay;
        }