CVisualSampleArea.cs 2.9 KB

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