CVisualSampleArea.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using OTSMeasureApp._4_OTSSamplespaceGraphicsPanel.VisualGDIObjects;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
  9. {
  10. public class CVisualSampleArea
  11. {
  12. CDisplayGDIObject m_SampleHoleGDIObject;//
  13. CMeasureArea m_MeasureGDIObject;//path
  14. //private List<Point> polygonPathPoints;
  15. public float GetZoomNum()
  16. {
  17. return m_SampleHoleGDIObject.GetZoomNumber();
  18. }
  19. public PointF GetDisplayRefPoint()
  20. {
  21. return m_SampleHoleGDIObject.GetDisplayRefPoint();
  22. }
  23. public CVisualSampleArea()
  24. {
  25. m_SampleHoleGDIObject = new CDisplayGDIObject();
  26. //测量区域
  27. m_MeasureGDIObject = new CMeasureArea();
  28. }
  29. public CDisplayGDIObject GetSampleGDIObject()
  30. {
  31. return m_SampleHoleGDIObject;
  32. }
  33. public void SetSampleGDIObject(CDisplayGDIObject value)
  34. {
  35. m_SampleHoleGDIObject = value;
  36. }
  37. public CMeasureArea GetMeasureGDIObject()
  38. {
  39. return m_MeasureGDIObject;
  40. }
  41. public void SetMeasureGDIObject(CMeasureArea value)
  42. {
  43. m_MeasureGDIObject = value;
  44. }
  45. public string GetSampleName()
  46. {
  47. return m_SampleHoleGDIObject.SampleName;
  48. }
  49. public void SetSampleName(string value)
  50. {
  51. m_SampleHoleGDIObject.SampleName = value;
  52. }
  53. //public List<Point> PolygonPathPoints { get => polygonPathPoints; set => polygonPathPoints = value; }
  54. public bool IsWorkSample()
  55. {
  56. return m_SampleHoleGDIObject.IsWorkSample;
  57. }
  58. public void SetIsWorkSample(bool value)
  59. {
  60. m_SampleHoleGDIObject.IsWorkSample = value;
  61. }
  62. public List<CVisualFieldGDIObject> GetMeasureFieldGDIObjects()
  63. {
  64. return m_MeasureGDIObject.SubItems();
  65. }
  66. public void SetMeasureFieldGDIObjects(List<CVisualFieldGDIObject> value)
  67. {
  68. m_MeasureGDIObject.ClearSubItems();
  69. foreach (var gdi in value)
  70. {
  71. m_MeasureGDIObject.AddSubItems(gdi);
  72. }
  73. }
  74. public void AddFieldGDIObject( CVisualFieldGDIObject gdi)
  75. {
  76. gdi.SetZoomNumber(m_MeasureGDIObject.GetZoomNumber());
  77. gdi.SetDisplayRefPoint(m_MeasureGDIObject.GetDisplayRefPoint());
  78. m_MeasureGDIObject.AddSubItems(gdi);
  79. }
  80. }
  81. }