Переглянути джерело

删除颗粒分割部分代码以防止冲突

CXS 3 роки тому
батько
коміт
3ef9c8a336

+ 0 - 95
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -40,15 +40,6 @@ namespace OTSIncAReportGraph.Controls
        public RectangleF Rect ;
 
     }
-    public struct ParticleSegmentation
-    {
-        public Point StartPoint;
-        public bool IsParticleSegmentation;
-        public Point EndPoint;
-        public Particle ParticleData;
-        public bool IsParticleSegmentationFinish;
-        public List<Particle> SegmentationParticles;
-    }
     public enum RightButtonMenu
     { 
        Include=0,
@@ -91,7 +82,6 @@ namespace OTSIncAReportGraph.Controls
         double ls_d_cz_height;
         #region 变量定义
         private SelectTool m_SelectTool;
-        private ParticleSegmentation m_ParticleSegmentation;
         //缩放的基数,临时变量
         private float m_Zoom_Base = 0;
 
@@ -668,16 +658,6 @@ namespace OTSIncAReportGraph.Controls
                 }
             }
             #endregion
-            #region //判断是否使用颗粒分割,是的话,那么这里就开始绘制------------------------
-            if (m_ParticleSegmentation.IsParticleSegmentation)
-            {
-                e.Graphics.DrawLine(new Pen(Color.Red), m_ParticleSegmentation.StartPoint.X, m_ParticleSegmentation.StartPoint.Y, m_ParticleSegmentation.EndPoint.X, m_ParticleSegmentation.EndPoint.Y);
-            }
-            if (m_ParticleSegmentation.IsParticleSegmentationFinish)
-            {
-                e.Graphics.DrawLine(new Pen(Color.Red), m_ParticleSegmentation.StartPoint.X, m_ParticleSegmentation.StartPoint.Y, m_ParticleSegmentation.EndPoint.X, m_ParticleSegmentation.EndPoint.Y);
-            }
-            #endregion
             #region 绘制网格线,帧图边框部份
             if (true == m_is_showgrid)
             {
@@ -886,10 +866,6 @@ namespace OTSIncAReportGraph.Controls
                   
                     m_SelectTool.StartPoint = e.Location;
                 }
-                else if (m_ParticleSegmentation.IsParticleSegmentation)
-                {
-                    m_ParticleSegmentation.StartPoint= e.Location;
-                }
                 else
                 {
                     bool ifClickOnParticle=false;
@@ -973,13 +949,6 @@ namespace OTSIncAReportGraph.Controls
                     }
                 }
             }
-            else if(m_ParticleSegmentation.IsParticleSegmentation)
-            {
-                if (e.Button == MouseButtons.Left)
-                {
-                    m_ParticleSegmentation.EndPoint = e.Location;
-                }
-            }
             
             else
             {
@@ -1163,24 +1132,6 @@ namespace OTSIncAReportGraph.Controls
                     m_SelectTool.IsSelecting = false;
 
                 }
-                else if(m_ParticleSegmentation.IsParticleSegmentation)
-                {
-                    m_ParticleSegmentation.EndPoint = e.Location;
-                    GraphicsPath ls_gpath = new GraphicsPath();
-                    //ls_gpath.AddLine(m_ParticleSegmentation.StartPoint.X, m_ParticleSegmentation.StartPoint.Y, m_ParticleSegmentation.EndPoint.X, m_ParticleSegmentation.EndPoint.Y);
-                    //m_ParticleSegmentation.IsParticleSegmentation = false;
-                    DialogResult res = MessageBox.Show("Is the division complete?");
-                    if (res == DialogResult.OK)
-                    {
-                        Particle particle1 = new Particle();
-                        Particle particle2 = new Particle();
-
-                        GetTheSegmentsOfTheDividedParticle(m_ParticleSegmentation.StartPoint, m_ParticleSegmentation.EndPoint, m_mouseOver_dparticle.objParticleData,ref particle1,ref particle2);
-
-                        m_ParticleSegmentation.IsParticleSegmentation = false;
-                        m_ParticleSegmentation.IsParticleSegmentationFinish = true;
-                    }
-                }
                 else
                 {
                     if (m_isDrag)
@@ -1257,7 +1208,6 @@ namespace OTSIncAReportGraph.Controls
 
                         CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = true;
                         DisplayParticle dp = (DisplayParticle)item;
-                        m_ParticleSegmentation.ParticleData = dp.objParticleData;
                     }
                     if (((DisplayParticle)item).IsSelect)
                     {
@@ -1815,15 +1765,6 @@ namespace OTSIncAReportGraph.Controls
         {
             control_Ruler1.Visible = b_show;
         }
-        /// <summary>
-        /// 颗粒分割
-        /// </summary>
-        public void Particle_Segmentation()
-        {
-            m_ParticleSegmentation.IsParticleSegmentation = true;
-            m_ParticleSegmentation.StartPoint = new Point();
-            m_ParticleSegmentation.EndPoint = new Point();
-        }
 
         /// <summary>
         /// 是否进行矩形多选操作
@@ -2135,41 +2076,5 @@ namespace OTSIncAReportGraph.Controls
             }
            
         }
