CVisualSampleArea.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. CRectangleGDIObject m_SampleGDIObject;//
  12. CRectangleGDIObject m_MeasureGDIObject;//path
  13. public List<CRectangleGDIObject> m_ImageGDIObjects;
  14. //BSE图像帧图 为了获取位置与尺寸
  15. public List<CRectangleGDIObject> m_ImageOfFieldGDIObjects;
  16. private List<Point> polygonPathPoints;
  17. public float GetZoomNum()
  18. {
  19. return m_SampleGDIObject.GetZoomNumber();
  20. }
  21. public PointF GetDisplayRefPoint()
  22. {
  23. return m_SampleGDIObject.GetDisplayRefPoint();
  24. }
  25. public CVisualSampleArea()
  26. {
  27. m_SampleGDIObject = new CRectangleGDIObject();
  28. //测量区域
  29. m_MeasureGDIObject = new CRectangleGDIObject();
  30. m_ImageGDIObjects = new List<CRectangleGDIObject>();
  31. m_ImageOfFieldGDIObjects = new List<CRectangleGDIObject>();
  32. }
  33. public CRectangleGDIObject GetSampleGDIObject()
  34. {
  35. return m_SampleGDIObject;
  36. }
  37. public void SetSampleGDIObject(CRectangleGDIObject value)
  38. {
  39. m_SampleGDIObject = value;
  40. }
  41. public CRectangleGDIObject GetMeasureGDIObject()
  42. {
  43. return m_MeasureGDIObject;
  44. }
  45. public void SetMeasureGDIObject(CRectangleGDIObject value)
  46. {
  47. m_MeasureGDIObject = value;
  48. }
  49. public string GetSampleName()
  50. {
  51. return m_SampleGDIObject.SampleName;
  52. }
  53. public void SetSampleName(string value)
  54. {
  55. m_SampleGDIObject.SampleName = value;
  56. }
  57. public List<Point> PolygonPathPoints { get => polygonPathPoints; set => polygonPathPoints = value; }
  58. public bool IsWorkSample()
  59. {
  60. return m_SampleGDIObject.IsWorkSample;
  61. }
  62. public void SetIsWorkSample(bool value)
  63. {
  64. m_SampleGDIObject.IsWorkSample = value;
  65. }
  66. public List<CRectangleGDIObject> GetMeasureFieldGDIObjects()
  67. {
  68. return m_MeasureGDIObject.SubItems();
  69. }
  70. public void SetMeasureFieldGDIObjects(List<CRectangleGDIObject> value)
  71. {
  72. m_MeasureGDIObject.SubItems().Clear();
  73. foreach (var gdi in value)
  74. {
  75. m_MeasureGDIObject.SubItems().Add(gdi);
  76. }
  77. }
  78. public void AddFieldGDIObject(CRectangleGDIObject gdi)
  79. {
  80. gdi.SetZoomNumber(m_MeasureGDIObject.GetZoomNumber());
  81. gdi.SetDisplayRefPoint(m_MeasureGDIObject.GetDisplayRefPoint());
  82. m_MeasureGDIObject.SubItems().Add(gdi);
  83. }
  84. }
  85. }