CHoleBSEImg.cs 2.2 KB

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