• 大小: 922KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-05
  • 语言: 其他
  • 标签:

资源简介

规则格网体积计算

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RegulerGrid
{
    public partial class Form1 : Form
    {
        #region 参数
        List knownPoint = new List();//离散点
        List knownBoundaryPoint = new List();//边界点
        List knownPoints = new List();//离散点与边界点的集合
        List gridPoints = new List();//格网
        double[] retangle = new double[4];//外接矩形
        SaveAndDraw saveAndDraw = new SaveAndDraw();
        #endregion

        public Form1()
        {
            InitializeComponent();
            dataGridView1.DataSource=ReadAndWrite.InitialDataGridView();
        }

        Point mouse_offset;
        private void chart1_MouseUp(object sender MouseEventArgs e)
        {
            chart1.Location = e.Location;
            if (e.Button == MouseButtons.Left)
            {
                Point position = Control.MousePosition;
                position.Offset(mouse_offset);
                ((Control)sender).Location = ((Control)sender).Parent.PointToClient(position);
            }
        }

        private void chart1_MouseDown(object sender MouseEventArgs e)
        {
            mouse_offset = new Point(-e.X -e.Y);
        }
        private void ToolStripMenuItemNew_Click(object sender EventArgs e)
        {
            dataGridView1.DataSource = ReadAndWrite.InitialDataGridView();
        }

        private void NoSort(DataGridView dataGridView)
        {
            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
        }

        private void ToolStripMenuItemOpenPointData_Click(object sender EventArgs e)
        {
            string path = ReadAndWrite.GetOpenDialogFileName(“txt文档(*.txt)|*.txt|Excel文件(*.xls)|*.xls|Excel文件(*.xlsx)|*.xlsx|dxf文件(*.dxf)|*.dxf““请输入离散点数据:“);
            if (path==null)
            {
                MessageBox.Show(“请选择离散点数据。“ “提示:“ MessageBoxButtons.OK MessageBoxIcon.Warning);
            }
            else
            {
                if (Path.GetExtension(path)==“.txt“)
                {
                    ReadAndWrite.ImportDataGridView(dataGridView1 ReadAndWrite.ReadPointTXT(path));

                }
                else if (Path.GetExtension(path)==“.xls“||Path.GetExtension(path)==“.xlsx“)
                {
                    dataGridView1.DataSource = ReadAndWrite.ReadExcel(path);
                }
                else
                {
                    ReadAndWrite.ReadDXFData(path);
                    knownPoint = ReadAndWrite.points;
                    ReadAndWrite.ImportDataGridView(dataGridView1knownPoint);
            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-29 11:16  RegulerGrid\
     目录           0  2018-09-28 16:10  RegulerGrid\RegulerGrid\
     文件         923  2018-09-28 08:08  RegulerGrid\RegulerGrid.sln
     文件       51200  2018-09-29 15:39  RegulerGrid\RegulerGrid.v11.suo
     文件         187  2018-09-28 08:08  RegulerGrid\RegulerGrid\App.config
     目录           0  2018-09-28 14:41  RegulerGrid\RegulerGrid\bin\
     目录           0  2018-09-29 09:33  RegulerGrid\RegulerGrid\bin\Debug\
     文件        1502  2017-06-17 10:02  RegulerGrid\RegulerGrid\bin\Debug\GRID数据.txt
     文件       58880  2018-09-29 10:51  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.exe
     文件         187  2018-09-28 08:08  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.exe.config
     文件       83456  2018-09-29 10:51  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.pdb
     文件       22984  2018-09-29 14:59  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.vshost.exe
     文件         187  2018-09-28 08:08  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.vshost.exe.config
     文件         490  2013-06-18 20:28  RegulerGrid\RegulerGrid\bin\Debug\RegulerGrid.vshost.exe.manifest
     文件     1089858  2018-09-29 09:32  RegulerGrid\RegulerGrid\bin\Debug\result.bmp
     文件       18757  2018-09-29 09:32  RegulerGrid\RegulerGrid\bin\Debug\result.dxf
     文件        1386  2018-09-29 09:32  RegulerGrid\RegulerGrid\bin\Debug\result.txt
     文件        1964  2018-09-29 10:01  RegulerGrid\RegulerGrid\bin\Debug\result.xls
     目录           0  2018-09-28 14:41  RegulerGrid\RegulerGrid\bin\Release\
     文件       11115  2018-09-29 15:07  RegulerGrid\RegulerGrid\Form1.cs
     文件       41236  2018-09-29 10:51  RegulerGrid\RegulerGrid\Form1.Designer.cs
     文件       18743  2018-09-29 10:51  RegulerGrid\RegulerGrid\Form1.resx
     目录           0  2018-09-28 08:08  RegulerGrid\RegulerGrid\obj\
     目录           0  2018-09-29 10:51  RegulerGrid\RegulerGrid\obj\Debug\
     文件        1481  2018-09-29 09:24  RegulerGrid\RegulerGrid\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7162  2018-09-28 16:10  RegulerGrid\RegulerGrid\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         861  2018-09-29 14:59  RegulerGrid\RegulerGrid\obj\Debug\RegulerGrid.csproj.FileListAbsolute.txt
     文件         975  2018-09-29 10:51  RegulerGrid\RegulerGrid\obj\Debug\RegulerGrid.csproj.GenerateResource.Cache
     文件        2382  2018-09-28 15:48  RegulerGrid\RegulerGrid\obj\Debug\RegulerGrid.csprojResolveAssemblyReference.cache
     文件       58880  2018-09-29 10:51  RegulerGrid\RegulerGrid\obj\Debug\RegulerGrid.exe
     文件        9477  2018-09-29 10:51  RegulerGrid\RegulerGrid\obj\Debug\RegulerGrid.Form1.resources
............此处省略19个文件信息

评论

共有 条评论

相关资源