OTSFieldData.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #pragma once
  2. #include "OTSParticle.h"
  3. #include "OTSRect.h"
  4. namespace OTSDATA {
  5. class __declspec(dllexport) COTSFieldData : public xmls::ISlo
  6. {
  7. public:
  8. // constructor
  9. COTSFieldData(); // constructor
  10. COTSFieldData(const COTSFieldData&); // copy constructor
  11. COTSFieldData(COTSFieldData*); // copy constructor
  12. COTSFieldData& operator=(const COTSFieldData&); // =operator
  13. BOOL operator==(const COTSFieldData&); // ==operator
  14. virtual ~COTSFieldData(); // destructor
  15. //void Serialize(CArchive& ar); // serializatio
  16. virtual void Serialize(bool isStoring, tinyxml2::XMLDocument *classDoc, tinyxml2::XMLElement *rootNode);
  17. // ID
  18. int GetId() { return m_nID; }
  19. void SetId(int a_nID) { m_nID = a_nID; }
  20. // position (from field center manager)
  21. CPoint GetPosition() { return m_poiPos; }
  22. void SetPosition(CPoint a_poiPos) { m_poiPos.x = a_poiPos.x;m_poiPos.y=a_poiPos.y; }
  23. COTSRect GetOTSRect() { return m_rect; }
  24. void SetOTSRect(COTSRect r) { m_rect = r; }
  25. // particle list
  26. COTSParticleList& GetParticleList() { return m_listParticles; }
  27. void SetParticleList(COTSParticleList& a_listParticles, BOOL a_bClear = TRUE);
  28. // particle list
  29. COTSParticleList& GetBigParticleList() { return m_listBigParticles; }
  30. void SetBigParticleList(COTSParticleList& a_listParticles, BOOL a_bClear = TRUE);
  31. void AddParticle(COTSParticlePtr a_Particle) { m_listBigParticles.push_back(a_Particle); };
  32. //get bordered particles
  33. COTSParticleList GetTopBorderedBigParticles();
  34. //get bordered particles
  35. COTSParticleList GetBottomBorderedBigParticles();
  36. //get bordered particles
  37. COTSParticleList GetLeftBorderedBigParticles();
  38. //get bordered particles
  39. COTSParticleList GetRightBorderedBigParticles();
  40. // is empty
  41. BOOL IsEmpty() { return m_listParticles.empty(); }
  42. long Width;
  43. long Height;
  44. bool GetLeftBorderParticlesBiasDefine() { return leftBorderParticlesBias; }
  45. void SetLeftBorderParticlesBiasDefine(bool ifSelect) { leftBorderParticlesBias = ifSelect; }
  46. bool GetRightBorderParticlesBiasDefine() { return rightBorderParticlesBias; }
  47. void SetRightBorderParticlesBiasDefine(bool ifSelect) { rightBorderParticlesBias = ifSelect; }
  48. bool GetUpBorderParticlesBiasDefine() { return upBorderParticlesBias; }
  49. void SetUpBorderParticlesBiasDefine(bool ifSelect) { upBorderParticlesBias = ifSelect; }
  50. bool GetDownBorderParticlesBiasDefine() { return downBorderParticlesBias; }
  51. void SetDownBorderParticlesBiasDefine(bool ifSelect) { downBorderParticlesBias = ifSelect; }
  52. protected:
  53. // cleanup
  54. void Cleanup();
  55. // initialization
  56. void Init();
  57. // duplication
  58. void Duplicate(const COTSFieldData& a_oSource);
  59. // ID
  60. int m_nID;
  61. double m_pixelSize;
  62. COTSRect m_rect;
  63. // position (from field center manager)
  64. CPoint m_poiPos;
  65. // field file folder
  66. //CString m_strFieldFileFolder;
  67. // particle list
  68. COTSParticleList m_listParticles;
  69. //valid big particles
  70. COTSParticleList m_listBigParticles;//used for merging with other field later.
  71. bool leftBorderParticlesBias=true;//true means the particles on the leftBorder will be included.
  72. bool rightBorderParticlesBias=true;
  73. bool upBorderParticlesBias=true;
  74. bool downBorderParticlesBias=true;
  75. };
  76. typedef std::shared_ptr<COTSFieldData> __declspec(dllexport) COTSFieldDataPtr;
  77. typedef std::vector<COTSFieldDataPtr> __declspec(dllexport) COTSFieldDataList;
  78. }