Ejemplo n.º 1
0
        private void btn_FlowDerc_Click(object sender, EventArgs e)
        {
            if (_shpLayer == null)
            {
                btn_LoadLayer.PerformClick();
            }

            _pipeArrowVisible = !_pipeArrowVisible;
            //获取图层要素
            var features = _shpLayer.GetAllFeatures();

            for (int i = 0; i < features.Length; i++)
            {
                //获取要素的样式
                GSOLineStyle3D lineStyle = features[i].Geometry.Style as GSOLineStyle3D;
                //如果线样式中的ArrowStyle箭头样式为空,则新建箭头样式(水流箭头)
                if (lineStyle.ArrowStyle == null)
                {
                    lineStyle.ArrowStyle                = new GSOArrowStyle();
                    lineStyle.ArrowStyle.BodyWidth      = 2;                              //箭头体宽度
                    lineStyle.ArrowStyle.BodyLen        = 6;                              //箭头体长度
                    lineStyle.ArrowStyle.HeadWidth      = 8;                              //箭头头宽度
                    lineStyle.ArrowStyle.HeadLen        = 10;                             //箭头头长度
                    lineStyle.ArrowStyle.OutlineVisible = true;                           //是否显示箭头外轮廓
                    lineStyle.ArrowStyle.OutlineColor   = Color.Red;                      //设置外轮廓颜色
                    lineStyle.ArrowStyle.Speed          = lineStyle.ArrowStyle.Speed / 2; //箭头运动速度
                    lineStyle.ArrowStyle.Play();                                          //播放箭头运动
                }
                lineStyle.ArrowVisible = _pipeArrowVisible;                               //判断水流箭头显示/隐藏
            }

            btn_FlowDerc.Text = _pipeArrowVisible ? "隐藏流向分析" : "显示流向分析";
            //刷新球
            this._glbControl.Globe.Refresh();
        }
Ejemplo n.º 2
0
        private void checkBoxShowArrow_CheckedChanged(object sender, EventArgs e)
        {
            bool bChecked = checkBoxShowArrow.Checked;

            // 清除风格
            if (m_Geometry != null && m_Geometry.Style != null)
            {
                GSOLineStyle3D lineStyle = m_Geometry.Style as GSOLineStyle3D;
                if (lineStyle != null)
                {
                    m_GlobeControl.Globe.AddToEditHistroy(mlayer, mfeature, EnumEditType.Modify);

                    if (!bChecked)
                    {
                        lineStyle.ArrowVisible = false;
                    }
                    else
                    {
                        if (lineStyle.ArrowStyle == null)
                        {
                            lineStyle.ArrowStyle = new GSOArrowStyle();
                        }
                        lineStyle.ArrowVisible = true;
                    }
                }
            }
            CheckArrowControlsEnable(bChecked);
            if (m_GlobeControl != null)
            {
                m_GlobeControl.Refresh();
            }
        }
Ejemplo n.º 3
0
 private void buttonArrowStyle_Click(object sender, EventArgs e)
 {
     if (m_Geometry != null)
     {
         GSOLineStyle3D lineStyle = m_Geometry.Style as GSOLineStyle3D;
         if (lineStyle != null && lineStyle.ArrowStyle != null)
         {
             FrmSetArrowStyle dlg = new FrmSetArrowStyle(lineStyle.ArrowStyle, mfeature, mlayer, m_GlobeControl);
             dlg.Show(this);
         }
     }
 }
Ejemplo n.º 4
0
        public FrmSetOutlineStyle(GSOLineStyle3D style, GSOGeoPolygon3D polygon, GSOFeature feature, GSOGlobeControl globeControl)
        {
            InitializeComponent();
            m_GlobeControl = globeControl;
            mfeature = feature;
            mpolygon = polygon;

            // 如果m_OldStyle不存在,先备份一个
            if (style != null)
            {
                m_OldStyle = (GSOLineStyle3D)style.Clone();
            }
            simpleLineStyle3D = (GSOSimpleLineStyle3D)style;
        }
Ejemplo n.º 5
0
        public FrmSetOutlineStyle(GSOLineStyle3D style, GSOGeoPolygon3D polygon, GSOFeature feature, GSOGlobeControl globeControl)
        {
            InitializeComponent();
            m_GlobeControl = globeControl;
            mfeature       = feature;
            mpolygon       = polygon;

            // 如果m_OldStyle不存在,先备份一个
            if (style != null)
            {
                m_OldStyle = (GSOLineStyle3D)style.Clone();
            }
            simpleLineStyle3D = (GSOSimpleLineStyle3D)style;
        }
