CVisualSampleArea.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
  8. {
  9. public class CVisualSampleArea
  10. {
  11. private bool isSelect;
  12. CRectangleGDIObject m_SampleGDIObject;//
  13. CRectangleGDIObject m_MeasureGDIObject;//path
  14. private List<Point> polygonPathPoints;
  15. private bool isPolygon;
  16. public CVisualSampleArea()
  17. {
  18. m_SampleGDIObject = new CRectangleGDIObject();
  19. //测量区域
  20. m_MeasureGDIObject = new CRectangleGDIObject();
  21. }
  22. public CRectangleGDIObject SampleGDIObject { get => m_SampleGDIObject; set => m_SampleGDIObject = value; }
  23. public CRectangleGDIObject MeasureGDIObject { get => m_MeasureGDIObject; set => m_MeasureGDIObject = value; }
  24. public string GetSampleName()
  25. {
  26. return m_SampleGDIObject.SampleName;
  27. }
  28. public void SetSampleName(string value)
  29. {
  30. m_SampleGDIObject.SampleName = value;
  31. }
  32. public List<Point> PolygonPathPoints { get => polygonPathPoints; set => polygonPathPoints = value; }
  33. public bool IsWorkSample()
  34. {
  35. return m_SampleGDIObject.IsWorkSample;
  36. }
  37. public void SetIsWorkSample(bool value)
  38. {
  39. m_SampleGDIObject.IsWorkSample = value;
  40. }
  41. public List<CRectangleGDIObject> GetMeasureFieldGDIObjects()
  42. {
  43. return m_MeasureGDIObject.SubItems();
  44. }
  45. public void SetMeasureFieldGDIObjects(List<CRectangleGDIObject> value)
  46. {
  47. m_MeasureGDIObject.SubItems().Clear();
  48. foreach (var gdi in value)
  49. {
  50. m_MeasureGDIObject.SubItems().Add(gdi);
  51. }
  52. }
  53. public bool IsPolygon { get => isPolygon; set => isPolygon = value; }
  54. public bool IsSelect { get => isSelect; set => isSelect = value; }
  55. public void AddFieldGDIObject(CRectangleGDIObject gdi)
  56. {
  57. gdi.SetZoomNumber(m_MeasureGDIObject.GetZoomNumber());
  58. gdi.SetDisplayRefPoint(m_MeasureGDIObject.GetDisplayRefPoint());
  59. m_MeasureGDIObject.SubItems().Add(gdi);
  60. }
  61. }
  62. }