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