|
@@ -40,15 +40,6 @@ namespace OTSIncAReportGraph.Controls
|
|
public RectangleF Rect ;
|
|
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
|
|
public enum RightButtonMenu
|
|
{
|
|
{
|
|
Include=0,
|
|
Include=0,
|
|
@@ -91,7 +82,6 @@ namespace OTSIncAReportGraph.Controls
|
|
double ls_d_cz_height;
|
|
double ls_d_cz_height;
|
|
#region 变量定义
|
|
#region 变量定义
|
|
private SelectTool m_SelectTool;
|
|
private SelectTool m_SelectTool;
|
|
- private ParticleSegmentation m_ParticleSegmentation;
|
|
|
|
//缩放的基数,临时变量
|
|
//缩放的基数,临时变量
|
|
private float m_Zoom_Base = 0;
|
|
private float m_Zoom_Base = 0;
|
|
|
|
|
|
@@ -668,16 +658,6 @@ namespace OTSIncAReportGraph.Controls
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
#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 绘制网格线,帧图边框部份
|
|
#region 绘制网格线,帧图边框部份
|
|
if (true == m_is_showgrid)
|
|
if (true == m_is_showgrid)
|
|
{
|
|
{
|
|
@@ -886,10 +866,6 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
m_SelectTool.StartPoint = e.Location;
|
|
m_SelectTool.StartPoint = e.Location;
|
|
}
|
|
}
|
|
- else if (m_ParticleSegmentation.IsParticleSegmentation)
|
|
|
|
- {
|
|
|
|
- m_ParticleSegmentation.StartPoint= e.Location;
|
|
|
|
- }
|
|
|
|
else
|
|
else
|
|
{
|
|
{
|
|
bool ifClickOnParticle=false;
|
|
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
|
|
else
|
|
{
|
|
{
|
|
@@ -1163,24 +1132,6 @@ namespace OTSIncAReportGraph.Controls
|
|
m_SelectTool.IsSelecting = false;
|
|
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
|
|
else
|
|
{
|
|
{
|
|
if (m_isDrag)
|
|
if (m_isDrag)
|
|
@@ -1257,7 +1208,6 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = true;
|
|
CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = true;
|
|
DisplayParticle dp = (DisplayParticle)item;
|
|
DisplayParticle dp = (DisplayParticle)item;
|
|
- m_ParticleSegmentation.ParticleData = dp.objParticleData;
|
|
|
|
}
|
|
}
|
|
if (((DisplayParticle)item).IsSelect)
|
|
if (((DisplayParticle)item).IsSelect)
|
|
{
|
|
{
|
|
@@ -1815,15 +1765,6 @@ namespace OTSIncAReportGraph.Controls
|
|
{
|
|
{
|
|
control_Ruler1.Visible = b_show;
|
|
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>
|
|
/// <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();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|