|
|
|
|
|
// <copyright file="UCDrawEdit.cs" company="PlaceholderCompany">
|
|
|
|
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
|
|
|
|
// </copyright>
|
|
|
|
|
|
|
|
|
|
|
|
using DevExpress.Utils.Extensions;
|
|
|
|
|
|
using GeoSigma.UCDraw.Tool;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PcgDrawR
|
|
|
|
|
|
{
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
|
using DevExpress.Utils.Menu;
|
|
|
|
|
|
using DevExpress.Utils.Svg;
|
|
|
|
|
|
using DevExpress.XtraBars;
|
|
|
|
|
|
using DevExpress.XtraBars.Docking;
|
|
|
|
|
|
using DevExpress.XtraBars.Ribbon;
|
|
|
|
|
|
using DevExpress.XtraEditors;
|
|
|
|
|
|
using DevExpress.XtraGrid;
|
|
|
|
|
|
using DrawerInterface;
|
|
|
|
|
|
using GeoSigma.SigmaDrawerUtil;
|
|
|
|
|
|
using GeoSigma.UCDraw;
|
|
|
|
|
|
using GeoSigma.UCDraw.UC;
|
|
|
|
|
|
using GeoSigmaDrawLib;
|
|
|
|
|
|
using SigmaDrawerElement;
|
|
|
|
|
|
using UCDraw;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The NewFileSavedHandler.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="fileFullName">The fileFullName<see cref="string"/>.</param>
|
|
|
|
|
|
public delegate void NewFileSavedHandler(string fileFullName);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The FileClosedEventHandler.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
public delegate void FileClosedEventHandler(object sender, EventArgs e);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 显示VTK窗口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The <see cref="ShowVtkEventArgs"/> instance containing the event data.</param>
|
|
|
|
|
|
public delegate void ShowVtkEventHandler(object sender, ShowVtkEventArgs e);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关闭VTK窗口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="vtkEdit">The VTK edit.</param>
|
|
|
|
|
|
public delegate void CloseVtkHandler(UCVtkEdit vtkEdit);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图层选择通知代理(带状态)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="layers">图层</param>
|
|
|
|
|
|
/// <param name="status">状态</param>
|
|
|
|
|
|
public delegate void LayerSelectedNotifyWithStatusHandler(string layers, LayerStatus status);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通知上层打开一个新文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="filePath">文件路径</param>
|
|
|
|
|
|
public delegate void OpenNewFileHandler(string filePath);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Ribbon风格图形编辑.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class UCDrawEdit : XtraUserControl // DevExpress.XtraBars.Ribbon.RibbonForm
|
|
|
|
|
|
{
|
|
|
|
|
|
private static bool hasProcessDebug = false;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the NewFileSavedEvent.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public NewFileSavedHandler NewFileSavedEvent { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the FileClosedEvent.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public FileClosedEventHandler FileClosedEvent { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the close VTK handler event.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <value>
|
|
|
|
|
|
/// The close VTK handler event.
|
|
|
|
|
|
/// </value>
|
|
|
|
|
|
public CloseVtkHandler CloseVtkEvent { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the show VTK event.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <value>
|
|
|
|
|
|
/// The show VTK event.
|
|
|
|
|
|
/// </value>
|
|
|
|
|
|
public ShowVtkEventHandler ShowVtkEvent { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the ShowStatisticResult.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public event EventHandler<EventArgs> ShowStatisticResult;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the FileModifiedEvent.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public event FileModifyEventHandle FileModifiedEvent;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打开新文件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public event OpenNewFileHandler OpenNewFile;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 2维图层选择通知(带状态)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public LayerSelectedNotifyWithStatusHandler LayerSelectedNotify2dWithStatus { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the layerPanel.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private DockPanel layerPanel;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// VtkMainMesh
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public IntPtr VtkMainMesh { get; set; } = IntPtr.Zero;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置主网格
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="pMash"></param>
|
|
|
|
|
|
public void SetVtkMainMesh(IntPtr pMash)
|
|
|
|
|
|
{
|
|
|
|
|
|
VtkMainMesh = pMash;
|
|
|
|
|
|
this.LayerControl.VtkMainMesh = pMash;
|
|
|
|
|
|
mainView.MainMeshLayer3D = mainView.ViewControl.Geo.GetLayerByMainMesh3D(pMash);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取主网格所在的图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string GetMainMeshLayer()
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.MainMeshLayer3D;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过文件存储的主网格ID获取主网格数据对象
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public IntPtr LoadVtkMainMesh()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 从文件获取主网格ID
|
|
|
|
|
|
string layerName = mainView.ViewControl.Geo.GetMainMeshLayer3D();
|
|
|
|
|
|
if (string.IsNullOrEmpty(layerName))
|
|
|
|
|
|
{
|
|
|
|
|
|
return IntPtr.Zero;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr ret = mainView.ViewControl.Geo.GetMainMeshByLayer3D(layerName);
|
|
|
|
|
|
if (ret == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
return IntPtr.Zero;
|
|
|
|
|
|
}
|
|
|
|
|
|
Drawer drawer = DrawerView.ViewControl.Drawer;
|
|
|
|
|
|
drawer.SetVtkMainMeshEvent?.Invoke(drawer.DrawFileName, ret);
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过文件存储的图层设置
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public void LoadLayerSetting()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.HoleLayer = mainView.ViewControl.Geo.GetFaultLayer3D();
|
|
|
|
|
|
this.BorderControlLayer = mainView.ViewControl.Geo.GetBorderLayer3D();
|
|
|
|
|
|
this.WellLayer = mainView.ViewControl.Geo.GetWellLayer3D();
|
|
|
|
|
|
this.btiDigEmptyLayer.EditValue = this.HoleLayer;
|
|
|
|
|
|
this.btiBorderControlLayer.EditValue = this.BorderControlLayer;
|
|
|
|
|
|
this.btiWellLayer.EditValue = this.WellLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the main mesh property.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <value>
|
|
|
|
|
|
/// The main mesh property.
|
|
|
|
|
|
/// </value>
|
|
|
|
|
|
public SigmaDrawerElement.DrawerElementProperty MainMeshProperty { get; set; } = null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the LayerPanel
|
|
|
|
|
|
/// 图层面板.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DockPanel LayerPanel
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return layerPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPanel = value;
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!object.ReferenceEquals(value, dcpLayer))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dcpLayer.Parent.Controls.Count == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
Controls.Remove(dcpLayer.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel(dcpLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// this.dcpLayer.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private DockPanel propertyPanel;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the PropertyPanel
|
|
|
|
|
|
/// 属性面板.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DockPanel PropertyPanel
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return propertyPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
propertyPanel = value;
|
|
|
|
|
|
if (!object.ReferenceEquals(value, dcpProperty))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dcpProperty.Parent.Controls.Count == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
Controls.Remove(dcpProperty.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (dcpProperty.Parent.Controls.Count == 2
|
|
|
|
|
|
&& dcpProperty.Parent.Controls.Contains(dcpCreate))
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel((DockPanel)dcpProperty.Parent);
|
|
|
|
|
|
//Controls.Remove(dcpProperty.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel(dcpProperty);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private DockPanel createMapPanel;
|
|
|
|
|
|
|
|
|
|
|
|
public DockPanel CreateMapPanel
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return createMapPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
createMapPanel = value;
|
|
|
|
|
|
if (!object.ReferenceEquals(value, createMapPanel))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (createMapPanel.Parent.Controls.Count == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
Controls.Remove(dcpCreate.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (dcpCreate.Parent.Controls.Count == 2
|
|
|
|
|
|
&& dcpCreate.Parent.Controls.Contains(dcpCreate))
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel((DockPanel)dcpCreate.Parent);
|
|
|
|
|
|
//Controls.Remove(dcpProperty.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel(dcpCreate);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the statisticPanel.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private DockPanel statisticPanel;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the StatisticPanel
|
|
|
|
|
|
/// 统计面板.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DockPanel StatisticPanel
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return statisticPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
statisticPanel = value;
|
|
|
|
|
|
if (!object.ReferenceEquals(dcpStatistic, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dcpStatistic.Parent.Controls.Count == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
Controls.Remove(dcpStatistic.Parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.RemovePanel(dcpStatistic);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// this.dcpStatistic.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the drawerStatusBar.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private RibbonStatusBar drawerStatusBar;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the DrawerStatusBar
|
|
|
|
|
|
/// 状态条,显示鼠标位置等提示信息.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public RibbonStatusBar DrawerStatusBar
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return drawerStatusBar;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
drawerStatusBar = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the DrawerView
|
|
|
|
|
|
/// 主绘图控件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public MainView DrawerView => mainView;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the LayerControl
|
|
|
|
|
|
/// 树控件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public LayerTree LayerControl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the PropertyControl
|
|
|
|
|
|
/// 属性控件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public PanelProperty PropertyControl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
private PanelGraph panelGraph = null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据成图控件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public PanelGraph GraphControl
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return panelGraph;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the StatisticControl
|
|
|
|
|
|
/// 统计数据控件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public PanelControl StatisticControl { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the LayerSelected
|
|
|
|
|
|
/// 图层选择事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public EventHandler<PropertyChangedEventArgs> LayerSelected
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return DrawerView?.LayerSelected;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (DrawerView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerView.LayerSelected = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the ZColorWidth
|
|
|
|
|
|
/// 色块尺寸,当散点显示为色块时使用此属性。.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public double ZColorWidth { get; set; } = 25;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the FileFullName
|
|
|
|
|
|
/// 文件全路径.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string FileFullName
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.FileFullName;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.FileFullName = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等值线图层名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string GridContourLayer { get; set; } = "等值线";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 断层图层名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string GridFaultLayer { get; set; } = "断层";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 网格编辑控制点图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string ControlPointLayer { get; set; } = string.Empty;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 网格编辑器其它线类图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string OtherLineLayer { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 三维挖空图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string HoleLayer { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 范围边界
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string BorderControlLayer { get; set; } = string.Empty;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 井位图层
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string WellLayer { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
private string popupTreeType = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether EnableMeshPack.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool EnableMeshPack
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.EnableMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.EnableMeshPack = value;
|
|
|
|
|
|
if (bbtnMeshPack.Down != mainView.EnableMeshPack)
|
|
|
|
|
|
{
|
|
|
|
|
|
bbtnMeshPack.Down = mainView.EnableMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether StatusBarVisible
|
|
|
|
|
|
/// Gets or sets 状态条是否可见..
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool StatusBarVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return ribbonStatusBar1.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ribbonStatusBar1.Visible = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether ViewGroupVisible
|
|
|
|
|
|
/// 视图工具组是否可见.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool ViewGroupVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return rgpViews.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
rgpViews.Visible = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the DrawerGotFocus
|
|
|
|
|
|
/// 获得焦点事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public EventHandler<EventArgs> DrawerGotFocus
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.DrawerGotFocus;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainView != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.DrawerGotFocus = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the RibbonDraw
|
|
|
|
|
|
/// 绘图工具RibbonPage.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public RibbonPage RibbonDraw
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return ribbonPage1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the mainView.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private MainView mainView = null;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the layerPopNode.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private string layerPopNode = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether StatisticPanelVisible
|
|
|
|
|
|
/// get/set 统计面板的可见性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool StatisticPanelVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return StatisticPanel.Visibility == DockVisibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
StatisticPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
StatisticPanel.Visibility = DockVisibility.Hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether LayerPanelVisible
|
|
|
|
|
|
/// get/set 图层面板可见性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool LayerPanelVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return LayerPanel.Visibility == DockVisibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.Visibility = DockVisibility.Hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether PropertyPanelVisible
|
|
|
|
|
|
/// get/set 属性面板可见性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool PropertyPanelVisible
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return PropertyPanel.Visibility == DockVisibility.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bckiPanelProperty.Checked != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelProperty.Checked = true;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.PropertyPanel.Index = 0;
|
|
|
|
|
|
CreateMapPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
PropertyPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.ActiveChild = this.PropertyPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
CreateMapPanel.Visibility = DockVisibility.Hidden;
|
|
|
|
|
|
PropertyPanel.Visibility = DockVisibility.Hidden;
|
|
|
|
|
|
if (bckiPanelProperty.Checked == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelProperty.Checked = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool batchSetZColorFlag;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets a value indicating whether [batch set z color flag].
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <value>
|
|
|
|
|
|
/// <c>true</c> if [batch set z color flag]; otherwise, <c>false</c>.
|
|
|
|
|
|
/// </value>
|
|
|
|
|
|
public bool BatchSetZColorFlag
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return batchSetZColorFlag;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnSetXyzClore.Enabled = value;
|
|
|
|
|
|
batchSetZColorFlag = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将全部内容当前分辨率保存到指定输出文件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="outputFile">The output file.</param>
|
|
|
|
|
|
/// <param name="left">左</param>
|
|
|
|
|
|
/// <param name="top">上</param>
|
|
|
|
|
|
/// <param name="right">右</param>
|
|
|
|
|
|
/// <param name="bottom">下</param>
|
|
|
|
|
|
public void Draw2Image(string outputFile, double left = 0, double top = 0, double right = 0, double bottom = 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.Draw2Image(outputFile, left, top, right, bottom);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private BarManager bmDrawer;
|
|
|
|
|
|
private string layoutFilePath;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="UCDrawEdit"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public UCDrawEdit()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
//4.5版本隐藏单井 剖面
|
|
|
|
|
|
this.bbtnWellFigure.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
|
|
|
this.bbtnSectionFigure.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
|
|
|
for (int i = 5; i <= 18; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxControl1.Items.Add(i);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.listBoxControl1.SelectedIndexChanged += ListBoxControl1_SelectedIndexChanged;
|
|
|
|
|
|
|
|
|
|
|
|
this.LayerSelectedNotify2dWithStatus += (layers, status) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
// 2维图层树更新操作
|
|
|
|
|
|
var layerTree = LayerControl.TreeControl;
|
|
|
|
|
|
layerTree.SuspendLayout();
|
|
|
|
|
|
var layerItems = layers.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
|
|
|
|
|
var fullNodes = TreeViewHelper.TraverseTreeView(layerTree);
|
|
|
|
|
|
foreach (var layerItem in fullNodes)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (layerItem.Text == "图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerItems.Contains(layerItem.FullPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerControl.SetNodeStatus(new List<string>() { LayerControl.GetLayerName(layerItem) },
|
|
|
|
|
|
status);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerItems.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerControl_2dNodeViewToggleEvent(layers, status);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
this.layoutFilePath = Path.Combine(Application.StartupPath, "KevEditorLayout.xml");
|
|
|
|
|
|
this.initializeDrawerBar();
|
|
|
|
|
|
this.LoadDrawerToolbar();
|
|
|
|
|
|
|
|
|
|
|
|
LoadCustomMenu();
|
|
|
|
|
|
|
|
|
|
|
|
mainView = new MainView();
|
|
|
|
|
|
mainView.ReloadFileEvent += RestoreState;
|
|
|
|
|
|
|
|
|
|
|
|
Drawer drawer1 = this.DrawerView.ViewControl.Drawer;
|
|
|
|
|
|
drawer1.ViewOnKeyUp += OnKeyUp;
|
|
|
|
|
|
|
|
|
|
|
|
LayerControl = mainView.LayerTreeControl;
|
|
|
|
|
|
PropertyControl = mainView.PropertyControl;
|
|
|
|
|
|
|
|
|
|
|
|
// 由于属性处理多标签页中,当选中图元或图层时,右侧当前激活的可能不是属性标签,我们这时需要手工去激活一下属性标签页
|
|
|
|
|
|
//PropertyControl.ElementChanged += PropertyControl_ElementChanged;
|
|
|
|
|
|
//PropertyControl.LayerChanged += PropertyControl_LayerChanged;
|
|
|
|
|
|
DrawerView.DrawerGotFocus += (object drawer, EventArgs ea) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
switchPropertyPanel();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
StatisticControl = mainView.StaticsControl;
|
|
|
|
|
|
|
|
|
|
|
|
panelGraph = new PanelGraph();
|
|
|
|
|
|
panelGraph.BeforeGridding += PanelGraph_BeforeGridding;
|
|
|
|
|
|
panelGraph.GriddingStarted += PanelGraph_GriddingStarted;
|
|
|
|
|
|
panelGraph.GriddingFinished += PanelGraph_GriddingFinished;
|
|
|
|
|
|
panelGraph.ImportStarted += PanelGraph_ImportStarted;
|
|
|
|
|
|
panelGraph.ImportFinished += PanelGraph_ImportFinished;
|
|
|
|
|
|
|
|
|
|
|
|
this.LayerControl.NodeViewToggleEvent += LayerControl_2dNodeViewToggleEvent;
|
|
|
|
|
|
|
|
|
|
|
|
// drawerStatusBar = this.ribbonMain.StatusBar;
|
|
|
|
|
|
mainView.ViewerCommandStart += OnCommandStart;
|
|
|
|
|
|
mainView.ViewerCommandFinish += OnCommandFinish;
|
|
|
|
|
|
mainView.ShowStatisticResult += MainView_ShowStatisticResult;
|
|
|
|
|
|
mainView.WaitProgressEvent += DrawerWaitProgress;
|
|
|
|
|
|
|
|
|
|
|
|
InitToolTip();
|
|
|
|
|
|
|
|
|
|
|
|
LayerPanel = this.dcpLayer;
|
|
|
|
|
|
PropertyPanel = this.dcpProperty;
|
|
|
|
|
|
CreateMapPanel = this.dcpCreate;
|
|
|
|
|
|
StatisticPanel = dcpStatistic;
|
|
|
|
|
|
|
|
|
|
|
|
// 处理调试配置
|
|
|
|
|
|
if (!hasProcessDebug)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (DrawerConfig.Instance.FindConfigValue<bool>("Debug", "Enable", false))
|
|
|
|
|
|
{
|
|
|
|
|
|
CrashDumpManager.Enable();
|
|
|
|
|
|
}
|
|
|
|
|
|
hasProcessDebug = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Controls.Remove(dcpProperty.Parent);
|
|
|
|
|
|
//dockManager1.RemovePanel(dcpProperty);
|
|
|
|
|
|
//dockManager1.RemovePanel((DockPanel)dcpProperty.Parent);
|
|
|
|
|
|
WindowSync.Down = DrawerConfig.Instance.FindConfigValue<bool>("MultiView", "OnSynchronize", false);
|
|
|
|
|
|
this.trvLayer.AfterCheck += trvLayer_AfterCheck;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void trvLayer_AfterCheck(object sender, TreeViewEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 防止事件循环(修改子节点时会触发新的AfterCheck事件)
|
|
|
|
|
|
this.trvLayer.AfterCheck -= trvLayer_AfterCheck;
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
// 根据当前节点的选中状态,更新所有子节点
|
|
|
|
|
|
UpdateTrvLayerChildNodes(e.Node, e.Node.Checked);
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
|
|
|
{
|
|
|
|
|
|
// 恢复事件处理
|
|
|
|
|
|
this.trvLayer.AfterCheck += trvLayer_AfterCheck;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateTrvLayerChildNodes(TreeNode parentNode, bool isChecked)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (TreeNode childNode in parentNode.Nodes)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 设置子节点的选中状态
|
|
|
|
|
|
childNode.Checked = isChecked;
|
|
|
|
|
|
// 递归处理子节点的子节点
|
|
|
|
|
|
UpdateTrvLayerChildNodes(childNode, isChecked);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void switchPropertyPanel()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.InvokeRequired)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Invoke(new MethodInvoker(delegate
|
|
|
|
|
|
{
|
|
|
|
|
|
switchPropertyPanel();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.PropertyPanel.Visibility == DockVisibility.Visible
|
|
|
|
|
|
&& this.PropertyPanel.ParentPanel != null
|
|
|
|
|
|
&& this.PropertyPanel.ParentPanel.ActiveChild != null
|
|
|
|
|
|
&& (this.PropertyPanel.ParentPanel.ActiveChild == this.dcpCreate
|
|
|
|
|
|
|| this.PropertyPanel.ParentPanel.ActiveChild.Name == "dcpCreateMap"))
|
|
|
|
|
|
{
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.Tabbed = true;
|
|
|
|
|
|
if (this.PropertyPanel.ParentPanel.ActiveChild != this.PropertyPanel)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.SuspendLayout();
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.ActiveChild = this.PropertyPanel;
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.ResumeLayout();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//private void PropertyControl_ElementChanged(object sender, EventArgs e)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// ActivePropertyPanel();
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//private void PropertyControl_LayerChanged(object sender, EventArgs e)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// // 点击图层时,应该不切换到属性页面:
|
|
|
|
|
|
// // ActivePropertyPanel();
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
private void ActivePropertyPanel()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 先暂时不处理
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (!PropertyPanelVisible)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var parentPanel = this.PropertyPanel.ParentPanel;
|
|
|
|
|
|
if (parentPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var childrens = parentPanel.Controls.OfType<DockPanel>().ToList();
|
|
|
|
|
|
if (parentPanel.ActiveChild != PropertyPanel)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.PropertyPanel.ParentPanel.ActiveChild = this.PropertyPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PanelGraph_BeforeGridding(object sender, CancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainView.ViewControl.Geo.GetElementCount() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
DialogResult result = MessageBox.Show(this, "该操作将覆盖当前图件,是否同意?"
|
|
|
|
|
|
, "确认覆盖", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
|
|
|
|
|
e.Cancel = (result != DialogResult.Yes);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Cancel = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PanelGraph_ImportFinished(object sender)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerWaitProgress(this, e: new ProgressEventArgs("数据导入中...", 0, false));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PanelGraph_ImportStarted(object sender)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerWaitProgress(this, e: new ProgressEventArgs("数据导入中...", 0, true));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PanelGraph_GriddingStarted(object sender, string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerWaitProgress(this, e: new ProgressEventArgs("正在成图...", 0, true));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PanelGraph_GriddingFinished(object sender, string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerWaitProgress(this, e: new ProgressEventArgs("正在成图...", 0, false));
|
|
|
|
|
|
|
|
|
|
|
|
mainView.ClearAll();
|
|
|
|
|
|
mainView.ViewControl.Geo.FileMerge(filePath);
|
|
|
|
|
|
mainView.LoadLayerTree();
|
|
|
|
|
|
mainView.ToolViewAll();
|
|
|
|
|
|
mainView.ViewControl.Redraw();
|
|
|
|
|
|
|
|
|
|
|
|
TryDeleteFile(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void TryDeleteFile(string filePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
File.Delete(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (IOException ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
Debug.WriteLine($"删除 {filePath} 失败: {ex.Message}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Bar barDrawerBase;
|
|
|
|
|
|
private Bar barCurveProcess;
|
|
|
|
|
|
private Bar barBatchOperate;
|
|
|
|
|
|
private BarDockControl barDockControlLeft;
|
|
|
|
|
|
private BarDockControl barDockControlTop;
|
|
|
|
|
|
private BarDockControl barDockControlBottom;
|
|
|
|
|
|
private BarDockControl barDockControlRight;
|
|
|
|
|
|
private List<BarItem> drawerBarItems;
|
|
|
|
|
|
private List<BarItem> curveProcessItems;
|
|
|
|
|
|
private List<BarItem> batchOperateItems;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 2维图层树节点的可视状态切换
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="additionLayers">三维提交到二维更新图片后,再返回三维时。使用此附加层数据</param>
|
|
|
|
|
|
/// <param name="status">status</param>
|
|
|
|
|
|
private void LayerControl_2dNodeViewToggleEvent(string additionLayers, LayerStatus status)
|
|
|
|
|
|
{
|
|
|
|
|
|
var syncNodes = string.Empty;
|
|
|
|
|
|
var checkNodes = TreeViewHelper.TraverseTreeView(LayerControl.TreeControl)
|
|
|
|
|
|
.Where(n => n.Checked);
|
|
|
|
|
|
if (checkNodes.Count() == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 没有选中的,获取所有可见的
|
|
|
|
|
|
var shownNodes = TreeViewHelper.TraverseTreeView(LayerControl.TreeControl)
|
|
|
|
|
|
.Where(n => LayerControl.GetNodeStatus(n) != LayerStatus.NOT_VIEW_NOT_EDIT);
|
|
|
|
|
|
|
|
|
|
|
|
syncNodes = string.Join(";", shownNodes.Select(n => $@"二维图层\{n.FullPath}").ToList());
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
syncNodes = string.Join(";", checkNodes.Select(n => $@"二维图层\{n.FullPath}").ToList());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(additionLayers))
|
|
|
|
|
|
{
|
|
|
|
|
|
// 三维回传图片时,使用附加层数据
|
|
|
|
|
|
syncNodes = additionLayers;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (VtkEdit != null && !VtkEdit.IsDisposed)
|
|
|
|
|
|
{
|
|
|
|
|
|
splashScreenManager1.ShowWaitForm();
|
|
|
|
|
|
splashScreenManager1.SetWaitFormDescription("正在更新三维图层");
|
|
|
|
|
|
Drawer drawer = this.DrawerView.ViewControl.Drawer;
|
|
|
|
|
|
IntPtr pMeshData = VtkEdit.GetMainMeshData();
|
|
|
|
|
|
double rx0 = VtkEdit.GetMainMeshInfo(pMeshData, 0);
|
|
|
|
|
|
double rx1 = VtkEdit.GetMainMeshInfo(pMeshData, 1);
|
|
|
|
|
|
double ry0 = VtkEdit.GetMainMeshInfo(pMeshData, 2);
|
|
|
|
|
|
double ry1 = VtkEdit.GetMainMeshInfo(pMeshData, 3);
|
|
|
|
|
|
//IntPtr hBitmap = drawer.Geo.Draw2ImageMemory(rx0, ry1, rx1, ry0);
|
|
|
|
|
|
IntPtr hBitmap = drawer.Geo.GetKevMeshImage(pMeshData);
|
|
|
|
|
|
VtkEdit.UpdateMeshBitmap(hBitmap, rx0, ry1, Math.Abs(rx0 - rx1), Math.Abs(ry0 - ry1));
|
|
|
|
|
|
drawer.Geo.DeleteImage(hBitmap);
|
|
|
|
|
|
VtkEdit.LayerSelectedStatusNotify3d?.Invoke(syncNodes, status);
|
|
|
|
|
|
splashScreenManager1.CloseWaitForm();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 刷新VTK图像贴图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void RefreshVtkImage()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (VtkEdit != null && !VtkEdit.IsDisposed)
|
|
|
|
|
|
{
|
|
|
|
|
|
//splashScreenManager1.ShowWaitForm();
|
|
|
|
|
|
//splashScreenManager1.SetWaitFormDescription("正在更新3维图层");
|
|
|
|
|
|
Drawer drawer = this.DrawerView.ViewControl.Drawer;
|
|
|
|
|
|
IntPtr pMeshData = VtkEdit.GetMainMeshData();
|
|
|
|
|
|
double rx0 = VtkEdit.GetMainMeshInfo(pMeshData, 0);
|
|
|
|
|
|
double rx1 = VtkEdit.GetMainMeshInfo(pMeshData, 1);
|
|
|
|
|
|
double ry0 = VtkEdit.GetMainMeshInfo(pMeshData, 2);
|
|
|
|
|
|
double ry1 = VtkEdit.GetMainMeshInfo(pMeshData, 3);
|
|
|
|
|
|
//IntPtr hBitmap = drawer.Geo.Draw2ImageMemory(rx0, ry1, rx1, ry0);
|
|
|
|
|
|
IntPtr hBitmap = drawer.Geo.GetKevMeshImage(pMeshData);
|
|
|
|
|
|
VtkEdit.UpdateMeshBitmap(hBitmap, rx0, ry1, Math.Abs(rx0 - rx1), Math.Abs(ry0 - ry1));
|
|
|
|
|
|
drawer.Geo.DeleteImage(hBitmap);
|
|
|
|
|
|
//splashScreenManager1.CloseWaitForm();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载绘图工具条.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected void LoadDrawerToolbar()
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bShowToolbar = true;
|
|
|
|
|
|
this.bmDrawer.Items.AddRange(drawerBarItems.ToArray());
|
|
|
|
|
|
foreach (BarItem item in drawerBarItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.barDrawerBase.LinksPersistInfo.Add(new DevExpress.XtraBars.LinkPersistInfo(item));
|
|
|
|
|
|
}
|
|
|
|
|
|
this.bmDrawer.Items.AddRange(curveProcessItems.ToArray());
|
|
|
|
|
|
foreach (BarItem item in curveProcessItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.barCurveProcess.LinksPersistInfo.Add(new DevExpress.XtraBars.LinkPersistInfo(item));
|
|
|
|
|
|
}
|
|
|
|
|
|
this.bmDrawer.Items.AddRange(this.batchOperateItems.ToArray());
|
|
|
|
|
|
foreach (BarItem item in batchOperateItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.barBatchOperate.LinksPersistInfo.Add(new DevExpress.XtraBars.LinkPersistInfo(item));
|
|
|
|
|
|
}
|
|
|
|
|
|
this.rpgDrawElement.Visible = !bShowToolbar;
|
|
|
|
|
|
this.rpgCurveOperate.Visible = !bShowToolbar;
|
|
|
|
|
|
|
|
|
|
|
|
//屏蔽工具条上的断层简化按钮
|
|
|
|
|
|
this.bbtnFaultSimplyfy.Enabled = false;
|
|
|
|
|
|
this.bbtnFaultSimplyfy.Visibility = DevExpress.XtraBars.BarItemVisibility.OnlyInCustomizing;
|
|
|
|
|
|
|
|
|
|
|
|
//// 自动保存工具条布局
|
|
|
|
|
|
//string regKey = "Kev\\XtraBars\\Layouts\\MainLayout";
|
|
|
|
|
|
////this.bmDrawer.RestoreLayoutFromRegistry(regKey);
|
|
|
|
|
|
//this.bmDrawer.RegistryPath = regKey;
|
|
|
|
|
|
//this.bmDrawer.AutoSaveInRegistry = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 初始化绘图工具条
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void initializeDrawerBar()
|
|
|
|
|
|
{
|
|
|
|
|
|
drawerBarItems = new List<BarItem>();
|
|
|
|
|
|
drawerBarItems.AddRange(new DevExpress.XtraBars.BarItem[]
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnToolDefault,
|
|
|
|
|
|
this.btnToolSelect,
|
|
|
|
|
|
this.btnDrawCurve,
|
|
|
|
|
|
this.btnDrawPoint,
|
|
|
|
|
|
this.btnDrawText,
|
|
|
|
|
|
this.btiWellGroup,
|
|
|
|
|
|
this.btnDrawShape,
|
|
|
|
|
|
this.btnDrawNetFrame,
|
|
|
|
|
|
this.btnDrawProportion,
|
|
|
|
|
|
this.btnDrawCrossPointMain,
|
|
|
|
|
|
});
|
|
|
|
|
|
Guid guidDraw = new System.Guid("7dc7b1fa-7f07-4267-8679-9cee0b219d7a");
|
|
|
|
|
|
for (int i = 0; i < drawerBarItems.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
drawerBarItems[i].CategoryGuid = guidDraw;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
curveProcessItems = new List<BarItem>();
|
|
|
|
|
|
curveProcessItems.AddRange(new DevExpress.XtraBars.BarItem[]
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnCurveJoin,
|
|
|
|
|
|
this.btnCurveClose,
|
|
|
|
|
|
this.btnCurveReverse,
|
|
|
|
|
|
this.btnCurveTrim,
|
|
|
|
|
|
this.btnCurveBreakMain,
|
|
|
|
|
|
this.btnCurveExtend,
|
|
|
|
|
|
this.btnCurveNameMove,
|
|
|
|
|
|
this.btnCurveProcessMain,
|
|
|
|
|
|
this.btnCurveFill,
|
|
|
|
|
|
this.MergeCurve,
|
|
|
|
|
|
this.bbtnJoinCurves,
|
|
|
|
|
|
this.bbtnFaultBroaden,
|
|
|
|
|
|
this.bbtnFaultSimplyfy,
|
|
|
|
|
|
});
|
|
|
|
|
|
Guid guidProcess = new System.Guid("523e767c-6e94-4304-87af-07516dfbdf4b");
|
|
|
|
|
|
for (int i = 0; i < drawerBarItems.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
curveProcessItems[i].CategoryGuid = guidProcess;
|
|
|
|
|
|
}
|
|
|
|
|
|
// ???需要单独设置一次,原因未知。
|
|
|
|
|
|
this.bbtnFaultBroaden.CategoryGuid = guidProcess;
|
|
|
|
|
|
|
|
|
|
|
|
this.batchOperateItems = new List<BarItem>();
|
|
|
|
|
|
batchOperateItems.AddRange(new DevExpress.XtraBars.BarItem[]
|
|
|
|
|
|
{
|
|
|
|
|
|
this.barButtonGroup6,
|
|
|
|
|
|
this.barButtonGroup1,
|
|
|
|
|
|
//this.btnOrderTop,
|
|
|
|
|
|
//this.btnOrderBottom,
|
|
|
|
|
|
//this.btnOrderUp,
|
|
|
|
|
|
//this.btnOrderDown,
|
|
|
|
|
|
//this.btnAlignMain,
|
|
|
|
|
|
//this.btnPropertyZoomIn,
|
|
|
|
|
|
//this.btnPropertyZoomOut,
|
|
|
|
|
|
//this.SimplifyButton,
|
|
|
|
|
|
});
|
|
|
|
|
|
Guid guidOperate = new System.Guid("FF16E14D-D23D-49F7-9C40-454DBC9288F7");
|
|
|
|
|
|
for (int i = 0; i < batchOperateItems.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
batchOperateItems[i].CategoryGuid = guidOperate;
|
|
|
|
|
|
}
|
|
|
|
|
|
int nItemIndent = 2;
|
|
|
|
|
|
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
|
|
|
|
|
|
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
|
|
|
|
|
|
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
|
|
|
|
|
|
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
|
|
|
|
|
|
this.barDrawerBase = new DevExpress.XtraBars.Bar();
|
|
|
|
|
|
this.barDrawerBase.BarItemVertIndent = nItemIndent;
|
|
|
|
|
|
this.barDrawerBase.BarItemHorzIndent = nItemIndent;
|
|
|
|
|
|
this.barCurveProcess = new DevExpress.XtraBars.Bar();
|
|
|
|
|
|
this.barCurveProcess.BarItemVertIndent = nItemIndent;
|
|
|
|
|
|
this.barCurveProcess.BarItemHorzIndent = nItemIndent;
|
|
|
|
|
|
this.barBatchOperate = new DevExpress.XtraBars.Bar();
|
|
|
|
|
|
this.barBatchOperate.BarItemVertIndent = nItemIndent;
|
|
|
|
|
|
this.barBatchOperate.BarItemHorzIndent = nItemIndent;
|
|
|
|
|
|
this.bmDrawer = new DevExpress.XtraBars.BarManager(this.components);
|
|
|
|
|
|
this.dockManager1.MenuManager = this.bmDrawer;
|
|
|
|
|
|
((System.ComponentModel.ISupportInitialize)(this.bmDrawer)).BeginInit();
|
|
|
|
|
|
|
|
|
|
|
|
this.bmDrawer.Bars.AddRange(new DevExpress.XtraBars.Bar[]
|
|
|
|
|
|
{
|
|
|
|
|
|
this.barDrawerBase,
|
|
|
|
|
|
this.barCurveProcess,
|
|
|
|
|
|
this.barBatchOperate,
|
|
|
|
|
|
});
|
|
|
|
|
|
this.bmDrawer.Categories.AddRange(new DevExpress.XtraBars.BarManagerCategory[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new DevExpress.XtraBars.BarManagerCategory("绘图", new System.Guid("7dc7b1fa-7f07-4267-8679-9cee0b219d7a")),
|
|
|
|
|
|
new DevExpress.XtraBars.BarManagerCategory("曲线处理", new System.Guid("523e767c-6e94-4304-87af-07516dfbdf4b")),
|
|
|
|
|
|
new DevExpress.XtraBars.BarManagerCategory("批量处理", new System.Guid("FF16E14D-D23D-49F7-9C40-454DBC9288F7")),
|
|
|
|
|
|
});
|
|
|
|
|
|
this.bmDrawer.DockControls.Add(this.barDockControlTop);
|
|
|
|
|
|
this.bmDrawer.DockControls.Add(this.barDockControlBottom);
|
|
|
|
|
|
this.bmDrawer.DockControls.Add(this.barDockControlLeft);
|
|
|
|
|
|
this.bmDrawer.DockControls.Add(this.barDockControlRight);
|
|
|
|
|
|
this.bmDrawer.DockManager = this.dockManager1;
|
|
|
|
|
|
this.bmDrawer.Form = this;
|
|
|
|
|
|
|
|
|
|
|
|
//this.btnToolDefault.CategoryGuid = new System.Guid("7dc7b1fa-7f07-4267-8679-9cee0b219d7a");
|
|
|
|
|
|
|
|
|
|
|
|
// barDrawerBase
|
|
|
|
|
|
this.barDrawerBase.BarName = "DrawerBase";
|
|
|
|
|
|
this.barDrawerBase.DockCol = 0;
|
|
|
|
|
|
this.barDrawerBase.DockRow = 0;
|
|
|
|
|
|
this.barDrawerBase.DockStyle = DevExpress.XtraBars.BarDockStyle.Left;
|
|
|
|
|
|
this.barDrawerBase.FloatLocation = new System.Drawing.Point(91, 569);
|
|
|
|
|
|
this.barDrawerBase.Text = "绘图";
|
|
|
|
|
|
|
|
|
|
|
|
this.barCurveProcess.BarName = "CurveProcess";
|
|
|
|
|
|
this.barCurveProcess.DockCol = 0;
|
|
|
|
|
|
this.barCurveProcess.DockRow = 0;
|
|
|
|
|
|
this.barCurveProcess.DockStyle = DevExpress.XtraBars.BarDockStyle.Left;
|
|
|
|
|
|
this.barCurveProcess.Text = "曲线处理";
|
|
|
|
|
|
|
|
|
|
|
|
this.barBatchOperate.BarName = "BatchOperate";
|
|
|
|
|
|
this.barBatchOperate.DockCol = 0;
|
|
|
|
|
|
this.barBatchOperate.DockRow = 0;
|
|
|
|
|
|
this.barBatchOperate.DockStyle = DevExpress.XtraBars.BarDockStyle.Left;
|
|
|
|
|
|
this.barBatchOperate.Text = "批量处理";
|
|
|
|
|
|
|
|
|
|
|
|
// barDockControlTop
|
|
|
|
|
|
this.barDockControlTop.CausesValidation = false;
|
|
|
|
|
|
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
|
|
|
|
|
|
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
|
|
|
|
|
|
this.barDockControlTop.Manager = this.bmDrawer;
|
|
|
|
|
|
this.barDockControlTop.Size = new System.Drawing.Size(3656, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// barDockControlBottom
|
|
|
|
|
|
this.barDockControlBottom.CausesValidation = false;
|
|
|
|
|
|
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
|
|
|
|
|
this.barDockControlBottom.Location = new System.Drawing.Point(0, 1085);
|
|
|
|
|
|
this.barDockControlBottom.Manager = this.bmDrawer;
|
|
|
|
|
|
this.barDockControlBottom.Size = new System.Drawing.Size(3656, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// barDockControlLeft
|
|
|
|
|
|
this.barDockControlLeft.CausesValidation = false;
|
|
|
|
|
|
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
|
|
|
|
|
|
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
|
|
|
|
|
|
this.barDockControlLeft.Manager = this.bmDrawer;
|
|
|
|
|
|
this.barDockControlLeft.Size = new System.Drawing.Size(34, 1085);
|
|
|
|
|
|
|
|
|
|
|
|
// barDockControlRight
|
|
|
|
|
|
this.barDockControlRight.CausesValidation = false;
|
|
|
|
|
|
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
|
|
|
|
|
|
this.barDockControlRight.Location = new System.Drawing.Point(3656, 0);
|
|
|
|
|
|
this.barDockControlRight.Manager = this.bmDrawer;
|
|
|
|
|
|
this.barDockControlRight.Size = new System.Drawing.Size(0, 1085);
|
|
|
|
|
|
|
|
|
|
|
|
this.Controls.Add(this.barDockControlLeft);
|
|
|
|
|
|
this.Controls.Add(this.barDockControlRight);
|
|
|
|
|
|
this.Controls.Add(this.barDockControlBottom);
|
|
|
|
|
|
this.Controls.Add(this.barDockControlTop);
|
|
|
|
|
|
((System.ComponentModel.ISupportInitialize)(this.bmDrawer)).EndInit();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存界面布局信息到图件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SaveLayout()
|
|
|
|
|
|
{
|
|
|
|
|
|
using (MemoryStream ms = new MemoryStream())
|
|
|
|
|
|
{
|
|
|
|
|
|
bmDrawer.SaveLayoutToStream(ms);
|
|
|
|
|
|
ms.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
|
|
|
|
|
|
|
XDocument doc = XDocument.Load(ms);
|
|
|
|
|
|
var toolBarElement = doc.Descendants("property")
|
|
|
|
|
|
.FirstOrDefault(x => (string)x.Attribute("value") == "BarManager");
|
|
|
|
|
|
if (toolBarElement != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
toolBarElement.Save(layoutFilePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//bmDrawer.SaveLayoutToXml(Path.Combine(Application.StartupPath, "kevTestLayout.xml"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载界面布局状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void LoadLayout()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (File.Exists(layoutFilePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
//bmDrawer.RestoreLayoutFromXml(layoutFilePath);
|
|
|
|
|
|
var doc = XDocument.Load(layoutFilePath);
|
|
|
|
|
|
var bars = doc.Descendants("property").Where(x => (string)x.Attribute("name") == "Bars").FirstOrDefault();
|
|
|
|
|
|
foreach (var barElement in bars.Elements())
|
|
|
|
|
|
{
|
|
|
|
|
|
var eleBarName = barElement.Elements().Where(x => (string)x.Attribute("name") == "BarName").FirstOrDefault();
|
|
|
|
|
|
string barName = eleBarName?.Value;
|
|
|
|
|
|
var eleDockStyle = barElement.Elements().Where(x => (string)x.Attribute("name") == "DockStyle").FirstOrDefault();
|
|
|
|
|
|
string bockStyle = eleDockStyle?.Value;
|
|
|
|
|
|
var eleDockRow = barElement.Elements().Where(x => (string)x.Attribute("name") == "DockRow").FirstOrDefault();
|
|
|
|
|
|
string dockRow = eleDockRow?.Value;
|
|
|
|
|
|
var eleDockCol = barElement.Elements().Where(x => (string)x.Attribute("name") == "DockCol").FirstOrDefault();
|
|
|
|
|
|
string dockCol = eleDockCol?.Value;
|
|
|
|
|
|
var eleOffset = barElement.Elements().Where(x => (string)x.Attribute("name") == "Offset").FirstOrDefault();
|
|
|
|
|
|
string offset = eleDockCol?.Value;
|
|
|
|
|
|
|
|
|
|
|
|
var bar = this.bmDrawer.Bars.FirstOrDefault(b => b.BarName == barName);
|
|
|
|
|
|
if (bar != null && bockStyle != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
//bar.OptionsBar.MinHeight = 0;
|
|
|
|
|
|
//bar.OptionsBar.AutoPopupMode = BarAutoPopupMode.Default;
|
|
|
|
|
|
//bar.OptionsBar.DrawBorder = true;
|
|
|
|
|
|
//bar.OptionsBar.AllowCollapse = false;
|
|
|
|
|
|
//bar.OptionsBar.BarState = BarState.Expanded;
|
|
|
|
|
|
//bar.OptionsBar.DrawDragBorder = true;
|
|
|
|
|
|
//bar.OptionsBar.DrawSizeGrip = false;
|
|
|
|
|
|
//bar.OptionsBar.Hidden = false;
|
|
|
|
|
|
//bar.OptionsBar.MultiLine = false;
|
|
|
|
|
|
//bar.OptionsBar.RotateWhenVertical = true;
|
|
|
|
|
|
//bar.OptionsBar.UseWholeRow = false;
|
|
|
|
|
|
//bar.FloatSize = new System.Drawing.Size(0, 0);
|
|
|
|
|
|
//bar.FloatLocation = new System.Drawing.Point(0, 0);
|
|
|
|
|
|
bar.DockStyle = (BarDockStyle)Enum.Parse(typeof(BarDockStyle), bockStyle);
|
|
|
|
|
|
bar.DockRow = int.Parse(dockRow);
|
|
|
|
|
|
bar.DockCol = int.Parse(dockCol);
|
|
|
|
|
|
bar.Offset = int.Parse(offset);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Console.WriteLine($"Toolbar docking info loaded from {layoutFilePath}");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("Layout file not found.");
|
|
|
|
|
|
}
|
|
|
|
|
|
using (MemoryStream ms = new MemoryStream())
|
|
|
|
|
|
{
|
|
|
|
|
|
bmDrawer.SaveLayoutToStream(ms);
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (var bar in this.bmDrawer.Bars.ToArray())
|
|
|
|
|
|
{
|
|
|
|
|
|
bar.Visible = !bar.Visible;
|
|
|
|
|
|
bar.Visible = !bar.Visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 将 MainView 恢复成工具栏上设定的状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void RestoreState()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 恢复抗锯齿状态,保持和重新加载文件前一致
|
|
|
|
|
|
mainView.EnableMeshPack = bbtnMeshPack.Down;
|
|
|
|
|
|
// 这个放大状态难恢复,取消
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.Invalid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DrawerWaitProgress(object sender, ProgressEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//BeginInvoke(new Action(() =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (e.ProgerssVisible == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (splashScreenManager1 == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
splashScreenManager1 = new DevExpress.XtraSplashScreen.SplashScreenManager();
|
|
|
|
|
|
}
|
|
|
|
|
|
bool bVisible = splashScreenManager1.IsSplashFormVisible;
|
|
|
|
|
|
if (bVisible == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
splashScreenManager1.ShowWaitForm();
|
|
|
|
|
|
splashScreenManager1.SetWaitFormDescription(e.EventInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
splashScreenManager1.SetWaitFormDescription(e.EventInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (splashScreenManager1 != null && splashScreenManager1.IsSplashFormVisible == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
splashScreenManager1.CloseWaitForm();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//}));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载自定义菜单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void LoadCustomMenu()
|
|
|
|
|
|
{
|
|
|
|
|
|
CustomMenu customMenu = new CustomMenu();
|
|
|
|
|
|
customMenu.LoadItems();
|
|
|
|
|
|
if (customMenu.MenuItems.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ppmCustom.ClearLinks();
|
|
|
|
|
|
this.rpgCustom.Visible = true;
|
|
|
|
|
|
int nIndex = 109;
|
|
|
|
|
|
foreach (CustomMenuItem item in customMenu.MenuItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
DevExpress.XtraBars.BarButtonItem buttonItem = new BarButtonItem();
|
|
|
|
|
|
this.ribbonMain.Items.Add(buttonItem);
|
|
|
|
|
|
buttonItem.Tag = item;
|
|
|
|
|
|
buttonItem.Id = nIndex++;
|
|
|
|
|
|
buttonItem.Caption = item.Caption;
|
|
|
|
|
|
//buttonItem.RibbonStyle = RibbonItemStyles.Default;
|
|
|
|
|
|
buttonItem.Name = buttonItem.Caption;
|
|
|
|
|
|
buttonItem.RibbonStyle = (RibbonItemStyles)item.ImageTextStyles;
|
|
|
|
|
|
buttonItem.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.bbtnCustom_ItemClick);
|
|
|
|
|
|
// 设置菜单图标
|
|
|
|
|
|
if (!string.IsNullOrEmpty(item.SvgImage))
|
|
|
|
|
|
{
|
|
|
|
|
|
string strImageFile = Path.Combine(Application.StartupPath, item.SvgImage);
|
|
|
|
|
|
if (File.Exists(strImageFile))
|
|
|
|
|
|
{
|
|
|
|
|
|
buttonItem.ImageOptions.SvgImage = SvgImage.FromFile(strImageFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (item.IsPopupItem != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
buttonItem.RibbonStyle = RibbonItemStyles.SmallWithoutText;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ppmCustom.DrawMenuSideStrip = DevExpress.Utils.DefaultBoolean.True;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (item.IsPopupItem == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ppmCustom.ItemLinks.Add(buttonItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.rpgCustom.ItemLinks.Add(buttonItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.rpgCustom.Text = customMenu.GroupName;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
this.rpgCustom.Visible = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Process gisProcess = null;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 自定义菜单按钮事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private async void bbtnCustom_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
CustomMenuItem item = e.Item.Tag as CustomMenuItem;
|
|
|
|
|
|
if (item == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (item.Caption == "GIS导航")
|
|
|
|
|
|
{
|
|
|
|
|
|
bool gisIsRunning = gisProcess != null && !gisProcess.HasExited;
|
|
|
|
|
|
|
|
|
|
|
|
if (!gisIsRunning)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
gisProcess = Process.Start(new ProcessStartInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
FileName = item.ProgramFile,
|
|
|
|
|
|
UseShellExecute = true
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (gisProcess != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
gisProcess.WaitForInputIdle();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await Task.Delay(1000);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("无法启动 GIS 程序: " + ex.Message);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mainView.ViewControl?.Drawer.SendDataGIS();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
Assembly assembly = Assembly.LoadFrom(item.ProgramFile);
|
|
|
|
|
|
Type loggerType = assembly.GetType(item.ClassName);
|
|
|
|
|
|
IDrawerInteract drawerInteract = (IDrawerInteract)Activator.CreateInstance(loggerType);
|
|
|
|
|
|
Form testMain = drawerInteract.UserForm;
|
|
|
|
|
|
|
|
|
|
|
|
drawerInteract.DataRequestEvent += (object senderT, DrawerInterface.RequestDataEventArgs ea) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder strb = new StringBuilder();
|
|
|
|
|
|
// 获得选中的数据
|
|
|
|
|
|
if (ea.DataStatus == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<SigmaDrawerElement.DrawerElementProperty> elements = this.mainView?.GetSelectedElements();
|
|
|
|
|
|
if (elements != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = string.Empty;
|
|
|
|
|
|
foreach (SigmaDrawerElement.DrawerElementProperty ele in elements)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ele.Layer != strLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
strb.AppendLine($"Layer M {ele.Layer}");
|
|
|
|
|
|
strLayer = ele.Layer;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 如果是请求曲面上的点,从曲面上取出Z值
|
|
|
|
|
|
if (ea.DataType == (int)InterfaceDataType.PointOfSurface)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ele.Element.ElementType == DrawElementType.ELEMENT_POINT)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerPoint pt = ele.Element as DrawerPoint;
|
|
|
|
|
|
double dZValue = double.NaN;
|
|
|
|
|
|
if (mainView.GetGridPointValue(pt.X, pt.Y, ref dZValue) == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
pt.Z = dZValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
strb.AppendLine(ele.Element.ToDfdString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
string strRespons = strb.ToString();
|
|
|
|
|
|
drawerInteract.RequestDataProcess(new DrawerInterface.ResponseDataEventArgs(strRespons));
|
|
|
|
|
|
}
|
|
|
|
|
|
//string strQuest = ea.DataInfo;
|
|
|
|
|
|
//MessageBox.Show(strQuest);
|
|
|
|
|
|
};
|
|
|
|
|
|
drawerInteract.DataResponseEvent += (object senderT, ResponseDataEventArgs ea) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
string strData = ea.DataContent;
|
|
|
|
|
|
//MessageBox.Show(strData);
|
|
|
|
|
|
this.mainView?.AddBufferData(strData);
|
|
|
|
|
|
//MessageBox.Show("Finished");
|
|
|
|
|
|
mainView?.ToolRedraw();
|
|
|
|
|
|
mainView?.LoadLayerTree();
|
|
|
|
|
|
//Xy xyDfd = new Xy();
|
|
|
|
|
|
//xyDfd.DfdReadBuffer(strData);
|
|
|
|
|
|
//foreach (DrawerElementBase ele in xyDfd.Elements)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (ele is DrawerPoint pt)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// this.mainView?.AddDrawPoint(
|
|
|
|
|
|
// ele.LayerName,
|
|
|
|
|
|
// new SigmaDrawerElement.DrawerPoint(pt.Name, pt.X, pt.Y, pt.Z, pt.Angle));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// else if (ele is DrawerLine line)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// List<PointD> lstData = new List<PointD>();
|
|
|
|
|
|
// foreach (DrawerLineNode node in line.Nodes)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// lstData.Add(new PointD(node.X, node.Y));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// this.mainView?.AddDrawCurve(line.LayerName, line.Name, lstData);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (xyDfd.Elements.Count > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// mainView?.ToolRedraw();
|
|
|
|
|
|
// mainView?.LoadLayerTree();
|
|
|
|
|
|
//}
|
|
|
|
|
|
};
|
|
|
|
|
|
testMain.StartPosition = FormStartPosition.CenterParent;
|
|
|
|
|
|
testMain.Show(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
Process.Start(new ProcessStartInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
FileName = item.ProgramFile,
|
|
|
|
|
|
UseShellExecute = true,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception processEx)
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show(
|
|
|
|
|
|
$"无法启动程序: {processEx.Message}",
|
|
|
|
|
|
"错误",
|
|
|
|
|
|
MessageBoxButtons.OK,
|
|
|
|
|
|
MessageBoxIcon.Error);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 弹出菜单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void rpgCustom_CaptionButtonClick(object sender, RibbonPageGroupEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ppmCustom.ShowPopup(this.ribbonMain.Manager, MousePosition);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The MainView_ShowStatisticResult.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
private void MainView_ShowStatisticResult(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
StatisticPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
ShowStatisticResult?.Invoke(this, e);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图件是否有修改
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>有修改/无</returns>
|
|
|
|
|
|
public bool IsModified()
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView != null && mainView.IsDocumentModified();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 窗体关闭事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">当前窗体.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
public void UCDrawEdit_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bModified = false;
|
|
|
|
|
|
if (mainView != null && mainView.IsDocumentModified())
|
|
|
|
|
|
{
|
|
|
|
|
|
bModified = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (bModified)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (DevExpress.XtraEditors.XtraMessageBox.Show(
|
|
|
|
|
|
"是否将修改保存到文件?", "关闭",
|
|
|
|
|
|
MessageBoxButtons.YesNoCancel,
|
|
|
|
|
|
MessageBoxIcon.Question))
|
|
|
|
|
|
{
|
|
|
|
|
|
case DialogResult.Cancel:
|
|
|
|
|
|
e.Cancel = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DialogResult.Yes:
|
|
|
|
|
|
e.Cancel = !SaveFile();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (e.Cancel != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The UCDrawEdit_FormClosed.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="FormClosedEventArgs"/>.</param>
|
|
|
|
|
|
private void UCDrawEdit_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
FileClosedEvent?.Invoke(this, e);
|
|
|
|
|
|
mainView.ViewerCommandStart -= OnCommandStart;
|
|
|
|
|
|
mainView.ViewerCommandFinish -= OnCommandFinish;
|
|
|
|
|
|
mainView.ShowStatisticResult -= MainView_ShowStatisticResult;
|
|
|
|
|
|
mainView = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The OnCommandFinish.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="toolType">The toolType<see cref="DrawToolType"/>.</param>
|
|
|
|
|
|
private void OnCommandFinish(DrawToolType toolType)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bChecked = false;
|
|
|
|
|
|
switch (toolType)
|
|
|
|
|
|
{
|
|
|
|
|
|
//case DrawToolType.Default:
|
|
|
|
|
|
// tsbToolDefault.Checked = bChecked;
|
|
|
|
|
|
// break;
|
|
|
|
|
|
//case DrawToolType.ViewPan:
|
|
|
|
|
|
// tsbPan.Checked = bChecked;
|
|
|
|
|
|
// break;
|
|
|
|
|
|
case DrawToolType.ViewWindow:
|
|
|
|
|
|
//tsbViewWindow.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Select:
|
|
|
|
|
|
//tsbSelect.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Point:
|
|
|
|
|
|
//tsbPointAdd.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Curve:
|
|
|
|
|
|
//tsbCurveAdd.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Proportion:
|
|
|
|
|
|
//tsbProportionAdd.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.RectangularCSGrid:
|
|
|
|
|
|
//rectangularCSGridButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Rectangle:
|
|
|
|
|
|
//drawRectangleButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Ellipse:
|
|
|
|
|
|
//sbtnEllipse.Checked = btnEllipse.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Arc:
|
|
|
|
|
|
btnDrawArc.Down = bChecked;
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Chord:
|
|
|
|
|
|
btnDrawChord.Down = bChecked;
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Pie:
|
|
|
|
|
|
btnDrawFan.Down = bChecked;
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Equilateral:
|
|
|
|
|
|
btnDrawPentagon.Down = bChecked;
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Text:
|
|
|
|
|
|
//drawTextButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.BreakDirect:
|
|
|
|
|
|
barButtonItem3.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Break:
|
|
|
|
|
|
barButtonItem2.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.ConnectCurveFilling:
|
|
|
|
|
|
btnIntersectRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.SolidLink:
|
|
|
|
|
|
btnLinkRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.SolidAuto:
|
|
|
|
|
|
btnAutoRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Delete: //?是不是立刻就执行完的命令
|
|
|
|
|
|
//deleteNormalButton.Checked = bChecked;
|
|
|
|
|
|
btnDelete.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteIn:
|
|
|
|
|
|
btnDeleteInRegion.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteOut:
|
|
|
|
|
|
btnDeleteOutRegion.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteCondition:
|
|
|
|
|
|
//btnDeleteMain.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.TrimCurve:
|
|
|
|
|
|
//btnDeleteMain.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CloseCurve:
|
|
|
|
|
|
//closeCurveButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.MoveCurveName:
|
|
|
|
|
|
//moveCurveNameButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.LinkCurve:
|
|
|
|
|
|
//linkCurveButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.ReverseCurve:
|
|
|
|
|
|
//reverseCurveButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.NameToZ:
|
|
|
|
|
|
//nameToZButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.RangeToImage:
|
|
|
|
|
|
//tsbCopyImageAll.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.WindowToImage:
|
|
|
|
|
|
//tsbCopyImageWindow.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.FractionPoint:
|
|
|
|
|
|
btnDrawFractionPoint.Down = bChecked;
|
|
|
|
|
|
SetCrossPointMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CrossPoint:
|
|
|
|
|
|
btnDrawCrossPoint.Down = bChecked;
|
|
|
|
|
|
SetCrossPointMainStatus();
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.PointPropertyClear:
|
|
|
|
|
|
case DrawToolType.PointPropertySet:
|
|
|
|
|
|
case DrawToolType.CurvePropertySet:
|
|
|
|
|
|
case DrawToolType.CurvePropertyClear:
|
|
|
|
|
|
barButtonItem76.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CutOutByPickup:
|
|
|
|
|
|
btnCutOutPick.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CutOutByRect:
|
|
|
|
|
|
btnCutOutRectangle.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CutInByPickup:
|
|
|
|
|
|
btnCutInPickup.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CutInByRect:
|
|
|
|
|
|
btnCutInRectangle.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CurveNameSetting:
|
|
|
|
|
|
btnCurveNameSet.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CurveZFromSurface:
|
|
|
|
|
|
bbtnSurfaceCurveZ.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CurveBroaden:
|
|
|
|
|
|
bbtnFaultBroaden.Down = false;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置当前按钮.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="toolType">操作类型.</param>
|
|
|
|
|
|
private void OnCommandStart(DrawToolType toolType)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool bChecked = true;
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.Invalid);
|
|
|
|
|
|
|
|
|
|
|
|
switch (toolType)
|
|
|
|
|
|
{
|
|
|
|
|
|
//case DrawToolType.ViewPan:
|
|
|
|
|
|
// tsbPan.Checked = bChecked;
|
|
|
|
|
|
// break;
|
|
|
|
|
|
case DrawToolType.ViewWindow:
|
|
|
|
|
|
btnZoomWindow.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Default:
|
|
|
|
|
|
btnToolDefault.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Select:
|
|
|
|
|
|
btnToolSelect.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Point:
|
|
|
|
|
|
btnDrawPoint.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Curve:
|
|
|
|
|
|
btnDrawCurve.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Proportion:
|
|
|
|
|
|
btnDrawProportion.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.RectangularCSGrid:
|
|
|
|
|
|
btnDrawNetFrame.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Rectangle:
|
|
|
|
|
|
btnDrawRectangle.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Ellipse:
|
|
|
|
|
|
btnDrawEllipse.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Arc:
|
|
|
|
|
|
//sbtnEllipse.Checked = btnArc.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Chord:
|
|
|
|
|
|
//sbtnEllipse.Checked = btnChord.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Pie:
|
|
|
|
|
|
//sbtnEllipse.Checked = btnPie.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Equilateral:
|
|
|
|
|
|
//sbtnEllipse.Checked = btnEquilateral.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Text:
|
|
|
|
|
|
btnDrawText.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.BreakDirect:
|
|
|
|
|
|
barButtonItem3.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Break:
|
|
|
|
|
|
barButtonItem2.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.ConnectCurveFilling:
|
|
|
|
|
|
btnIntersectRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.SolidLink:
|
|
|
|
|
|
btnLinkRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.SolidAuto:
|
|
|
|
|
|
btnAutoRegionFill.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.Delete: //?是不是立刻就执行完的命令
|
|
|
|
|
|
//deleteNormalButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteIn:
|
|
|
|
|
|
//deleteInButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteOut:
|
|
|
|
|
|
//deleteOutButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.DeleteCondition:
|
|
|
|
|
|
//conditionButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.TrimCurve:
|
|
|
|
|
|
btnCurveTrim.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CloseCurve:
|
|
|
|
|
|
btnCurveClose.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.MoveCurveName:
|
|
|
|
|
|
btnCurveNameMove.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.LinkCurve:
|
|
|
|
|
|
btnCurveJoin.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.ReverseCurve:
|
|
|
|
|
|
btnCurveReverse.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.NameToZ:
|
|
|
|
|
|
//nameToZButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.RangeToImage:
|
|
|
|
|
|
//// tsbCopyImageAll.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.WindowToImage:
|
|
|
|
|
|
//// tsbCopyImageWindow.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CrossPoint:
|
|
|
|
|
|
//crossPointButton.Checked = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.PointPropertyClear:
|
|
|
|
|
|
case DrawToolType.PointPropertySet:
|
|
|
|
|
|
case DrawToolType.CurvePropertySet:
|
|
|
|
|
|
case DrawToolType.CurvePropertyClear:
|
|
|
|
|
|
barButtonItem76.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CurveZFromSurface:
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case DrawToolType.CurveBroaden:
|
|
|
|
|
|
bbtnFaultBroaden.Down = bChecked;
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The UCDrawEdit_Load.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
private void UCDrawEdit_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 加载子窗体布局
|
|
|
|
|
|
LoadLayout();
|
|
|
|
|
|
//// 自动保存工具条布局
|
|
|
|
|
|
//string regKey = "Kev\\XtraBars\\Layouts\\" + this.Name + ".bmDrawer." + bmDrawer.LayoutVersion;
|
|
|
|
|
|
////this.bmDrawer.RestoreLayoutFromRegistry(regKey);
|
|
|
|
|
|
//this.bmDrawer.RegistryPath = regKey;
|
|
|
|
|
|
//this.bmDrawer.AutoSaveInRegistry = true;
|
|
|
|
|
|
// this.LayerPanel.Visibility = DockVisibility.Hidden;
|
|
|
|
|
|
// ppcEditorMeshPack.PopupControl.OwnerEdit.EditValue = "断层测试";
|
|
|
|
|
|
Application.Idle += Application_Idle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The SetRibbonStatus.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="enable">The enable<see cref="bool"/>.</param>
|
|
|
|
|
|
public void SetRibbonStatus(bool enable)
|
|
|
|
|
|
{
|
|
|
|
|
|
RibbonBarItems barItems = ribbonMain.Items;
|
|
|
|
|
|
foreach (var item in barItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
((BarItem)item).Enabled = enable;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Defines the toolCurrent.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private DrawToolType toolCurrent = DrawToolType.Default;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Application_Idle.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
private void Application_Idle(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawToolType tool = mainView.ActiveTool;
|
|
|
|
|
|
|
|
|
|
|
|
// 打断、切断
|
|
|
|
|
|
var breakTools = new[] { DrawToolType.BreakDirect, DrawToolType.Break };
|
|
|
|
|
|
// 区域填充
|
|
|
|
|
|
var fillTools = new[] { DrawToolType.ConnectCurveFilling, DrawToolType.SolidLink, DrawToolType.SolidAuto };
|
|
|
|
|
|
// 外切
|
|
|
|
|
|
var cutOutTools = new[] { DrawToolType.CutOutByRect, DrawToolType.CutOutByPickup };
|
|
|
|
|
|
// 内切
|
|
|
|
|
|
var cutInTools = new[] { DrawToolType.CutInByRect, DrawToolType.CutInByPickup };
|
|
|
|
|
|
// 曲线名称
|
|
|
|
|
|
var curveNameTools = new[] { DrawToolType.CurveNameSetting, DrawToolType.SetContourName, DrawToolType.NameToZ, DrawToolType.ZToName, DrawToolType.FindCurveOfEmptyName };
|
|
|
|
|
|
// 形状
|
|
|
|
|
|
var drawShapeTools = new[] { DrawToolType.Arc, DrawToolType.Chord, DrawToolType.Pie, DrawToolType.Equilateral, DrawToolType.Rectangle, DrawToolType.Ellipse };
|
|
|
|
|
|
// 十字点
|
|
|
|
|
|
var crossPointTools = new[] { DrawToolType.FractionPoint, DrawToolType.CrossPoint };
|
|
|
|
|
|
// 曲线处理
|
|
|
|
|
|
var curveProcessTools = new[] { DrawToolType.CurveDensityNode, DrawToolType.CurveRedundancy, DrawToolType.CurveSmooth, DrawToolType.ArcToCurve, DrawToolType.CurveZFromSurface };
|
|
|
|
|
|
|
|
|
|
|
|
btnCurveBreakMain.Down = breakTools.Contains(tool);
|
|
|
|
|
|
btnCurveFill.Down = fillTools.Contains(tool);
|
|
|
|
|
|
btnCutOutMain.Down = cutOutTools.Contains(tool);
|
|
|
|
|
|
btnCutInMain.Down = cutInTools.Contains(tool);
|
|
|
|
|
|
btnCurveNameMain.Down = curveNameTools.Contains(tool);
|
|
|
|
|
|
btnDrawShape.Down = drawShapeTools.Contains(tool);
|
|
|
|
|
|
btnDrawCrossPointMain.Down = crossPointTools.Contains(tool);
|
|
|
|
|
|
btnCurveProcessMain.Down = curveProcessTools.Contains(tool);
|
|
|
|
|
|
|
|
|
|
|
|
toolCurrent = tool;
|
|
|
|
|
|
|
|
|
|
|
|
// 移动状态按钮设置
|
|
|
|
|
|
btnZoomPan.Down = (mainView.ViewStatus == ViewOperationKind.ViewPan);
|
|
|
|
|
|
btnZoomWindow.Down = (mainView.ViewStatus == ViewOperationKind.ViewWindow);
|
|
|
|
|
|
|
|
|
|
|
|
if (mainView.ViewStatus == ViewOperationKind.Invalid)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnZoomPan.Down = false;
|
|
|
|
|
|
btnZoomWindow.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打开文件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="fileFullName">文件路径.</param>
|
|
|
|
|
|
/// <param name="setZColor">Z值显示为块.</param>
|
|
|
|
|
|
/// <returns>是否成功.</returns>
|
|
|
|
|
|
public bool OpenFile(string fileFullName, bool setZColor = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (setZColor == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ZColorWidth = ZColorWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
EnableMeshPack = DrawerGlobalConfig.Instance.MeshNode.AntiAliasingEnable;
|
|
|
|
|
|
|
|
|
|
|
|
if (mainView.OpenFile(fileFullName, setZColor) == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// initDrawerView(mainView);
|
|
|
|
|
|
bdtFaultLayer.EditValue = "断层";
|
|
|
|
|
|
InitDrawerView();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The CreateNewFile.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="fileName">The fileName<see cref="string"/>.</param>
|
|
|
|
|
|
/// <returns>The <see cref="bool"/>.</returns>
|
|
|
|
|
|
public bool CreateNewFile(string fileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainView.NewFile(fileName) == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
InitDrawerView();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存文件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>是否成功.</returns>
|
|
|
|
|
|
public bool SaveFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
bool ret = false;
|
|
|
|
|
|
if (mainView.IsNewDocument)
|
|
|
|
|
|
{
|
|
|
|
|
|
ret = SaveAs();
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (mainView.SaveFile())
|
|
|
|
|
|
{
|
|
|
|
|
|
Text = mainView.Text;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据名称选中图元,多个名称用逗号分隔
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="nameData">名称数据</param>
|
|
|
|
|
|
/// <returns>选中的数量</returns>
|
|
|
|
|
|
public int SelectByNames(string nameData)
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.SelectByNames(nameData);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据名称查找并激活图元
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="content">图元名称</param>
|
|
|
|
|
|
/// <param name="matchAll">全字匹配</param>
|
|
|
|
|
|
/// <param name="matchCase">匹配大小写</param>
|
|
|
|
|
|
/// <param name="elementType">图元类型</param>
|
|
|
|
|
|
/// <param name="editableOnly">是否只查找可编辑图元</param>
|
|
|
|
|
|
/// <returns>查找结果</returns>
|
|
|
|
|
|
public int FindElementByName(string content, bool matchAll = false, bool matchCase = false, int elementType = 0, bool editableOnly = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
return mainView.FindElementByName(content, matchAll, matchCase, elementType, editableOnly);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 另存为.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>是否成功.</returns>
|
|
|
|
|
|
public bool SaveAs()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainView.SaveAs())
|
|
|
|
|
|
{
|
|
|
|
|
|
Text = mainView.Text;
|
|
|
|
|
|
NewFileSavedEvent?.Invoke(mainView.FileFullName);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 导出为图片.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">导出按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnExportImg_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
// mainView.ReloadFile();
|
|
|
|
|
|
mainView.Export2Image(string.Empty);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnKeyUp(object sender, PreviewKeyDownEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.KeyCode == Keys.S && e.Modifiers == Keys.Control)
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveFile();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The InitDrawerView.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void InitDrawerView()
|
|
|
|
|
|
{
|
|
|
|
|
|
MainView viewer = mainView;
|
|
|
|
|
|
//viewer.ToolMainVisible = false;
|
|
|
|
|
|
//viewer.DrawerGotFocus += (object sender, EventArgs ea) =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// Trace.WriteLine("openFile:" + ea.ToString());
|
|
|
|
|
|
//};
|
|
|
|
|
|
//viewer.ShowStatisticResult += Viewer_ShowStatisticResult;
|
|
|
|
|
|
viewer.ZColorWidth = ZColorWidth;
|
|
|
|
|
|
// 设置文档标题栏
|
|
|
|
|
|
Text = viewer.Text;
|
|
|
|
|
|
viewer.FileModifyEvent += Viewer_FileModifyEvent;
|
|
|
|
|
|
//viewer.GetLengthAngleEvent += GetLengthAngle;
|
|
|
|
|
|
Controls.Add(viewer.ViewControl);
|
|
|
|
|
|
viewer.ViewControl.BringToFront();
|
|
|
|
|
|
viewer.ViewControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
|
|
|
|
|
|
if (LayerPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.Text = $"{viewer.CurrentLayer}";
|
|
|
|
|
|
}
|
|
|
|
|
|
viewer.LayerSelected += SetCurrentLayer;
|
|
|
|
|
|
viewer.ToolStatusChandedEvent += new ToolStatusChangedHandler((cmd, enable) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cmd.Equals("undo"))
|
|
|
|
|
|
{
|
|
|
|
|
|
btnUndo.Enabled = enable;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (cmd.Equals("redo"))
|
|
|
|
|
|
{
|
|
|
|
|
|
btnRedo.Enabled = enable;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (cmd.Equals("undoView"))
|
|
|
|
|
|
{
|
|
|
|
|
|
btnZoomBack.Enabled = enable;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
if (StatusBarVisible == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
viewer.MouseMoveXYEvent += new XyStatusEventHandler((info) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
statusXY.Caption = info;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Viewer_FileModifyEvent.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="isModified">The isModified<see cref="bool"/>.</param>
|
|
|
|
|
|
private void Viewer_FileModifyEvent(object sender, bool isModified)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text = mainView.Text;
|
|
|
|
|
|
FileModifiedEvent?.Invoke(sender, isModified);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The SetCurrentLayer.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="send">The send<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="PropertyChangedEventArgs"/>.</param>
|
|
|
|
|
|
private void SetCurrentLayer(object send, PropertyChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LayerPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.Text = $" {e.PropertyName}";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 放大.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomIn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolZoomIn();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 缩小.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomOut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolZoomOut();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置窗口浏览状态.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomWindow_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnZoomWindow.Down == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
//mainView.ToolDefault();
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.ViewWindow);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.Invalid);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置拖动浏览模式.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomPan_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnZoomPan.Down == true)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.ViewPan);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.SetViewOperation(ViewOperationKind.Invalid);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 显示全图事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolViewAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 回退显示状态.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnZoomBack_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolZoomBack();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图形刷新.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 显示十字辅助线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnShowCross_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCrossEnable(btnShowCross.Down);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 撤销操作.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnUndo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolUndo();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重做操作.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnRedo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRedo();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 取消下拉主按钮状态
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//private void UncheckEditorMainDrop(Control exceptControl)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// for (int i = 0; i < this.lstMutuallyButton.Count; i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (exceptControl != null && lstMutuallyButton[i].Equals(exceptControl))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// lstMutuallyButton[i].Down = false;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 默认状态.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">e</param>
|
|
|
|
|
|
private void btnToolDefault_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnToolDefault.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnToolDefault_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnToolDefault_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 元素选择状态.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnToolSelect_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnToolSelect.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSelect();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnToolSelect_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnToolSelect_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawCurve.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAddCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawPoint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawPoint.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAddPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制文字.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawText_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawText.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolText();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制矩形.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawRectangle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawRectangle.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRectangle();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制椭圆.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawEllipse_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawEllipse.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolEllipse();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制坐标框.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawNetFrame_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawNetFrame.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCSGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制比例尺.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawProportion_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawProportion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAddProportion();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线连接.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveJoin_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveJoin.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolJoinCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线打断.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveBreak_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveBreakMain.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolBreakCurve();
|
|
|
|
|
|
barButtonItem2.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//btnToolDefault.Down = true;
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The barButtonItem2_ItemClick.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (barButtonItem2.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolBreakCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线切割.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveCut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (barButtonItem3.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolBreakDirect();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The barButtonItem2_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void barButtonItem2_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (barButtonItem2.Down || barButtonItem3.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveBreakMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The barButtonItem3_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void barButtonItem3_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (barButtonItem2.Down || barButtonItem3.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveBreakMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线闭合.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveClose.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCloseCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线充填.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveFill_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCurveConnectFill();
|
|
|
|
|
|
btnIntersectRegionFill.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线延伸.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveExtend_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveExtend.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolExtendCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 裁切.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveTrim_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveTrim.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolTrimCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线反向.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveReverse_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveReverse.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolReverseCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线内部名称移动.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveNameMove_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveNameMove.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolMoveCurveName();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 最上显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnOrderTop_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolOrderTop();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 最下显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnOrderBottom_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolOrderBottom();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 上移一层显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnOrderUp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolOrderUp();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 下移一层显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnOrderDown_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolOrderDown();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 属性放大.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnPropertyZoomIn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.PropertyZoomIn();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 属性缩小.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnPropertyZoomOut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.PropertyZoomOut();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 粘贴.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnPaste_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolPaste();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 复制.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCopy();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 剪切.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCut_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCut();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">删除主按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDeleteMain_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDelete.Down = btnDeleteMain.Down;
|
|
|
|
|
|
if (btnDeleteMain.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDeleteNormal();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.RestoreToolDefault();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = btnDelete.Down;
|
|
|
|
|
|
if (btnDelete.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDeleteNormal();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDelete_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDelete_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDelete.Down || btnDeleteOutRegion.Down || btnDeleteInRegion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除区域外图形.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDeleteOutRegion_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = btnDeleteOutRegion.Down;
|
|
|
|
|
|
if (btnDeleteOutRegion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDeleteOut();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDeleteOutRegion_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDeleteOutRegion_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDelete.Down || btnDeleteOutRegion.Down || btnDeleteInRegion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除区域内部.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDeleteInRegion_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = btnDeleteInRegion.Down;
|
|
|
|
|
|
if (btnDeleteInRegion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDeleteIn();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDeleteInRegion_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDeleteInRegion_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDelete.Down || btnDeleteOutRegion.Down || btnDeleteInRegion.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDeleteMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查找.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSearchMain_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolFind(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查找.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnFind_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolFind(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 替换.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnReplace_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolFind(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 筛选.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnFilter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolFilter();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 全选.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSelectAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSelectAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择所有线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSelectAllCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSelectAllCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择所有点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSelectAllPoint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSelectAllPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清除点个性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnClearPointProperty_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolClearPointProperty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置点类个性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSetPointPropert_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSetPointProperty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清除线类个性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnClearCurveProperty_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolClearCurveProperty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置线个性.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSetCurveProperty_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSetCurveProperty();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 左对齐.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignLeft_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignLeft();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 右对齐.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignRight_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignRight();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 顶对齐.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignTop_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignTop();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 底对齐.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignBottom_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignBottom();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 垂直居中.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignMiddle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignCenterV();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 水平居中.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAlignCenter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAlignCenterH();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 水平镜像.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnMirrorH_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolMirrorH();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 垂直镜像.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnMirrorV_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolMirrorV();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 坐标运算.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCoordinateCalculate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCoordinateChange();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 坐标交换.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCoordinateExchange_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCoordinateExchange();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据导入.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ImportDataFile();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据导出.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ExportDataFile();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 矩形区域截图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnImageCutRectangle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolImageCutRange();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 自定义截图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void btnImageCutEx_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolImageCutRangeEx();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 截图所有图元.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnImageCutAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolImageCutAll();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 截图窗口区域.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnImageCutWindow_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolImageCutWindow();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 生成文件保存路径.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="extName">.</param>
|
|
|
|
|
|
/// <returns>事件参数.</returns>
|
|
|
|
|
|
private string GetSaveFileName(string extName)
|
|
|
|
|
|
{
|
|
|
|
|
|
var sfd = new SaveFileDialog();
|
|
|
|
|
|
sfd.Filter = extName;
|
|
|
|
|
|
sfd.FileName = "新建文件";
|
|
|
|
|
|
sfd.AddExtension = true;
|
|
|
|
|
|
sfd.RestoreDirectory = true;
|
|
|
|
|
|
if (sfd.ShowDialog(this) != DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sfd.FileName.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存为符号.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTake2Symbol_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.FileSaveToMark();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存为Xyz.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTake2Xyz_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "XYZ File (*.xyz)|*.xyz|All Files(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.FileSaveToXyz(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存曲线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">v.</param>
|
|
|
|
|
|
private void btnTakeCurves_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.FileSaveCurve(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存显示的内容.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakeDisplay_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
mainView.FileSaveView(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存充填的内容.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakeFilled_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.FileSaveSolid(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存点数据.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakePoints_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.FileSavePoint(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存净曲线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakePurerCurves_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.FileSaveCleanCurve(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存选中的内容.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakeSelected_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
mainView.FileSaveSelect(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存文字.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnTakeTexts_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string extName = "KE Files (*.kev)|*.kev|All file(*.*)|*.*||";
|
|
|
|
|
|
string filePath = GetSaveFileName(extName);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.FileSaveText(filePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 合并文件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnMergeFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//var openFile = new OpenFileDialog();
|
|
|
|
|
|
//openFile.Title = "合并文件";
|
|
|
|
|
|
//openFile.Filter = "*.kev|*.kev|*.pcg|*.pcg|*.*|*.*";
|
|
|
|
|
|
//openFile.FilterIndex = 0;
|
|
|
|
|
|
//openFile.Multiselect = false;
|
|
|
|
|
|
//if (openFile.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// mainView.FileMerge(openFile.FileName);
|
|
|
|
|
|
// mainView.ToolRedraw();
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 平面图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnPlaneFigure_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var openFile = new OpenFileDialog();
|
|
|
|
|
|
openFile.Title = "合并文件";
|
|
|
|
|
|
openFile.Filter = "*.kev|*.kev|*.pcg|*.pcg|*.*|*.*";
|
|
|
|
|
|
openFile.FilterIndex = 0;
|
|
|
|
|
|
openFile.Multiselect = false;
|
|
|
|
|
|
if (openFile.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.FileMerge(openFile.FileName);
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 单井图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnWellFigure_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var openFile = new OpenFileDialog();
|
|
|
|
|
|
openFile.Title = "合并单井图文件";
|
|
|
|
|
|
openFile.Filter = "*.pcg|*.pcg";
|
|
|
|
|
|
openFile.FilterIndex = 0;
|
|
|
|
|
|
openFile.Multiselect = false;
|
|
|
|
|
|
if (openFile.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.WellPoleFileMerge(openFile.FileName);
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 剖面图.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnSectionFigure_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var openFile = new OpenFileDialog();
|
|
|
|
|
|
openFile.Title = "合并剖面图文件";
|
|
|
|
|
|
openFile.Filter = "*.pcg|*.pcg";
|
|
|
|
|
|
openFile.FilterIndex = 0;
|
|
|
|
|
|
openFile.Multiselect = false;
|
|
|
|
|
|
if (openFile.ShowDialog() == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.MultiWellSectionFileMerge(openFile.FileName);
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置投影参数.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnProjection_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSetProjection();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 转换投影.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnProjectionChange_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolProjectionChange();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打印.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnPrint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.PrintDraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSaveMain_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!SaveFile())
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("保存文件失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 另存为.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnSaveAs_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveAs();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 背景网格.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnBKGrid_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.DisplayBackgroundGrid(btnBKGrid.Down);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置背景网格尺寸.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnBkGridSize_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSetBKGridSize();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 高亮提示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnHighLight_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolEnableHighLight(btnHighLight.Down);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绘制弧.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawArc_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
if (btnDrawArc.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAcr();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 画弓形.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawChord_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
if (btnDrawChord.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolChord();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 画扇形.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawFan_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
if (btnDrawFan.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolPie();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 画五边形.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawPentagon_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//SetDrawShapeMainStatus();
|
|
|
|
|
|
if (btnDrawPentagon.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolEquilateral();
|
|
|
|
|
|
// btnDrawShape.ImageOptions.Image =
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDrawShape_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDrawShape_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 分数点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void btnDrawFractionPoint_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetCrossPointMainStatus();
|
|
|
|
|
|
if (btnDrawFractionPoint.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDrawFractionPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 十字点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnDrawCrossPoint_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetCrossPointMainStatus();
|
|
|
|
|
|
if (btnDrawCrossPoint.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolAddCrossPoint();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDrawCrossPointMain_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDrawCrossPointMain_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetCrossPointMainStatus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置十字点主按钮的选中状态.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void SetCrossPointMainStatus()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnDrawCrossPoint.Down || btnDrawFractionPoint.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDrawCrossPointMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnDrawCrossPointMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 外切矩形式.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutOutRectangle_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutOutRectangle.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutOutMain.Down = true;
|
|
|
|
|
|
mainView.ToolCutOutByRect();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 外切拾取式.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutOutPick_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutOutPick.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutOutMain.Down = true;
|
|
|
|
|
|
mainView.ToolCutOutByPickup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 外切主菜单.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutOutMain_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutOutRectangle.Down || btnCutOutPick.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutOutMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutOutMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 内切拾取式.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutInPickup_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutInPickup.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutInMain.Down = true;
|
|
|
|
|
|
mainView.ToolCutInByPickup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 内切矩形式.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutInRectangle_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutInRectangle.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutInMain.Down = true;
|
|
|
|
|
|
mainView.ToolCutInByRect();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 内切主按钮.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCutInMain_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCutInPickup.Down || btnCutInRectangle.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutInMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCutInMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线处理主参数.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The source of the event.</param>
|
|
|
|
|
|
/// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param>
|
|
|
|
|
|
private void btnCurveProcessMain_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bbtnCurveSmooth.Down || bbtnShape2Curve.Down
|
|
|
|
|
|
|| bbtnSurfaceCurveZ.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.btnCurveNameMain.Down != true)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnCurveNameMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (this.btnCurveNameMain.Down != false)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.btnCurveNameMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线名称主按钮.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveNameMain_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveNameSet.Down || btnCurveName2Z.Down ||
|
|
|
|
|
|
btnCurveNameFromZ.Down || btnCurveNameFindEmpty.Down
|
|
|
|
|
|
|| btnContourNameSet.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置曲线名称.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveNameSet_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveNameSet.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
mainView.ToolCurveNameSet();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等值线名称设置.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnContourNameSet_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnContourNameSet.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
mainView.ToolSetContourName();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnCurveName2Z_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnCurveName2Z_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveName2Z.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
mainView.ToolCurveName2z();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnCurveNameFromZ_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnCurveNameFromZ_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveNameFromZ.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
mainView.ToolCurveZ2Name();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnCurveNameFindEmpty_DownChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnCurveNameFindEmpty_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnCurveNameFindEmpty.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveNameMain.Down = true;
|
|
|
|
|
|
mainView.ToolCurveFindEmptyName();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 网格生成等值线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnGridGenerateContour_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.GridGeneraterContour();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 网格平滑.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">参数</param>
|
|
|
|
|
|
private void btnGridSmooth_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolGridSmooth();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置Z值.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">e</param>
|
|
|
|
|
|
private void btnGridSetZValue_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolGridSetZValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等值线生成网格.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnContourGenerateGrid_ItemClickAsync(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//mainView?.ToolGridStatics();
|
|
|
|
|
|
//mainView?.CreateMeshByDataAsync();
|
|
|
|
|
|
ppmGenerateGrid.ShowPopup(Control.MousePosition);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 数据生成网格.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnDataGenerateGrid_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.CreateMeshByDataAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图片生成网格.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnImageGenerateGrid_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.CreateMeshByImageAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 网格体积计算.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnGridVolume_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolGridVolumeCalculate();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否消除网格锯齿.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">参数</param>
|
|
|
|
|
|
private void ckbGridAnti_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolGridEnablePack(bbtnMeshPack.Down);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线延伸.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">延伸按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCurveExtendSetting_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveExtendSetting();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 四点校正.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCoordinateAdjust4Point_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCalibration4();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 两点校正.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnCoordinateAdjust2Point_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCalibration2();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重新处理网格锯齿.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnMeshPackForce_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ForceMeshPack = true;
|
|
|
|
|
|
bbtnMeshPack.Down = true;
|
|
|
|
|
|
mainView?.ToolGridEnablePack(bbtnMeshPack.Down);
|
|
|
|
|
|
mainView.ForceMeshPack = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 区域连通点击事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void bbtnPolygonConnect_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveConnect();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线加密.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnCurveNodeInsert_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveDensity();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 由曲面设置曲线节点Z值.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The source of the event.</param>
|
|
|
|
|
|
/// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param>
|
|
|
|
|
|
private void bbtnSurfaceCurveZ_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveZFromSuface();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 取消去冗余.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnCurveNodeRedundant_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveRedundancy();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线光滑.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnCurveSmooth_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolCurveSmooth();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 形状转曲线.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bbtnShape2Curve_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolShape2Curve();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The ppcEditorMeshPack_Closed.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraEditors.Controls.ClosedEventArgs"/>.</param>
|
|
|
|
|
|
private void ppcEditorMeshPack_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The ppcEditorMeshPack_QueryDisplayText.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraEditors.Controls.QueryDisplayTextEventArgs"/>.</param>
|
|
|
|
|
|
private void ppcEditorMeshPack_QueryDisplayText(object sender, DevExpress.XtraEditors.Controls.QueryDisplayTextEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The ppc3dLayerEdit_QueryDisplayText.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraEditors.Controls.QueryDisplayTextEventArgs"/>.</param>
|
|
|
|
|
|
private void ppc3dLayerEdit_QueryDisplayText(object sender, DevExpress.XtraEditors.Controls.QueryDisplayTextEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The ppcEditorMeshPack_QueryResultValue.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraEditors.Controls.QueryResultValueEventArgs"/>.</param>
|
|
|
|
|
|
private void ppcEditorMeshPack_QueryResultValue(object sender, DevExpress.XtraEditors.Controls.QueryResultValueEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.Value == null || !e.Value.Equals(layerPopNode))
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Value = layerPopNode;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ppc3dLayerEdit_QueryResultValue(object sender, DevExpress.XtraEditors.Controls.QueryResultValueEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.Value == null || !e.Value.Equals(layerPopNode))
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Value = layerPopNode;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 断层图层弹出.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void ppcEditorMeshPack_Popup(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
TreeNode tnRoot = LayerControl.GetLayerNodes();
|
|
|
|
|
|
trvLayer.CheckBoxes = (popupTreeType == "3维显示挖空图层" || popupTreeType == "3维显示边界范围" || popupTreeType == "3维显示井图层");
|
|
|
|
|
|
trvLayer.Nodes.Clear();
|
|
|
|
|
|
trvLayer.Nodes.Add(tnRoot);
|
|
|
|
|
|
trvLayer.Nodes[0].Expand();
|
|
|
|
|
|
var nodes = TreeViewHelper.TraverseTreeNode(trvLayer.Nodes[0]);
|
|
|
|
|
|
|
|
|
|
|
|
trvLayer.Nodes[0].Checked = false;
|
|
|
|
|
|
nodes.ForEach(n => n.Checked = false); // 取消选中
|
|
|
|
|
|
|
|
|
|
|
|
if (popupTreeType == "网格编辑控制点图层"
|
|
|
|
|
|
|| popupTreeType == "网格编辑断层图层"
|
|
|
|
|
|
|| popupTreeType == "网格编辑等值线图层"
|
|
|
|
|
|
|| popupTreeType == "3维显示挖空图层"
|
|
|
|
|
|
|| popupTreeType == "3维显示边界范围"
|
|
|
|
|
|
|| popupTreeType == "3维显示井图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
trvLayer.Nodes.Insert(0, "<无>");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var header = "图层";
|
|
|
|
|
|
var layerPopNodes = new List<string>();
|
|
|
|
|
|
if (trvLayer.CheckBoxes)
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPopNodes = layerPopNode.Split(';').Where(n => !string.IsNullOrEmpty(n)).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (layerPopNodes.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPopNodes.Add(layerPopNode);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var currPopNode in layerPopNodes)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (currPopNode == header)
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string strCurrentNodePath = $"{header}\\{currPopNode}";
|
|
|
|
|
|
TreeNode tnFind = FindNodeByValue(tnRoot, strCurrentNodePath);
|
|
|
|
|
|
if (tnFind != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Expand2Node(tnFind);
|
|
|
|
|
|
if (trvLayer.CheckBoxes)
|
|
|
|
|
|
{
|
|
|
|
|
|
tnFind.Checked = true;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
trvLayer.SelectedNode = tnFind;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取指定value值的节点.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="tnParent">指定节点.</param>
|
|
|
|
|
|
/// <param name="strValues">value值.</param>
|
|
|
|
|
|
/// <returns>找到的树节点.</returns>
|
|
|
|
|
|
private TreeNode FindNodeByValue(TreeNode tnParent, string strValues)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tnParent == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (tnParent.FullPath == strValues)
|
|
|
|
|
|
{
|
|
|
|
|
|
return tnParent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TreeNode tnRet = null;
|
|
|
|
|
|
foreach (TreeNode tn in tnParent.Nodes)
|
|
|
|
|
|
{
|
|
|
|
|
|
tnRet = FindNodeByValue(tn, strValues);
|
|
|
|
|
|
if (tnRet != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tnRet;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Expand2Node.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="treeNode">The treeNode<see cref="TreeNode"/>.</param>
|
|
|
|
|
|
private void Expand2Node(TreeNode treeNode)
|
|
|
|
|
|
{
|
|
|
|
|
|
TreeNode tnParent = treeNode.Parent;
|
|
|
|
|
|
if (tnParent != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
tnParent.Expand();
|
|
|
|
|
|
Expand2Node(tnParent);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The InitToolTip.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitToolTip()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 边界设置窗口显示事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bdtBorderLayer_ShowingEditor(object sender, DevExpress.XtraBars.ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPopNode = mainView.BorderLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置网格的边界图层.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
private void bdtBorderLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!layerPopNode.Equals(mainView.BorderLayer))
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.BorderLayer = layerPopNode;
|
|
|
|
|
|
bbtnMeshPackForce_ItemClick(null, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiWellLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiDigEmptyLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiBorderControlLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 断层设置窗口显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bdtFaultLayer_ShowingEditor(object sender, DevExpress.XtraBars.ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPopNode = mainView.FaultLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The bdtFaultLayer_EditValueChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="EventArgs"/>.</param>
|
|
|
|
|
|
private void bdtFaultLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!layerPopNode.Equals(mainView.FaultLayer))
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.FaultLayer = layerPopNode;
|
|
|
|
|
|
bbtnMeshPackForce_ItemClick(null, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// btis the grid contour layer_ edit value changed.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btiGridContourLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string strContourLayer = $"{btiGridContourLayer.EditValue}";
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(strContourLayer))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GridContourLayer = strContourLayer;
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// bdis the grid fault layer_ edit value changed.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void bdiGridFaultLayer_EditValueChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string strLayer = $"{bdiGridFaultLayer.EditValue}";
|
|
|
|
|
|
//if (!string.IsNullOrEmpty(strLayer))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// GridFaultLayer = strLayer;
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图层选择下拉框弹出前事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void ppmGridEditorLayer_BeforePopup(object sender, CancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
btiGridContourLayer.EditValue = GridContourLayer;
|
|
|
|
|
|
bdiGridFaultLayer.EditValue = GridFaultLayer;
|
|
|
|
|
|
btiGridControlPointLayer.EditValue = ControlPointLayer;
|
|
|
|
|
|
btnOtherLineLayer.EditValue = OtherLineLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiGridContourLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "网格编辑等值线图层";
|
|
|
|
|
|
layerPopNode = this.GridContourLayer;
|
|
|
|
|
|
|
|
|
|
|
|
ppcEditorMeshPack.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void bdiGridFaultLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "网格编辑断层图层";
|
|
|
|
|
|
layerPopNode = this.GridFaultLayer;
|
|
|
|
|
|
|
|
|
|
|
|
ppcEditorMeshPack.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 控制点图形选择框显示事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btiGridControlPointLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "网格编辑控制点图层";
|
|
|
|
|
|
layerPopNode = this.ControlPointLayer;
|
|
|
|
|
|
|
|
|
|
|
|
ppcEditorMeshPack.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 其它线弹出编辑框事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnOtherLineLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "网格编辑附加线图层";
|
|
|
|
|
|
layerPopNode = this.OtherLineLayer;
|
|
|
|
|
|
|
|
|
|
|
|
ppcEditorMeshPack.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// btis the dig empty layer_ showing editor.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btiDigEmptyLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "3维显示挖空图层";
|
|
|
|
|
|
layerPopNode = this.HoleLayer;
|
|
|
|
|
|
ppc3dLayerEdit.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiBorderControlLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "3维显示边界范围";
|
|
|
|
|
|
layerPopNode = this.BorderControlLayer;
|
|
|
|
|
|
ppc3dLayerEdit.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btiWellLayer_ShowingEditor(object sender, ItemCancelEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
popupTreeType = "3维显示井图层";
|
|
|
|
|
|
layerPopNode = this.WellLayer;
|
|
|
|
|
|
ppc3dLayerEdit.PopupControl = ppcMeshPack;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关闭网格补丁图层.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void ClosePopupMeshPack()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ppcMeshPack.OwnerEdit != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
ppcMeshPack.OwnerEdit.ClosePopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The trvLayer_NodeMouseDoubleClick.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="TreeNodeMouseClickEventArgs"/>.</param>
|
|
|
|
|
|
private void trvLayer_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strPath = e.Node.FullPath;
|
|
|
|
|
|
this.SetPopupData(strPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnPopOK_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var checkedItems = TreeViewHelper.TraverseTreeView(trvLayer).Where(n => n.Checked).Select(n => n.FullPath).ToList();
|
|
|
|
|
|
if (trvLayer.SelectedNode == null && checkedItems.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
ClosePopupMeshPack();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string strPath = string.Empty;
|
|
|
|
|
|
if (popupTreeType == "3维显示挖空图层" || popupTreeType == "3维显示边界范围" || popupTreeType == "3维显示井图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
strPath = string.Join(";", checkedItems);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
strPath = trvLayer.SelectedNode.FullPath;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.SetPopupData(strPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnPopCancel_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
ClosePopupMeshPack();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetPopupData(string strPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (strPath == "图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.popupTreeType == "网格编辑等值线图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = strPath.Remove(0, 3);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
GridContourLayer = strLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
GridContourLayer = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "网格编辑断层图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = strPath.Remove(0, 3);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
GridFaultLayer = strLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
GridFaultLayer = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "网格编辑控制点图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = strPath.Remove(0, 3);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.ControlPointLayer = strLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
ControlPointLayer = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "网格编辑附加线图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = strPath.Remove(0, 3);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.OtherLineLayer = strLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
this.OtherLineLayer = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "3维显示挖空图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
HoleLayer = string.Empty;
|
|
|
|
|
|
mainView.FaultLayer3D = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var strPaths = strPath.Split(';');
|
|
|
|
|
|
var digEmpthLayerList = new List<string>();
|
|
|
|
|
|
foreach (var strP in strPaths)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(strP))
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strLayer = strP.Remove(0, 3);
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
digEmpthLayerList.Add(strLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
HoleLayer = string.Join(";", digEmpthLayerList);
|
|
|
|
|
|
mainView.FaultLayer3D = HoleLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "3维显示边界范围")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
BorderControlLayer = string.Empty;
|
|
|
|
|
|
mainView.BorderLayer3D = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var strPaths = strPath.Split(';');
|
|
|
|
|
|
var borderControlLayerList = new List<string>();
|
|
|
|
|
|
foreach (var strP in strPaths)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(strP))
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strLayer = strP.Remove(0, 3);
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
borderControlLayerList.Add(strLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
BorderControlLayer = string.Join(";", borderControlLayerList);
|
|
|
|
|
|
mainView.BorderLayer3D = BorderControlLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (this.popupTreeType == "3维显示井图层")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (strPath == "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
WellLayer = string.Empty;
|
|
|
|
|
|
mainView.WellLayer3D = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var strPaths = strPath.Split(';');
|
|
|
|
|
|
|
|
|
|
|
|
var wellLayerList = new List<string>();
|
|
|
|
|
|
foreach (var strP in strPaths)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(strP))
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
string strLayer = strP.Remove(0, 3);
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
wellLayerList.Add(strLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
WellLayer = string.Join(";", wellLayerList);
|
|
|
|
|
|
mainView.WellLayer3D = WellLayer;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!strPath.Equals(layerPopNode))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (strPath.Contains(";"))
|
|
|
|
|
|
{
|
|
|
|
|
|
var strPaths = strPath.Split(';');
|
|
|
|
|
|
|
|
|
|
|
|
var digEmpthLayerList = new List<string>();
|
|
|
|
|
|
foreach (var strP in strPaths)
|
|
|
|
|
|
{
|
|
|
|
|
|
string strLayer = strP.Remove(0, 3);
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strLayer) && strPath != "<无>")
|
|
|
|
|
|
{
|
|
|
|
|
|
digEmpthLayerList.Add(strLayer);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
layerPopNode = string.Join(";", digEmpthLayerList);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
layerPopNode = strPath.Remove(0, 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ClosePopupMeshPack();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 反走样设置.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void btnAntiAlias_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolAntiAlias(btnAntiAlias.Down);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The btnDisplayScale_ItemClick.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="DevExpress.XtraBars.ItemClickEventArgs"/>.</param>
|
|
|
|
|
|
private void btnDisplayScale_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolDisplayScale();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void DelaunayButton_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//mainView?.ToolDelaunay();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 简单三角剖分.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnDelaunaySimple_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolDelaunay();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 带约束的三角剖分.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnDelaunayConstraint_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolDelaunayConstraint();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 龟背图生成事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The source of the event.</param>
|
|
|
|
|
|
/// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param>
|
|
|
|
|
|
private void bbtnVoronoi_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//mainView?.ToolVoronoi();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void bbtnVoronoi1_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolVoronoi();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void bbtnVoronoi2_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolVoronoi2();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 图层面板是否显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">图层控制按钮.</param>
|
|
|
|
|
|
/// <param name="e">选中事件.</param>
|
|
|
|
|
|
private void bckiPanelLayer_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanelVisible = bckiPanelLayer.Checked;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 统计面板是否显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bckiPanelStatistic_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
StatisticPanelVisible = bckiPanelStatistic.Checked;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 属性面板是否显示.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮.</param>
|
|
|
|
|
|
/// <param name="e">事件参数.</param>
|
|
|
|
|
|
private void bckiPanelProperty_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PropertyPanel == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (bckiPanelProperty.Checked)
|
|
|
|
|
|
//{
|
|
|
|
|
|
//PropertyPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
//PropertyPanel.Visibility = DockVisibility.AutoHide;
|
|
|
|
|
|
//}
|
|
|
|
|
|
PropertyPanelVisible = bckiPanelProperty.Checked;
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The MergePanels.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void MergePanels()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 状态条
|
|
|
|
|
|
if (DrawerStatusBar != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
StatisticPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
DrawerStatusBar.UnMergeStatusBar();
|
|
|
|
|
|
drawerStatusBar.MergeStatusBar(ribbonMain.StatusBar);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 图层树控件的处理
|
|
|
|
|
|
if (LayerControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
//this.LayerPanel.ControlContainer.Controls[i]
|
|
|
|
|
|
LayerPanel.ControlContainer.Controls.Add(LayerControl);
|
|
|
|
|
|
LayerPanel.Text = $"{DrawerView.CurrentLayer}";
|
|
|
|
|
|
LayerControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
|
|
|
|
|
|
if (LayerPanel.Visibility == DockVisibility.Hidden ||
|
|
|
|
|
|
LayerPanel.Visibility == DockVisibility.AutoHide)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelLayer.Checked = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelLayer.Checked = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
LayerPanel.VisibilityChanged -= LayerPanel_VisibilityChanged;
|
|
|
|
|
|
LayerPanel.VisibilityChanged += LayerPanel_VisibilityChanged;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 属性控件的处理
|
|
|
|
|
|
if (PropertyPanel != null && PropertyControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
PropertyPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
PropertyPanel.ControlContainer.Controls.Add(PropertyControl);
|
|
|
|
|
|
PropertyControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.CreateMapPanel != null && CreateMapPanel.ControlContainer != null && GraphControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
CreateMapPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
CreateMapPanel.ControlContainer.Controls.Add(GraphControl);
|
|
|
|
|
|
GraphControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (this.CreateMapPanel != null)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// 数据成图控件的处理
|
|
|
|
|
|
//if (!IsChildPanelExist(PropertyPanel.ParentPanel, "成图") && dcpProperty.Parent != null)
|
|
|
|
|
|
//if (CreateMapPanel.Controls.Count == 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// CreateMapPanel.Controls.Add(GraphControl);
|
|
|
|
|
|
// GraphControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//if (!IsChildPanelExist(PropertyPanel.ParentPanel, "成图"))
|
|
|
|
|
|
//// if (!PropertyPanel.Controls.Contains(dcpCreate))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// PropertyPanel.Controls.Add(this.dcpCreate);
|
|
|
|
|
|
// //DockPanel dockPanel = dcpProperty.AddPanel();
|
|
|
|
|
|
// //DockPanel dockPanel = dcpCreate;
|
|
|
|
|
|
// dcpCreate.Text = "成图";
|
|
|
|
|
|
|
|
|
|
|
|
// dockManager1.AddPanel(DockingStyle.Fill, dcpCreate);
|
|
|
|
|
|
// dcpCreate.DockTo(PropertyPanel, DockingStyle.Fill);
|
|
|
|
|
|
// PropertyPanel.ParentPanel.ActiveChild = PropertyPanel;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
// 统计面板
|
|
|
|
|
|
if (StatisticControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
statisticPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
StatisticPanel.ControlContainer.Controls.Add(StatisticControl);
|
|
|
|
|
|
StatisticControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
|
|
|
|
|
|
if (StatisticPanel.Visibility == DockVisibility.Hidden ||
|
|
|
|
|
|
StatisticPanel.Visibility == DockVisibility.AutoHide)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelStatistic.Checked = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelStatistic.Checked = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
StatisticPanel.VisibilityChanged -= StatisticPanel_VisibilityChanged;
|
|
|
|
|
|
StatisticPanel.VisibilityChanged += StatisticPanel_VisibilityChanged;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 取消面板合并.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void UnMergePanels()
|
|
|
|
|
|
{
|
|
|
|
|
|
DrawerStatusBar?.UnMergeStatusBar();
|
|
|
|
|
|
|
|
|
|
|
|
if (LayerPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
LayerPanel.ControlContainer.Controls.Clear();
|
|
|
|
|
|
LayerPanel.Text = "图层";
|
|
|
|
|
|
}
|
|
|
|
|
|
PropertyPanel?.ControlContainer.Controls.Clear();
|
|
|
|
|
|
statisticPanel?.ControlContainer.Controls.Clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
private UserControl ConvertFormToUserControl(Form form)
|
|
|
|
|
|
{
|
|
|
|
|
|
var uc = new UserControl();
|
|
|
|
|
|
form.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
|
form.TopLevel = false;
|
|
|
|
|
|
uc.Controls.Add(form);
|
|
|
|
|
|
form.Dock = DockStyle.Fill;
|
|
|
|
|
|
return uc;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加控件到底部面板.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="panelName">名称.</param>
|
|
|
|
|
|
/// <param name="panelText">标题.</param>
|
|
|
|
|
|
/// <param name="childControl">子控件.</param>
|
|
|
|
|
|
/// <param name="showCloseButton">是否显示关闭按钮</param>
|
|
|
|
|
|
/// <param name="overwrite">是否覆盖已经存在的标签页</param>
|
|
|
|
|
|
/// <returns>面板.</returns>
|
|
|
|
|
|
public DockPanel AddPanel2Bottom(string panelName, string panelText, Control childControl, bool showCloseButton = true, bool overwrite = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
statisticPanel.SuspendLayout();
|
|
|
|
|
|
if (overwrite)
|
|
|
|
|
|
{
|
|
|
|
|
|
RemoveBottomPanel(panelName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 显示 statisticPanel 并暂停布局
|
|
|
|
|
|
statisticPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
statisticPanel.Tabbed = true;
|
|
|
|
|
|
|
|
|
|
|
|
// 创建 DockPanel
|
|
|
|
|
|
DockPanel dockPanel = statisticPanel.AddPanel();
|
|
|
|
|
|
dockPanel.Name = panelName;
|
|
|
|
|
|
dockPanel.Text = panelText;
|
|
|
|
|
|
dockPanel.Options.ShowCloseButton = showCloseButton;
|
|
|
|
|
|
|
|
|
|
|
|
// 设置 statisticPanel 的父面板
|
|
|
|
|
|
if (statisticPanel.ParentPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
statisticPanel.ParentPanel.ActiveChild = dockPanel;
|
|
|
|
|
|
statisticPanel.ParentPanel.Tabbed = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 恢复布局并返回面板
|
|
|
|
|
|
statisticPanel.ResumeLayout();
|
|
|
|
|
|
// 使用更高效的停靠方式
|
|
|
|
|
|
dockManager1.BeginUpdate();
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
dockPanel.Visibility = DockVisibility.Visible;
|
|
|
|
|
|
dockManager1.AddPanel(DockingStyle.Fill, dockPanel);
|
|
|
|
|
|
dockPanel.DockTo(statisticPanel, DockingStyle.Fill);
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
|
|
|
{
|
|
|
|
|
|
dockManager1.EndUpdate();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加子控件到 DockPanel
|
|
|
|
|
|
childControl.Dock = DockStyle.Fill;
|
|
|
|
|
|
if (childControl is Form form)
|
|
|
|
|
|
{
|
|
|
|
|
|
form.TopLevel = false;
|
|
|
|
|
|
form.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
|
dockPanel.Controls.Add(form);
|
|
|
|
|
|
form.Show();
|
|
|
|
|
|
form.Dock = DockStyle.Fill;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (childControl is GridControl grid)
|
|
|
|
|
|
{
|
|
|
|
|
|
dockPanel.Controls.Add(grid);
|
|
|
|
|
|
grid.Show();
|
|
|
|
|
|
grid.Dock = DockStyle.Fill;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 强制刷新一次
|
|
|
|
|
|
if (statisticPanel.Parent is Control parent)
|
|
|
|
|
|
{
|
|
|
|
|
|
parent.Refresh();
|
|
|
|
|
|
}
|
|
|
|
|
|
return dockPanel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移除底部指定面板
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="panelName">面板名称</param>
|
|
|
|
|
|
public void RemoveBottomPanel(string panelName)
|
|
|
|
|
|
{
|
|
|
|
|
|
DockPanel targetPanel = statisticPanel.ParentPanel?.Controls
|
|
|
|
|
|
.OfType<DockPanel>()
|
|
|
|
|
|
.FirstOrDefault(p => p.Name == panelName);
|
|
|
|
|
|
|
|
|
|
|
|
if (targetPanel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
statisticPanel.ParentPanel.RemovePanel(targetPanel);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 移除底部所有面板
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ClearBottomPanel()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 在 dockManager1 中查找指定名称的 DockPanel
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="text">标题</param>
|
|
|
|
|
|
/// <returns>成功返回对应的 DockPanel,失败返回 null</returns>
|
|
|
|
|
|
private DockPanel FindPanelByText(string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return dockManager1.Panels.Cast<DockPanel>().FirstOrDefault(x => x.Text == text);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断子控件中是否存在指定 text 的 dockPanel
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="dockPanel">被查询的控件</param>
|
|
|
|
|
|
/// <param name="text">名称</param>
|
|
|
|
|
|
/// <returns>true/false</returns>
|
|
|
|
|
|
private bool IsChildPanelExist(DockPanel dockPanel, string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
return dockPanel?.Controls
|
|
|
|
|
|
.OfType<DockPanel>()
|
|
|
|
|
|
.Any(child => child.Text == text) ?? false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The LayerPanel_VisibilityChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="VisibilityChangedEventArgs"/>.</param>
|
|
|
|
|
|
private void LayerPanel_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
SuspendLayout();
|
|
|
|
|
|
// Thread.Sleep(5000);
|
|
|
|
|
|
if (LayerPanel.Visibility == DockVisibility.Hidden)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bckiPanelLayer.Checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelLayer.Checked = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (LayerPanel.Visibility == DockVisibility.Visible ||
|
|
|
|
|
|
LayerPanel.Visibility == DockVisibility.AutoHide)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bckiPanelLayer.Checked == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelLayer.Checked = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
ResumeLayout();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The StatisticPanel_VisibilityChanged.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender<see cref="object"/>.</param>
|
|
|
|
|
|
/// <param name="e">The e<see cref="VisibilityChangedEventArgs"/>.</param>
|
|
|
|
|
|
private void StatisticPanel_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (StatisticPanel.Visibility == DockVisibility.Hidden)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bckiPanelStatistic.Checked)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelStatistic.Checked = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StatisticPanel.Visibility == DockVisibility.Visible ||
|
|
|
|
|
|
StatisticPanel.Visibility == DockVisibility.AutoHide)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bckiPanelStatistic.Checked == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
bckiPanelStatistic.Checked = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// btns the zoom window_ item click.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnZoomWindow_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 生成三角网
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">sender</param>
|
|
|
|
|
|
/// <param name="e">e</param>
|
|
|
|
|
|
private void btnDelaunay_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolDelaunay();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnSetXyzClore_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolZColor();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SimplifyButton_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolSimplify();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnImageCutPolygon_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolImageCutPolygon();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnIntersectRegionFill_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnIntersectRegionFill.Down || btnLinkRegionFill.Down || btnAutoRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveFill.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnIntersectRegionFill_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnIntersectRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolCurveConnectFill();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnLinkRegionFill_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnIntersectRegionFill.Down || btnLinkRegionFill.Down || btnAutoRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveFill.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnLinkRegionFill_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnLinkRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSolidLink();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnAutoRegionFill_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnIntersectRegionFill.Down || btnLinkRegionFill.Down || btnAutoRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnCurveFill.Down = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolRestore();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// btns the auto region fill_ item click.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void btnAutoRegionFill_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btnAutoRegionFill.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolSolidAuto();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 水平井绘制
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void btiWellGroup_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (btiWellGroup.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolWellGroup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑网格和等值线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void bbtnGridProgress_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (FindGridEditorProcess(KepGridEditor.FormMain.ProcessName))
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("编辑模块正在运行中,请结束后再启动!", "启动编辑"
|
|
|
|
|
|
, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr pXy = mainView.DrawerXY;
|
|
|
|
|
|
KepGridEditor.FormMain editor = new KepGridEditor.FormMain(
|
|
|
|
|
|
this.DrawerView.ViewControl.Geo, this.GridContourLayer, this.GridFaultLayer
|
|
|
|
|
|
, this.ControlPointLayer, this.OtherLineLayer)
|
|
|
|
|
|
{
|
|
|
|
|
|
StartPosition = FormStartPosition.CenterScreen,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//editor.EditorMouseMoveEvent += async (mx, my) =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// await Task.Run(() => { mainView.SetDrawerMouseLocation(mx, my); });
|
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
|
|
// 等网编辑,修改了数据
|
|
|
|
|
|
editor.PushDataClick += (object btn, EventArgs ea) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
//更新图层列表
|
|
|
|
|
|
LayerControl.LoadLayerTree();
|
|
|
|
|
|
mainView.ToolDefault();
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
// 网格操作我们不支持回退,太占内存了,于是这里要手动设置一下修改标识
|
|
|
|
|
|
mainView.SetDocumentModified(true);
|
|
|
|
|
|
};
|
|
|
|
|
|
editor.Show();
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 轮廓刻画.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void bbtnOutline_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (FindGridEditorProcess(RiverPortray.FormMain.ProcessName))
|
|
|
|
|
|
{
|
|
|
|
|
|
MessageBox.Show("轮廓刻画模块正在运行中,请结束后再启动!", "启动轮廓刻画"
|
|
|
|
|
|
, MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
IntPtr pXy = mainView.DrawerXY;
|
|
|
|
|
|
RiverPortray.FormMain frmMain = new RiverPortray.FormMain(pXy);
|
|
|
|
|
|
// 取消区域刻画最上显示,这个操作耗时较长,如果最上显示的话,在这个过程中无法去做别的事情
|
|
|
|
|
|
frmMain.TopMost = false;
|
|
|
|
|
|
|
|
|
|
|
|
// 回写了数据
|
|
|
|
|
|
frmMain.PushDataClick += (object btn, EventArgs ea) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolDefault();
|
|
|
|
|
|
mainView.ToolRedraw();
|
|
|
|
|
|
mainView.LoadLayerTree();
|
|
|
|
|
|
// 网格操作我们不支持回退,太占内存了,于是这里要手动设置一下修改标识
|
|
|
|
|
|
mainView.SetDocumentModified(true);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
frmMain.Show(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查找指定名称的进程
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="processName">窗口名称</param>
|
|
|
|
|
|
/// <returns>是否找到</returns>
|
|
|
|
|
|
private bool FindGridEditorProcess(string processName)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (Form f in Application.OpenForms)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (f.Text == processName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnSymbolManager_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
EditFileSymbol();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑当前文件相关的符号.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void EditFileSymbol()
|
|
|
|
|
|
{
|
|
|
|
|
|
DirectoryInfo symbolFilePath = Directory.GetParent(Application.StartupPath);
|
|
|
|
|
|
string symbolFile = Path.Combine(symbolFilePath.FullName, "Symbol");
|
|
|
|
|
|
|
|
|
|
|
|
if (DrawerView == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
SymbolLibInterface.SymbolHelp.ShowSymbolUI(null, symbolFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SymbolLibInterface.SymbolHelp.ShowSymbolUI(mainView, symbolFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// vtk 视图, 一个ucdrawedit 对应一个 UCVtkEdit
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public UCVtkEdit VtkEdit { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
protected override void OnHandleDestroyed(EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
faultEditForm?.Close();
|
|
|
|
|
|
faultEditForm = null;
|
|
|
|
|
|
base.OnHandleDestroyed(e);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private FaultEditForm faultEditForm;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 断层外扩按钮点击事件.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void bbtnFaultBroaden_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (faultEditForm == null) // 防止用户点多次出来多个弹框
|
|
|
|
|
|
{
|
|
|
|
|
|
faultEditForm = new FaultEditForm(mainView);
|
|
|
|
|
|
faultEditForm.Show(this);
|
|
|
|
|
|
faultEditForm.FormClosed += (s, _) => faultEditForm = null; // 关闭时置 null,为了下次能够启动起来
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 断层简化按钮点击事件 click.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">The sender.</param>
|
|
|
|
|
|
/// <param name="e">The e.</param>
|
|
|
|
|
|
private void bbtnFaultSimplyfy_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bbtnFaultSimplyfy.Down)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolFaultSimply();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void bbtnCurveCaculate_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolMergeCurve();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 曲线连接按钮点击事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender">事件按钮</param>
|
|
|
|
|
|
/// <param name="e">事件参数</param>
|
|
|
|
|
|
private void bbtnJoinCurves_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ToolAutoJoinCurves();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnReverseZ_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ReverseCurveAndMeshZValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnDeleteDuplicate_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.DeleteDuplicationElements();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void barButtonItemVtk_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
ShowVtkEventArgs vea = new ShowVtkEventArgs("Show Vtk Event triggered");
|
|
|
|
|
|
vea.FilePath = this.FileFullName;
|
|
|
|
|
|
vea.HoleLayer = this.HoleLayer;
|
|
|
|
|
|
vea.BoundaryLayer = this.BorderControlLayer;
|
|
|
|
|
|
vea.WellLayer = this.WellLayer;
|
|
|
|
|
|
Drawer drawer = this.DrawerView.ViewControl.Drawer;
|
|
|
|
|
|
// 获取主网格
|
|
|
|
|
|
IntPtr mainMesh = IntPtr.Zero;
|
|
|
|
|
|
String layerName = this.GetMainMeshLayer();
|
|
|
|
|
|
// 如果没有手动设置主网格的情况,自动获取并设置主网格
|
|
|
|
|
|
if (this.VtkMainMesh == IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 从主网格图层获取主网格,获取图件的第一个网格做为主网格
|
|
|
|
|
|
if (string.IsNullOrEmpty(layerName))
|
|
|
|
|
|
{
|
|
|
|
|
|
mainMesh = drawer.Geo.GetKevFirstMesh();
|
|
|
|
|
|
drawer.SetVtkMainMeshEvent?.Invoke(drawer.DrawFileName, mainMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainMesh = mainView.ViewControl.Geo.GetMainMeshByLayer3D(layerName);
|
|
|
|
|
|
drawer.SetVtkMainMeshEvent?.Invoke(drawer.DrawFileName, mainMesh);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取图层数据,传送数据
|
|
|
|
|
|
this.LayerControl.GetVtkData(vea);
|
|
|
|
|
|
//显示VTK控件
|
|
|
|
|
|
ShowVtkEvent?.Invoke(this, vea);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置三维设置参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sceneParameter">三维参数,如果为 Intptr.Zero 表示清空</param>
|
|
|
|
|
|
public void SetSceneParameter(IntPtr sceneParameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
var geo = mainView?.ViewControl.Drawer.Geo;
|
|
|
|
|
|
geo?.VtkSetSceneParameter(sceneParameter);
|
|
|
|
|
|
geo?.Sigma_SetDocumentModified(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取三维设置参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>参数指针,如果 IntPtr.Zero 表示三维参数不存在</returns>
|
|
|
|
|
|
public IntPtr GetSceneParameter()
|
|
|
|
|
|
{
|
|
|
|
|
|
var geo = mainView?.ViewControl.Drawer.Geo;
|
|
|
|
|
|
if (geo == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return IntPtr.Zero;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return geo.VtkGetSceneParameter();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取三维配置参数明细
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parameter">参数明细</param>
|
|
|
|
|
|
/// <returns>成功返回 true,失败返回 false</returns>
|
|
|
|
|
|
public bool GetSceneParameterDetails(ref KevVtkSceneParameter parameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
var geo = mainView?.ViewControl.Drawer.Geo;
|
|
|
|
|
|
if (geo == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return geo.VtkGetSceneParameterDetails(ref parameter);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置三维配置信息到 vtkChild
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="vtkChild">目标对象</param>
|
|
|
|
|
|
public void SetVtkSettings(UCVtkEdit vtkChild)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (vtkChild == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(vtkChild));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr parameter = this.GetSceneParameter();
|
|
|
|
|
|
if (parameter != IntPtr.Zero)
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdatePropertyPanel(vtkChild);
|
|
|
|
|
|
vtkChild.SetSceneParameter(parameter);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Color ColorFromDouble(double r, double g, double b)
|
|
|
|
|
|
{
|
|
|
|
|
|
int red = (int)(r * 255);
|
|
|
|
|
|
int green = (int)(g * 255);
|
|
|
|
|
|
int blue = (int)(b * 255);
|
|
|
|
|
|
|
|
|
|
|
|
return Color.FromArgb(red, green, blue);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Color ColorRefToColor(uint color)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 提取红、绿、蓝分量
|
|
|
|
|
|
byte red = (byte)((color >> 16) & 0xFF);
|
|
|
|
|
|
byte green = (byte)((color >> 8) & 0xFF);
|
|
|
|
|
|
byte blue = (byte)(color & 0xFF);
|
|
|
|
|
|
|
|
|
|
|
|
// 创建Color对象(Alpha设为255,即不透明)
|
|
|
|
|
|
return Color.FromArgb(255, red, green, blue);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新面板属性值
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="vtkEdit">Vtk界面</param>
|
|
|
|
|
|
private void UpdatePropertyPanel(UCVtkEdit vtkEdit)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var ucdrawEdit = this;
|
|
|
|
|
|
|
|
|
|
|
|
var parameter = default(KevVtkSceneParameter);
|
|
|
|
|
|
if (!ucdrawEdit.GetSceneParameterDetails(ref parameter))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// general
|
|
|
|
|
|
vtkEdit.VtkProerty.ShowMeshEdge = (parameter.m_showMeshLinearExtrusion != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.ShowCoordinateGrid = (parameter.m_showAxies != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.ShowScalarBar = (parameter.m_showScalarBar != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.ShowCoordinateGridLine = (parameter.m_ShowCoordinateGridLine != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.ShowMeshEdgeColorGradient = (parameter.m_ShowMeshEdgeColorGradient != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.ZScale = parameter.m_zScale;
|
|
|
|
|
|
vtkEdit.VtkProerty.MeshEdgeMode = (MeshEdgeModeEnum)parameter.m_mesh_edge_mode;
|
|
|
|
|
|
vtkEdit.VtkProerty.Thickness = parameter.m_thickness;
|
|
|
|
|
|
|
|
|
|
|
|
// background
|
|
|
|
|
|
vtkEdit.VtkProerty.BackgroundColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_background_color_r,
|
|
|
|
|
|
parameter.m_background_color_g,
|
|
|
|
|
|
parameter.m_background_color_b);
|
|
|
|
|
|
|
|
|
|
|
|
// camera
|
|
|
|
|
|
vtkEdit.VtkProerty.CameraHAngle = parameter.m_camera_azimuth;
|
|
|
|
|
|
vtkEdit.VtkProerty.CameraVAngle = parameter.m_camera_elevation;
|
|
|
|
|
|
|
|
|
|
|
|
// actor
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorAmbientColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_actor_ambientColor_r,
|
|
|
|
|
|
parameter.m_actor_ambientColor_g,
|
|
|
|
|
|
parameter.m_actor_ambientColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorDiffusedColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_actor_diffuseColor_r,
|
|
|
|
|
|
parameter.m_actor_diffuseColor_g,
|
|
|
|
|
|
parameter.m_actor_diffuseColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorSpecularColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_actor_specularColor_r,
|
|
|
|
|
|
parameter.m_actor_specularColor_g,
|
|
|
|
|
|
parameter.m_actor_specularColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorAmbient = (int)(parameter.m_actor_ambient * 100);
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorDiffused = (int)(parameter.m_actor_diffuse * 100);
|
|
|
|
|
|
vtkEdit.VtkProerty.ActorSpecular = (int)(parameter.m_actor_specular * 100);
|
|
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
|
|
vtkEdit.VtkProerty.LightMode = (parameter.m_light_mode == 0 ? SigmaDrawerElement.LightModeEnum.相机光 : SigmaDrawerElement.LightModeEnum.方向光);
|
|
|
|
|
|
vtkEdit.VtkProerty.MeshEdgeMode = (parameter.m_mesh_edge_mode == 0 ? SigmaDrawerElement.MeshEdgeModeEnum.平移 : SigmaDrawerElement.MeshEdgeModeEnum.水平);
|
|
|
|
|
|
vtkEdit.VtkProerty.LightIntensity = (int)(parameter.m_light_intensity * 100);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.LightColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_light_color_r,
|
|
|
|
|
|
parameter.m_light_color_g,
|
|
|
|
|
|
parameter.m_light_color_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.LightAmbientColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_light_ambientColor_r,
|
|
|
|
|
|
parameter.m_light_ambientColor_g,
|
|
|
|
|
|
parameter.m_light_ambientColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.LightDiffusedCorlor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_light_diffuseColor_r,
|
|
|
|
|
|
parameter.m_light_diffuseColor_g,
|
|
|
|
|
|
parameter.m_light_diffuseColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.LightSpecularColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_light_specularColor_r,
|
|
|
|
|
|
parameter.m_light_specularColor_g,
|
|
|
|
|
|
parameter.m_light_specularColor_b);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.MeshEdgeColor = ColorFromDouble(
|
|
|
|
|
|
parameter.m_mesh_edge_color_r,
|
|
|
|
|
|
parameter.m_mesh_edge_color_g,
|
|
|
|
|
|
parameter.m_mesh_edge_color_b);
|
|
|
|
|
|
vtkEdit.VtkProerty.LightElevation = parameter.m_light_elevation;
|
|
|
|
|
|
vtkEdit.VtkProerty.LightAzimuth = parameter.m_light_azimuth;
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.SingularValueFilterFlag = (parameter.m_singularValueFilterFlag != 0);
|
|
|
|
|
|
vtkEdit.VtkProerty.SingularThreshold = parameter.m_singularThreshold;
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.ZMaxScale = parameter.m_zMaxScale;
|
|
|
|
|
|
vtkEdit.VtkProerty.WellMode = (Enum.IsDefined(typeof(WellModeEnum), parameter.m_wellMode) ?
|
|
|
|
|
|
vtkEdit.VtkProerty.WellMode = (WellModeEnum)parameter.m_wellMode : WellModeEnum.平面);
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnHeight = parameter.m_wellColumnHeight;
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnRadius = parameter.m_wellColumnRadius;
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnColor = ColorRefToColor(parameter.m_wellColumnColor);
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnNameColor = ColorRefToColor(parameter.m_wellColumnNameColor);
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnNameSize = parameter.m_wellColumnNameSize;
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnNameGap = parameter.m_wellColumnNameGap;
|
|
|
|
|
|
vtkEdit.VtkProerty.FaultMode = (FaultModeEnum)parameter.m_faultModeEnum;
|
|
|
|
|
|
|
|
|
|
|
|
if (vtkEdit.VtkProerty.WellTypeColorList.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string wellTypeColors = Marshal.PtrToStringBSTR(parameter.m_wellTypeColors);
|
|
|
|
|
|
|
|
|
|
|
|
//// 如果为空,不能设置 WellTypeColorList,否则会将默认的设置顶掉
|
|
|
|
|
|
//if (!string.IsNullOrWhiteSpace(wellTypeColors))
|
|
|
|
|
|
//{
|
|
|
|
|
|
// string[] colorItems = wellTypeColors.Split(';');
|
|
|
|
|
|
|
|
|
|
|
|
// var colorItemCollection = new WellTypeColorCollection();
|
|
|
|
|
|
|
|
|
|
|
|
// foreach (string colorItem in colorItems)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// string[] items = colorItem.Split(',');
|
|
|
|
|
|
// if (items.Length >= 4)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (int.TryParse(items[1], out int r) && int.TryParse(items[2], out int g) && int.TryParse(items[3], out int b))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// var item = new WellTypeColorItem(items[0], Color.FromArgb(255, r, g, b));
|
|
|
|
|
|
// colorItemCollection.Add(item);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// vtkEdit.VtkProerty.WellTypeColorList = colorItemCollection;
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//如果已设置颜色对象,则只赋值颜色
|
|
|
|
|
|
string wellTypeColors = Marshal.PtrToStringBSTR(parameter.m_wellTypeColors);
|
|
|
|
|
|
// 如果为空,不能设置 WellTypeColorList,否则会将默认的设置顶掉
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(wellTypeColors))
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] colorItems = wellTypeColors.Split(';');
|
|
|
|
|
|
|
|
|
|
|
|
var colorItemCollection = new WellTypeColorCollection();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (string colorItem in colorItems)
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] items = colorItem.Split(',');
|
|
|
|
|
|
if (items.Length >= 4)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(items[1], out int r) && int.TryParse(items[2], out int g) && int.TryParse(items[3], out int b))
|
|
|
|
|
|
{
|
|
|
|
|
|
var item = new WellTypeColorItem(items[0], Color.FromArgb(255, r, g, b));
|
|
|
|
|
|
colorItemCollection.Add(item);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (WellTypeColorItem item in colorItemCollection)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (WellTypeColorItem temp in vtkEdit.VtkProerty.WellTypeColorList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (temp.Type.Equals(item.Type))
|
|
|
|
|
|
{
|
|
|
|
|
|
temp.Value = item.Value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.UpdateWellTypeColor();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.VtkProerty.WellSymbolRadius = parameter.m_wellSymbalRadius;
|
|
|
|
|
|
vtkEdit.VtkProerty.WellColumnThrough = (parameter.m_wellColumnThrough != 0);
|
|
|
|
|
|
|
|
|
|
|
|
vtkEdit.propertyGridControl.Refresh();
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void WindowSync_DownChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BarButtonItem item = (BarButtonItem)(sender);
|
|
|
|
|
|
DrawerConfig.Instance.SetConfigValue("MultiView", "OnSynchronize", item.Down);
|
|
|
|
|
|
DrawerConfig.Instance.Save();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnMeasure_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.ToolMeasure();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnRotation_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var form = new FrmRotation();
|
|
|
|
|
|
if (form.ShowDialog(this) == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.Rotation(form.RotationParameter.Origin.X, form.RotationParameter.Origin.Y, form.RotationParameter.Angle);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void barSnapItem_CheckedChanged(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView?.ViewControl.Drawer.Geo.EnableSnape(barSnapItem.Checked);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ListBoxControl1_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (listBoxControl1.SelectedIndex >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var selectedValue = listBoxControl1.SelectedItem.ToString();
|
|
|
|
|
|
// 更新按钮显示当前选中的值
|
|
|
|
|
|
btnAddMapLayer.Hint = $"卫星图片({selectedValue})";
|
|
|
|
|
|
if(selectedValue == "无")
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.DeleteMapViewLayer();
|
|
|
|
|
|
mainView.SetMapViewState(false);
|
|
|
|
|
|
mainView.UpdateMapViewIndex -= updateMapViewIndex;
|
|
|
|
|
|
|
|
|
|
|
|
if (btnAddMapLayer.DropDownControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnAddMapLayer.DropDownControl.HidePopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mainView.DeleteMapViewLayer();
|
|
|
|
|
|
if (btnAddMapLayer.DropDownControl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
btnAddMapLayer.DropDownControl.HidePopup();
|
|
|
|
|
|
}
|
|
|
|
|
|
mainView.UpdateMapViewIndex += updateMapViewIndex;
|
|
|
|
|
|
int zoom = Convert.ToInt32(selectedValue);
|
|
|
|
|
|
mainView.AddMapViewLayer(zoom);
|
|
|
|
|
|
mainView.SetMapViewState(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mainView.LoadLayerTree();
|
|
|
|
|
|
mainView.ViewControl.Redraw();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void updateMapViewIndex()
|
|
|
|
|
|
{
|
|
|
|
|
|
//this.listBoxControl1.SetSelected(0, true);
|
|
|
|
|
|
//mainView.SetMapViewState(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void PopulateZoomLevels(int maxZoom)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 清空
|
|
|
|
|
|
this.listBoxControl1.Items.Clear();
|
|
|
|
|
|
this.listBoxControl1.SelectedIndexChanged -= ListBoxControl1_SelectedIndexChanged;
|
|
|
|
|
|
for (int i = 5; i <= maxZoom; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.listBoxControl1.Items.Add(i);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.listBoxControl1.SelectedIndexChanged += ListBoxControl1_SelectedIndexChanged;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnAddMapLayer_ItemClick(object sender, ItemClickEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var geo = mainView?.ViewControl.Drawer.Geo;
|
|
|
|
|
|
string configPath = Path.Combine(Application.StartupPath, "mapConfig.json");
|
|
|
|
|
|
using (var manager = new frmMapManager(configPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
TreeNode tnRoot = LayerControl.GetLayerNodes();
|
|
|
|
|
|
manager.SetTreeView(tnRoot);
|
|
|
|
|
|
if (manager.ShowDialog(this) == DialogResult.OK)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (manager.SelectedProvider == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
geo.MapUrlString = null;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//记录参数
|
|
|
|
|
|
string mapKey = manager.SelectedProvider.Key;
|
|
|
|
|
|
string url = manager.SelectedProvider.Url;
|
|
|
|
|
|
url = url.Replace("{tk}", mapKey);
|
|
|
|
|
|
geo.MapUrlString = url;
|
|
|
|
|
|
geo.MapDBName = manager.SelectedProvider.DbFileName;
|
|
|
|
|
|
//边界
|
|
|
|
|
|
geo.MapBorderLayer = manager.BorderSelectionLayer;
|
|
|
|
|
|
|
|
|
|
|
|
if (manager.SelectedProvider.Crs == "gcj02")
|
|
|
|
|
|
{
|
|
|
|
|
|
geo.MapTransformType = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
geo.MapTransformType = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.PopulateZoomLevels(manager.SelectedProvider.MaxZoom);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|