private void SetControlsByStyle(GSOStyle style) { GSOSimplePolygonStyle3D geoStyle3d = style as GSOSimplePolygonStyle3D; if (geoStyle3d != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxFillColor.BackColor = geoStyle3d.FillColor; numericUpDownFillOpaque.Value = geoStyle3d.FillColor.A; checkBoxFill.Checked = geoStyle3d.Fill; checkBoxOutline.Checked = geoStyle3d.OutLineVisible; if (geoStyle3d.OutlineStyle != null) { checkBoxUseOutlineStyle.Checked = true; } else { checkBoxUseOutlineStyle.Checked = false; } checkBoxUseStyle.Checked = true; } else { checkBoxUseStyle.Checked = false; } CheckControlsEnable(checkBoxUseStyle.Checked); }
private void CtrlLineStylePage_Load(object sender, EventArgs e) { if (m_Geometry != null) { oldStyle = m_Geometry.Style; SetControlsByStyle(m_Geometry.Style); } }
public FrmSetPolygonStyle(GSOStyle style, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; // 先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
public FrmSetLineStyle(GSOStyle style, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; // 如果m_OldStyle不存在,先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
public CtrlExtentSectionlineStyleSetting(GSOStyle style, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; // 如果m_OldStyle不存在,先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
public FrmSetPipelineStyle(GSOStyle style, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; // 如果m_OldStyle不存在,先备份一个 if (style != null && m_OldStyle != null) { m_OldStyle = style.Clone(); } m_Style = style; }
private void SetControlsByStyle(GSOStyle style) { GSOMarkerStyle3D markerStyle = style as GSOMarkerStyle3D; if (markerStyle != null) { if (markerStyle.IconPath != "") { textBoxIconPath.Text = markerStyle.IconPath; try { if (File.Exists(markerStyle.IconPath)) { Bitmap bitmap1 = (Bitmap)Bitmap.FromFile(markerStyle.IconPath); pictureBoxIconPath.SizeMode = PictureBoxSizeMode.StretchImage; pictureBoxIconPath.Image = bitmap1; } } catch (System.Exception exp) { Log.PublishTxt(exp); } } pictureBoxIconColor.BackColor = Color.FromArgb(255, markerStyle.IconColor); numericUpDownIconOpaque.Value = markerStyle.IconColor.A; try { numericUpDownIconScale.Value = Convert.ToDecimal(markerStyle.IconScale); } catch (System.Exception exp) { Log.PublishTxt(exp); } GSOTextStyle geoTextStyle = (GSOTextStyle)markerStyle.TextStyle; if (geoTextStyle != null) { pictureBoxTextColor.BackColor = Color.FromArgb(255, geoTextStyle.ForeColor); numericUpDownTextOpaque.Value = geoTextStyle.ForeColor.A; try { numericUpDownTextScale.Value = Convert.ToDecimal(geoTextStyle.Scale); } catch (System.Exception exp) { Log.PublishTxt(exp); } } } }
private void SetControlsByStyle(GSOStyle style) { if (m_Style != null) { extentSectionLineStyle3D = m_Style as GSOExtendSectionLineStyle3D; if (extentSectionLineStyle3D == null) { extentSectionLineStyle3D = new GSOExtendSectionLineStyle3D(); extentSectionLineStyle3D.LineColor = Color.Green; GSOPoint3ds points = new GSOPoint3ds(); points.Add(new GSOPoint3d(-0.5, 0.5, 0)); points.Add(new GSOPoint3d(-0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, 0.5, 0)); extentSectionLineStyle3D.SetSectionPoints(points); RefreshGlobe(extentSectionLineStyle3D); } } else { extentSectionLineStyle3D = new GSOExtendSectionLineStyle3D(); extentSectionLineStyle3D.LineColor = Color.Green; GSOPoint3ds points = new GSOPoint3ds(); points.Add(new GSOPoint3d(-0.5, 0.5, 0)); points.Add(new GSOPoint3d(-0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, 0.5, 0)); extentSectionLineStyle3D.SetSectionPoints(points); RefreshGlobe(extentSectionLineStyle3D); } // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = extentSectionLineStyle3D.LineColor; numericUpDownLineOpaque.Value = extentSectionLineStyle3D.LineColor.A; textBoxCornerSliceAngle.Text = extentSectionLineStyle3D.CornerSliceAngle.ToString(); GSOPoint3ds mpoints = extentSectionLineStyle3D.GetSectionPoints(); if (mpoints != null && mpoints.Count > 0) { for (int i = 0; i < mpoints.Count; i++) { GSOPoint3d point = mpoints[i]; if (point != null) { textBoxLineRadius.Text = (Math.Abs(point.X) * 2).ToString(); textBoxThickness.Text = (Math.Abs(point.Y) * 2).ToString(); break; } } } m_bInitialized = true; }
private void listViewStyle_MouseDoubleClick(object sender, MouseEventArgs e) { if (listViewStyle.SelectedIndices.Count > 0) { tabControl1.TabPages.Clear(); GSOStyle oldStyle = null; EnumAltitudeMode oldAltMode = m_Geometry.AltitudeMode; // 先复制一个原来的哦,以便在对话框取消的时候恢复 if (m_Geometry.Style != null) { oldStyle = m_Geometry.Style.Clone(); } if (listViewStyle.SelectedIndices[0] == 0) { GSOSimpleLineStyle3D simpleLineStyle = m_Geometry.Style as GSOSimpleLineStyle3D; if (simpleLineStyle == null) { m_Geometry.Style = new GSOSimpleLineStyle3D(); } FrmSetLineStyle dlg = new FrmSetLineStyle(m_Geometry.Style, mfeature, mlayer, m_GlobeControl); if (dlg.ShowDialog(this) == DialogResult.Cancel) { m_Geometry.Style = oldStyle; } } else if (listViewStyle.SelectedIndices[0] == 1) { GSOPipeLineStyle3D pipeLineStyle = m_Geometry.Style as GSOPipeLineStyle3D; // 管线暂不支持依地模式 if (m_Geometry.AltitudeMode == EnumAltitudeMode.ClampToGround) { m_Geometry.AltitudeMode = EnumAltitudeMode.RelativeToGround; } if (pipeLineStyle == null) { m_Geometry.Style = new GSOPipeLineStyle3D(); } FrmSetPipelineStyle dlg = new FrmSetPipelineStyle(m_Geometry.Style, mfeature, mlayer, m_GlobeControl); // 恢复一下 if (dlg.ShowDialog(this) == DialogResult.Cancel) { m_Geometry.Style = oldStyle; m_Geometry.AltitudeMode = oldAltMode; } } } }
public FrmSetLineStyle(GSOStyle style,GSOFeature feature,GSOLayer layer, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; mlayer = layer; mfeature = feature; // 如果m_OldStyle不存在,先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
public FrmSetPipelineStyle(GSOStyle style, GSOFeature feature, GSOLayer layer, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; mlayer = layer; mfeature = feature; // 如果m_OldStyle不存在,先备份一个 if (style != null && m_OldStyle != null) { m_OldStyle = style.Clone(); } m_Style = style; }
public CtrlPipelineStyleSetting(GSOStyle style, GSOFeature feature, GSOLayer layer, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; mlayer = layer; mfeature = feature; altituMode = feature.Geometry.AltitudeMode; // 如果m_OldStyle不存在,先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
private void SetControlsByStyle(GSOStyle style) { GSOPipeLineStyle3D geoStyle3d = m_Style as GSOPipeLineStyle3D; if (geoStyle3d != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = Color.FromArgb(255, geoStyle3d.LineColor); numericUpDownLineOpaque.Value = geoStyle3d.LineColor.A; textBoxLineRadius.Text = geoStyle3d.Radius.ToString(); textBoxThickness.Text = geoStyle3d.Thickness.ToString(); textBoxSlice.Text = geoStyle3d.Slice.ToString(); textBoxCornerSliceAngle.Text = geoStyle3d.CornerSliceAngle.ToString(); } }
public CtrlExtentSectionlineStyleSetting(GSOStyle style, GSOFeature feature, GSOLayer layer, GSOGlobeControl globeControl) { InitializeComponent(); m_GlobeControl = globeControl; mlayer = layer; mfeature = feature; altituMode = feature.Geometry.AltitudeMode; // 如果m_OldStyle不存在,先备份一个 if (style != null) { m_OldStyle = style.Clone(); } m_Style = style; }
private void SetControlsByStyle(GSOStyle style) { if (m_Style != null) { pipeLineStyle3D = m_Style as GSOPipeLineStyle3D; if (pipeLineStyle3D == null) { pipeLineStyle3D = new GSOPipeLineStyle3D(); RefreshGlobe(pipeLineStyle3D); } } else { pipeLineStyle3D = new GSOPipeLineStyle3D(); RefreshGlobe(pipeLineStyle3D); } // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = Color.FromArgb(255, pipeLineStyle3D.LineColor); numericUpDownLineOpaque.Value = pipeLineStyle3D.LineColor.A; textBoxLineRadius.Text = pipeLineStyle3D.Radius.ToString(); textBoxThickness.Text = pipeLineStyle3D.Thickness.ToString(); textBoxSlice.Text = pipeLineStyle3D.Slice.ToString(); textBoxCornerSliceAngle.Text = pipeLineStyle3D.CornerSliceAngle.ToString(); GSOPipeJointParam headJointParam = pipeLineStyle3D.HeadJointParam; if (headJointParam != null && headJointParam.Extent < 0) { tBoxHeadDecValue.Text = (-headJointParam.Extent).ToString(); } else { //tBoxHeadDecValue.Text = m_GlobeControl.Globe.DecjointValue.ToString(); } GSOPipeJointParam tailJointParam = pipeLineStyle3D.TailJointParam; if (tailJointParam != null && tailJointParam.Extent < 0) { tBoxTailDecValue.Text = (-tailJointParam.Extent).ToString(); } else { //tBoxTailDecValue.Text = m_GlobeControl.Globe.DecjointValue.ToString(); } m_bInitialized = true; }
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); }
private void SetControlsByStyle(GSOStyle style) { simpleLineStyle3D = style as GSOSimpleLineStyle3D; if (simpleLineStyle3D != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = Color.FromArgb(255, simpleLineStyle3D.LineColor); numericUpDownLineOpaque.Value = simpleLineStyle3D.LineColor.A; textBoxLineWidth.Text = simpleLineStyle3D.LineWidth.ToString(); switch (simpleLineStyle3D.LineType) { case EnumLineType.Solid: comboBoxLineType.SelectedIndex = 0; break; case EnumLineType.Dash: comboBoxLineType.SelectedIndex = 1; break; case EnumLineType.Dot: comboBoxLineType.SelectedIndex = 2; break; case EnumLineType.DashDot: comboBoxLineType.SelectedIndex = 3; break; case EnumLineType.DashDotDot: comboBoxLineType.SelectedIndex = 4; break; } checkBoxUseStyle.Checked = true; } else { simpleLineStyle3D = new GSOSimpleLineStyle3D(); m_Geometry.Style = simpleLineStyle3D; checkBoxUseStyle.Checked = false; } CheckControlsEnable(checkBoxUseStyle.Checked); }
private void SetControlsByStyle(GSOStyle style) { if (m_Style != null) { simpleLineStyle3D = m_Style as GSOSimpleLineStyle3D; if (simpleLineStyle3D == null) { simpleLineStyle3D = new GSOSimpleLineStyle3D(); RefreshGlobe(simpleLineStyle3D); } } else { simpleLineStyle3D = new GSOSimpleLineStyle3D(); RefreshGlobe(simpleLineStyle3D); } // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = Color.FromArgb(255, simpleLineStyle3D.LineColor); numericUpDownLineOpaque.Value = simpleLineStyle3D.LineColor.A; textBoxLineWidth.Text = simpleLineStyle3D.LineWidth.ToString(); switch (simpleLineStyle3D.LineType) { case EnumLineType.Solid: comboBoxLineType.SelectedIndex = 0; break; case EnumLineType.Dash: comboBoxLineType.SelectedIndex = 1; break; case EnumLineType.Dot: comboBoxLineType.SelectedIndex = 2; break; case EnumLineType.DashDot: comboBoxLineType.SelectedIndex = 3; break; case EnumLineType.DashDotDot: comboBoxLineType.SelectedIndex = 4; break; } }
private void SetControlsByStyle(GSOStyle style) { GSOEntityStyle3D geoStyle3d = style as GSOEntityStyle3D; if (geoStyle3d != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxModelColor.BackColor = geoStyle3d.EntityColor; numericUpDownModelOpaque.Value = geoStyle3d.EntityColor.A; switch (geoStyle3d.PolygonMode) { case EnumPolygonMode.Solid: comboBoxPolygonMode.SelectedIndex = 0; break; case EnumPolygonMode.Wireframe: comboBoxPolygonMode.SelectedIndex = 1; break; case EnumPolygonMode.Points: comboBoxPolygonMode.SelectedIndex = 2; break; } checkBoxUseSingleColor.Checked = geoStyle3d.UsingSingleColor; checkBoxTexture.Checked = geoStyle3d.UsingTexture; checkBoxLight.Checked = geoStyle3d.UsingLight; checkBoxBothFace.Checked = geoStyle3d.UsingBothFace; checkBoxUseStyle.Checked = true; } else { checkBoxUseStyle.Checked = false; } CheckControlsEnable(checkBoxUseStyle.Checked); }
public CtrlLineStylePreview(GSOStyle style) { InitializeComponent(); m_Style = style; }
private void SetControlsByStyle(GSOStyle style) { if (simpleLineStyle3D != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = Color.FromArgb(255, simpleLineStyle3D.LineColor); numericUpDownLineOpaque.Value = simpleLineStyle3D.LineColor.A; textBoxLineWidth.Text = simpleLineStyle3D.LineWidth.ToString(); switch (simpleLineStyle3D.LineType) { case EnumLineType.Solid: comboBoxLineType.SelectedIndex = 0; break; case EnumLineType.Dash: comboBoxLineType.SelectedIndex = 1; break; case EnumLineType.Dot: comboBoxLineType.SelectedIndex = 2; break; case EnumLineType.DashDot: comboBoxLineType.SelectedIndex = 3; break; case EnumLineType.DashDotDot: comboBoxLineType.SelectedIndex = 4; break; } } else { simpleLineStyle3D = new GSOSimpleLineStyle3D(); } }
private void SetControlsByStyle(GSOStyle style) { GSOSimplePolygonStyle3D geoStyle3d = style as GSOSimplePolygonStyle3D; if (geoStyle3d != null) { // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxFillColor.BackColor = geoStyle3d.FillColor; numericUpDownFillOpaque.Value = geoStyle3d.FillColor.A; checkBoxFill.Checked = geoStyle3d.Fill; checkBoxOutline.Checked = geoStyle3d.OutLineVisible; if (geoStyle3d.OutlineStyle!=null) { checkBoxUseOutlineStyle.Checked = true; } else { checkBoxUseOutlineStyle.Checked = false; } checkBoxUseStyle.Checked = true; } else { checkBoxUseStyle.Checked = false; } CheckControlsEnable(checkBoxUseStyle.Checked); }
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); }
private void SetControlsByStyle(GSOStyle style) { if (m_Style != null) { extentSectionLineStyle3D = m_Style as GSOExtendSectionLineStyle3D; if (extentSectionLineStyle3D == null) { extentSectionLineStyle3D = new GSOExtendSectionLineStyle3D(); extentSectionLineStyle3D.LineColor = Color.Green; GSOPoint3ds points = new GSOPoint3ds(); points.Add(new GSOPoint3d(-0.5, 0.5, 0)); points.Add(new GSOPoint3d(-0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5, 0.5, 0)); extentSectionLineStyle3D.SetSectionPoints(points); RefreshGlobe(extentSectionLineStyle3D); } } else { extentSectionLineStyle3D = new GSOExtendSectionLineStyle3D(); extentSectionLineStyle3D.LineColor = Color.Green; GSOPoint3ds points = new GSOPoint3ds(); points.Add(new GSOPoint3d(-0.5, 0.5, 0)); points.Add(new GSOPoint3d(-0.5, -0.5, 0)); points.Add(new GSOPoint3d(0.5,- 0.5, 0)); points.Add(new GSOPoint3d(0.5, 0.5, 0)); extentSectionLineStyle3D.SetSectionPoints(points); RefreshGlobe(extentSectionLineStyle3D); } // 这句要写到前面,不然下面Checked的时候要检查 pictureBoxLineColor.BackColor = extentSectionLineStyle3D.LineColor; numericUpDownLineOpaque.Value = extentSectionLineStyle3D.LineColor.A; textBoxCornerSliceAngle.Text = extentSectionLineStyle3D.CornerSliceAngle.ToString(); GSOPoint3ds mpoints = extentSectionLineStyle3D.GetSectionPoints(); if (mpoints != null && mpoints.Count > 0) { for (int i = 0; i < mpoints.Count; i++) { GSOPoint3d point = mpoints[i]; if (point != null) { textBoxLineRadius.Text = (Math.Abs(point.X) * 2).ToString(); textBoxThickness.Text = (Math.Abs(point.Y) * 2).ToString(); break; } } } m_bInitialized = true; }
private void SetControlsByStyle(GSOStyle style) { GSOMarkerStyle3D markerStyle = style as GSOMarkerStyle3D; if (markerStyle != null) { if (markerStyle.IconPath != "") { textBoxIconPath.Text = markerStyle.IconPath; try { if (File.Exists(markerStyle.IconPath)) { Bitmap bitmap1 = (Bitmap)Bitmap.FromFile(markerStyle.IconPath); pictureBoxIconPath.SizeMode = PictureBoxSizeMode.StretchImage; pictureBoxIconPath.Image = bitmap1; } } catch (System.Exception exp) { Log.PublishTxt(exp); } } pictureBoxIconColor.BackColor = Color.FromArgb(255,markerStyle.IconColor); numericUpDownIconOpaque.Value = markerStyle.IconColor.A; try { numericUpDownIconScale.Value = Convert.ToDecimal(markerStyle.IconScale); } catch (System.Exception exp) { Log.PublishTxt(exp); } GSOTextStyle geoTextStyle = (GSOTextStyle)markerStyle.TextStyle; if (geoTextStyle != null) { pictureBoxTextColor.BackColor = Color.FromArgb(255, geoTextStyle.ForeColor); numericUpDownTextOpaque.Value = geoTextStyle.ForeColor.A; try { numericUpDownTextScale.Value = Convert.ToDecimal(geoTextStyle.Scale); } catch (System.Exception exp) { Log.PublishTxt(exp); } } } }