CVisualSampleArea.cs 2.6 KB

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