Ejemplo n.º 6
0
        public CtrlLineStylePage(GSOGeometry geometry,GSOFeature feature,GSOLayer layer, GSOGlobeControl globeControl)
        {
            InitializeComponent();

            m_GlobeControl = globeControl;
            m_Geometry = geometry;
            mlayer = layer;
            mfeature = feature;

            if (m_Geometry != null && m_Geometry.Style != null)
            {
                m_Style = (GSOLineStyle3D)m_Geometry.Style;

                m_OldStyle = (GSOLineStyle3D)m_Geometry.Style.Clone();
            }
        }
Ejemplo n.º 7
0
        public CtrlLineStylePage(GSOGeometry geometry, GSOFeature feature, GSOLayer layer, GSOGlobeControl globeControl)
        {
            InitializeComponent();

            m_GlobeControl = globeControl;
            m_Geometry     = geometry;
            mlayer         = layer;
            mfeature       = feature;

            if (m_Geometry != null && m_Geometry.Style != null)
            {
                m_Style = (GSOLineStyle3D)m_Geometry.Style;

                m_OldStyle = (GSOLineStyle3D)m_Geometry.Style.Clone();
            }
        }
Ejemplo n.º 8
0
        private void SetControlsByStyle(GSOStyle style)
        {
            if (style != null)
            {
                GSOPipeLineStyle3D pipelineStyle = style as GSOPipeLineStyle3D;
                if (pipelineStyle != null)
                {
                    AddTabPages("pipelineStyle", "管线", new CtrlPipelineStyleSetting(pipelineStyle, mfeature, mlayer, m_GlobeControl));
                }
                else
                {
                    GSOSimpleLineStyle3D simpleLineStyle = style as GSOSimpleLineStyle3D;
                    if (simpleLineStyle != null)
                    {
                        AddTabPages("simpleLineStyle", "简单线", new CtrlLineStyleSetting(simpleLineStyle, mfeature, mlayer, m_GlobeControl));
                    }
                    else
                    {
                        GSOExtendSectionLineStyle3D extentSectionLineStyle = style as GSOExtendSectionLineStyle3D;
                        if (extentSectionLineStyle != null)
                        {
                            AddTabPages("extendSectionLineStyle", "管沟", new CtrlExtentSectionlineStyleSetting(extentSectionLineStyle, mfeature, mlayer, m_GlobeControl));
                        }
                    }
                }

                checkBoxUseStyle.Checked = true;
                GSOLineStyle3D lineStyle = style as GSOLineStyle3D;
                if (lineStyle != null && lineStyle.ArrowVisible && lineStyle.ArrowStyle != null)
                {
                    checkBoxShowArrow.Checked = true;
                }
                else
                {
                    checkBoxShowArrow.Checked = false;
                }
            }
            else
            {
                checkBoxUseStyle.Checked  = false;
                checkBoxShowArrow.Checked = false;
            }

            CheckControlsEnable(checkBoxUseStyle.Checked);
        }
Ejemplo n.º 9
0
        private void Flow(object sender, string pipelineNameCN)//流向
        {
            //if (checkBox1.Checked == true)
            //{
            GSOFeatures feats = layer.GetAllFeatures();

            if (feats.Length == 0)
            {
                return;
            }
            for (int i = 0; i < feats.Length; i++)
            {
                GSOFeature     feat      = feats[i];
                GSOLineStyle3D lineStyle = feat.Geometry.Style as GSOLineStyle3D;
                if (lineStyle != null)
                {
                    if (lineStyle.ArrowStyle == null)
                    {
                        lineStyle.ArrowStyle                = new GSOArrowStyle();
                        lineStyle.ArrowStyle.BodyWidth      = 2;
                        lineStyle.ArrowStyle.BodyLen        = 6;
                        lineStyle.ArrowStyle.HeadWidth      = 8;
                        lineStyle.ArrowStyle.HeadLen        = 10;
                        lineStyle.ArrowStyle.OutlineVisible = true;
                        lineStyle.ArrowStyle.OutlineColor   = Color.Red;
                        lineStyle.ArrowStyle.Speed          = lineStyle.ArrowStyle.Speed / 2;
                        lineStyle.ArrowStyle.Play();
                    }
                    lineStyle.ArrowVisible = checkBox1.Checked;

                    feat.Geometry.SetModified(true);
                }
            }
            //}
            globeControl.Globe.Refresh();
        }