CHoleBSEImg.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. 
  2. using OTSCLRINTERFACE;
  3. using System.Drawing;
  4. namespace OTSDataType
  5. {
  6. public class CHoleBSEImg : CBSEImgClr
  7. {
  8. //hole name
  9. //protected int m_nHoleID;
  10. //image position
  11. protected System.Drawing.Point m_poiPosition = new System.Drawing.Point();
  12. public CHoleBSEImg()
  13. {
  14. Init();
  15. }
  16. public CHoleBSEImg(Rectangle a_rectImage, System.Drawing.Point a_poiPosition) // constructor
  17. {
  18. Init();
  19. // set image rectangle and create memory for image data
  20. SetImageRect(a_rectImage);
  21. //m_nHoleID = a_nHoleID;
  22. m_poiPosition = a_poiPosition;
  23. }
  24. public CHoleBSEImg(CHoleBSEImg a_oSource)
  25. {
  26. if (a_oSource == null)
  27. {
  28. return;
  29. }
  30. // can't copy itself
  31. if (a_oSource == this)
  32. {
  33. return;
  34. }
  35. // copy data over
  36. Duplicate(a_oSource);
  37. }
  38. public bool Equals(CHoleBSEImg a_oSource)
  39. {
  40. //if(m_nHoleID!= a_oSource.m_nHoleID)
  41. //{
  42. // return false;
  43. //}
  44. if(m_poiPosition!= a_oSource.m_poiPosition)
  45. {
  46. return false;
  47. }
  48. return true;
  49. }
  50. // HoleID
  51. //public int GetHoleID()
  52. //{
  53. // return m_nHoleID;
  54. //}
  55. //public void SetHoleID(int a_nHoleID)
  56. //{
  57. // m_nHoleID = a_nHoleID;
  58. //}
  59. // position
  60. public System.Drawing.Point GetPosition()
  61. {
  62. return m_poiPosition;
  63. }
  64. public void SetPosition(System.Drawing.Point a_poiPosition)
  65. {
  66. m_poiPosition = a_poiPosition;
  67. }
  68. // Initialization
  69. protected void Init()
  70. {
  71. // base class initialization
  72. //base.Init();
  73. // initialization
  74. //m_nHoleID = 0;
  75. m_poiPosition = new System.Drawing.Point(0, 0);
  76. }
  77. // duplication
  78. protected void Duplicate(CHoleBSEImg a_oSource)
  79. {
  80. // copy data over
  81. //m_nHoleID = a_oSource.m_nHoleID;
  82. m_poiPosition = a_oSource.m_poiPosition;
  83. }
  84. }
  85. }