-        int GetsegmentationX(Point P1,Point P2,int y)
-        {
-            int x = (y - P1.Y * P2.X + P1.X * P2.Y) / (P2.Y - P1.Y);
-            return x;
-        }
-        void GetTheSegmentsOfTheDividedParticle(Point P1, Point P2,Particle DividedParticle,ref Particle Particle1, ref Particle Particle2)
-        {
-            for (int i = 0; i < DividedParticle.SegmentList.Count; i++)
-            {
-                int h = DividedParticle.SegmentList[i].Height;
-                Segment segment = DividedParticle.SegmentList[i];
-                segment.Start = DividedParticle.SegmentList[i].Start;
-                int end = segment.Start - GetsegmentationX(P1, P2, h);
-                segment.Length = Math.Abs(end);
-                Particle1.SegmentList.Add(segment);
-
-                Segment segment2 = new Segment();
-                segment.Start = end;
-                segment.Length = DividedParticle.SegmentList[i].Length- segment.Length;
-                Particle2.SegmentList.Add(segment2);
-            }
-        }
-        private void ParticleSegmentation_Click(object sender, EventArgs e)
-        {
-            
-            //foreach (BaseObject item in m_list_allDPart)
-            //{
-            //    DisplayParticle dp = (DisplayParticle)item;
-            //    if (ReportFun.WhetherInRange(dp, ))
-            //    {
-            //        List<Segment> segments = dp.objParticleData.SegmentList;
-            //    }
-            //}
-            Particle_Segmentation();
-        }
-      
     }
 }

+ 2 - 15
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.designer.cs

@@ -35,7 +35,6 @@
             this.toolStripMenuItem_copyimage = new System.Windows.Forms.ToolStripMenuItem();
             this.ExportoriginalspliceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItemDelete_Particle = new System.Windows.Forms.ToolStripMenuItem();
-            this.ParticleSegmentation = new System.Windows.Forms.ToolStripMenuItem();
             this.CMenuStrip.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -47,8 +46,7 @@
             this.ToolStripMenuItem_movesempoint,
             this.toolStripMenuItem_copyimage,
             this.ExportoriginalspliceToolStripMenuItem,
-            this.ToolStripMenuItemDelete_Particle,
-            this.ParticleSegmentation});
+            this.ToolStripMenuItemDelete_Particle});
             this.CMenuStrip.Name = "contextMenuStrip1";
             this.CMenuStrip.Size = new System.Drawing.Size(219, 154);
             // 
@@ -90,17 +88,7 @@
             this.ToolStripMenuItemDelete_Particle.Size = new System.Drawing.Size(218, 30);
             this.ToolStripMenuItemDelete_Particle.Text = "Delete particles";
             this.ToolStripMenuItemDelete_Particle.Click += new System.EventHandler(this.ToolStripMenuItemDelete_Particle_Click);
-            // 
-            // ParticleSegmentation
-            // 
-
-
-
-
-            this.ParticleSegmentation.Name = "ParticleSegmentation";
-            this.ParticleSegmentation.Size = new System.Drawing.Size(253, 30);
-            this.ParticleSegmentation.Text = "分割颗粒";
-            this.ParticleSegmentation.Click += new System.EventHandler(this.ParticleSegmentation_Click);
+           
             // 
             // Control_DrawDistrbutionImageAndBSE
             // 
@@ -125,6 +113,5 @@
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_copyimage;
         private System.Windows.Forms.ToolStripMenuItem ExportoriginalspliceToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItemDelete_Particle;
-        private System.Windows.Forms.ToolStripMenuItem ParticleSegmentation;
     }
 }