using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel { public class CVisualSampleArea { CRectangleGDIObject m_SampleGDIObject;// CRectangleGDIObject m_MeasureGDIObject;//path private List frameOfHoleGDIObjects;// record all the position of the sampleHole image private List polygonPathPoints; public float GetZoomNum() { return m_SampleGDIObject.GetZoomNumber(); } public PointF GetDisplayRefPoint() { return m_SampleGDIObject.GetDisplayRefPoint(); } public CVisualSampleArea() { m_SampleGDIObject = new CRectangleGDIObject(); //测量区域 m_MeasureGDIObject = new CRectangleGDIObject(); frameOfHoleGDIObjects = new List(); } public CRectangleGDIObject GetSampleGDIObject() { return m_SampleGDIObject; } public void SetSampleGDIObject(CRectangleGDIObject value) { m_SampleGDIObject = value; } public CRectangleGDIObject GetMeasureGDIObject() { return m_MeasureGDIObject; } public void SetMeasureGDIObject(CRectangleGDIObject value) { m_MeasureGDIObject = value; } public string GetSampleName() { return m_SampleGDIObject.SampleName; } public void SetSampleName(string value) { m_SampleGDIObject.SampleName = value; } public List PolygonPathPoints { get => polygonPathPoints; set => polygonPathPoints = value; } public List FrameOfHoleGDIObjects { get => frameOfHoleGDIObjects; set => frameOfHoleGDIObjects = value; } public bool IsWorkSample() { return m_SampleGDIObject.IsWorkSample; } public void SetIsWorkSample(bool value) { m_SampleGDIObject.IsWorkSample = value; } public List GetMeasureFieldGDIObjects() { return m_MeasureGDIObject.SubItems(); } public void SetMeasureFieldGDIObjects(List value) { m_MeasureGDIObject.ClearSubItems(); foreach (var gdi in value) { m_MeasureGDIObject.AddSubItems(gdi); } } public void AddFieldGDIObject(CRectangleGDIObject gdi) { gdi.SetZoomNumber(m_MeasureGDIObject.GetZoomNumber()); gdi.SetDisplayRefPoint(m_MeasureGDIObject.GetDisplayRefPoint()); m_MeasureGDIObject.AddSubItems(gdi); } } }