| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #pragma once
- #include "OTSParticle.h"
- #include "OTSRect.h"
- namespace OTSDATA {
- class __declspec(dllexport) COTSFieldData : public xmls::ISlo
- {
- public:
- // constructor
- COTSFieldData(); // constructor
- COTSFieldData(const COTSFieldData&); // copy constructor
- COTSFieldData(COTSFieldData*); // copy constructor
- COTSFieldData& operator=(const COTSFieldData&); // =operator
- BOOL operator==(const COTSFieldData&); // ==operator
- virtual ~COTSFieldData(); // destructor
- //void Serialize(CArchive& ar); // serializatio
- virtual void Serialize(bool isStoring, tinyxml2::XMLDocument *classDoc, tinyxml2::XMLElement *rootNode);
- // ID
- int GetId() { return m_nID; }
- void SetId(int a_nID) { m_nID = a_nID; }
- // position (from field center manager)
- CPoint GetPosition() { return m_poiPos; }
- void SetPosition(CPoint a_poiPos) { m_poiPos.x = a_poiPos.x;m_poiPos.y=a_poiPos.y; }
- COTSRect GetOTSRect() { return m_rect; }
- void SetOTSRect(COTSRect r) { m_rect = r; }
-
- // particle list
- COTSParticleList& GetParticleList() { return m_listParticles; }
- void SetParticleList(COTSParticleList& a_listParticles, BOOL a_bClear = TRUE);
-
- // particle list
- COTSParticleList& GetBigParticleList() { return m_listBigParticles; }
- void SetBigParticleList(COTSParticleList& a_listParticles, BOOL a_bClear = TRUE);
- void AddParticle(COTSParticlePtr a_Particle) { m_listBigParticles.push_back(a_Particle); };
- //get bordered particles
- COTSParticleList GetTopBorderedBigParticles();
- //get bordered particles
- COTSParticleList GetBottomBorderedBigParticles();
- //get bordered particles
- COTSParticleList GetLeftBorderedBigParticles();
- //get bordered particles
- COTSParticleList GetRightBorderedBigParticles();
- // is empty
- BOOL IsEmpty() { return m_listParticles.empty(); }
- long Width;
- long Height;
- bool GetLeftBorderParticlesBiasDefine() { return leftBorderParticlesBias; }
- void SetLeftBorderParticlesBiasDefine(bool ifSelect) { leftBorderParticlesBias = ifSelect; }
- bool GetRightBorderParticlesBiasDefine() { return rightBorderParticlesBias; }
- void SetRightBorderParticlesBiasDefine(bool ifSelect) { rightBorderParticlesBias = ifSelect; }
- bool GetUpBorderParticlesBiasDefine() { return upBorderParticlesBias; }
- void SetUpBorderParticlesBiasDefine(bool ifSelect) { upBorderParticlesBias = ifSelect; }
- bool GetDownBorderParticlesBiasDefine() { return downBorderParticlesBias; }
- void SetDownBorderParticlesBiasDefine(bool ifSelect) { downBorderParticlesBias = ifSelect; }
- protected:
- // cleanup
- void Cleanup();
- // initialization
- void Init();
- // duplication
- void Duplicate(const COTSFieldData& a_oSource);
- // ID
- int m_nID;
- double m_pixelSize;
- COTSRect m_rect;
- // position (from field center manager)
- CPoint m_poiPos;
- // field file folder
- //CString m_strFieldFileFolder;
- // particle list
- COTSParticleList m_listParticles;
- //valid big particles
- COTSParticleList m_listBigParticles;//used for merging with other field later.
- bool leftBorderParticlesBias=true;//true means the particles on the leftBorder will be included.
- bool rightBorderParticlesBias=true;
- bool upBorderParticlesBias=true;
- bool downBorderParticlesBias=true;
- };
- typedef std::shared_ptr<COTSFieldData> __declspec(dllexport) COTSFieldDataPtr;
- typedef std::vector<COTSFieldDataPtr> __declspec(dllexport) COTSFieldDataList;
- }
|