GridData.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #pragma once
  2. #include "OTSParticle.h"
  3. namespace OTSDATA {
  4. typedef enum class __declspec(dllexport) REPORT_GRID_DATA_TYPE
  5. {
  6. INVALID = -1,
  7. MIN = 0,
  8. STRING = 0,
  9. PARTICLE = 1,
  10. INT = 2,
  11. FLOAT = 3,
  12. MAX = 3
  13. }REPORT_GRID_DATA_TYPE;
  14. typedef enum class __declspec(dllexport) REPORT_PARTICLE_GEN_INFO_GRID_CLUMN
  15. {
  16. INVALID = -1,
  17. MIN = 0,
  18. NAME = 0,
  19. IMAGE = 1,
  20. SIZE = 2,
  21. MAXLENGTH = 3,
  22. MINLENGTH =4,
  23. AXIALRATIO = 5,
  24. EquivalentCircleDiameter = 6,
  25. FerretDiameter = 7,
  26. PERP = 8,
  27. PERI = 9,
  28. INSCR = 10,
  29. MEAN = 11,
  30. ELONG = 12,
  31. ASPECT_ELONG = 13,
  32. ASPECT_MAX = 14,
  33. Orientation = 15,
  34. //ELEMENTLIST =3,
  35. MAX = 15
  36. }REPORT_PARTICLE_GEN_INFO_GRID_CLUMN;
  37. typedef enum class __declspec(dllexport) REPORT_PARTICLE_TRIO_INFO_GRID_CLUMN
  38. {
  39. INVALID = -1,
  40. MIN = 0,
  41. SIZE = 0,//Á£¼¶¼¶±ð
  42. Location = 1,
  43. MAX = 1
  44. }REPORT_PARTICLE_TRIO_INFO_GRID_CLUMN;
  45. typedef enum class __declspec(dllexport) REPORT_MEASURE_RESULT_INFO_GRID_CLUMN
  46. {
  47. INVALID = -1,
  48. MIN = 0,
  49. NAME = 0,
  50. INFORMATIN = 1,
  51. MAX = 1
  52. }REPORT_MEASURE_RESULT_INFO_GRID_CLUMN;
  53. typedef enum class __declspec(dllexport) REPORT_SORT_CLASS_GRID_CLUMN
  54. {
  55. INVALID = -1,
  56. MIN = 0,
  57. TOO_SMALL = 0,
  58. OVER_SIZE = 1,
  59. GRAY_NO_INTERS = 2,
  60. LOW_COUNT =3,
  61. NO_INTEREST_ELEMENTS = 4,
  62. NOT_INCLUSION_SIC = 5,
  63. NOT_INCLUSION_FEO = 6,
  64. NOT_IDENTIFIED = 7,
  65. IDENTIFIED = 8,
  66. MAX = 8
  67. }REPORT_SORT_CLASS_GRID_CLUMN;
  68. typedef enum class __declspec(dllexport) REPORT_SORT_KIND_GRID_CLUMN
  69. {
  70. INVALID = -1,
  71. MIN = 0,
  72. NOT_IDENTIFIED = 0,
  73. MAX = 0
  74. }REPORT_SORT_KIND_GRID_CLUMN;
  75. typedef enum class __declspec(dllexport) REPORT_SORT_SIZE_GRID_CLUMN
  76. {
  77. INVALID = -1,
  78. MIN = 0,
  79. USER_DENTIFIED = 0,
  80. MAX = 0
  81. }REPORT_SORT_SIZE_GRID_CLUMN;
  82. typedef enum class __declspec(dllexport) REPORT_PARTICLE_COMPONENT_GRID_CLUMN
  83. {
  84. INVALID = -1,
  85. MIN = 0,
  86. NAME = 0,
  87. COLOUR = 1,
  88. PARTICLE_NUM = 2,
  89. AVE_VALUE = 3,
  90. MAX_VALUE = 4,
  91. MAX = 4
  92. }REPORT_PARTICLE_COMPONENT_GRID_CLUMN;
  93. typedef enum class __declspec(dllexport) REPORT_ELEMENT_COMPONENT_GRID_CLUMN
  94. {
  95. INVALID = -1,
  96. MIN = 0,
  97. NAME = 0,
  98. NUM = 1,
  99. MAX = 1
  100. }REPORT_ELEMENT_COMPONENT_GRID_CLUMN;
  101. typedef enum class __declspec(dllexport) REPORT_AVE_ELEMENT_GRID_CLUMN
  102. {
  103. INVALID = -1,
  104. MIN = 0,
  105. PATICLE_TYPE = 0,
  106. AREA = 1,
  107. MAX = 1
  108. }REPORT_AVE_ELEMENT_GRID_CLUMN;
  109. typedef enum class __declspec(dllexport) REPORT_SIZE_DISTRIBUTION_GRID_CLUMN
  110. {
  111. INVALID = -1,
  112. MIN = 0,
  113. NAME = 0,
  114. COLOUR = 1,
  115. MAX = 1
  116. }REPORT_SIZE_DISTRIBUTION_GRID_CLUMN;
  117. typedef enum class __declspec(dllexport) REPORT_LEVEL_CLASS_GRID_CLUMN
  118. {
  119. INVALID = -1,
  120. MIN = 0,
  121. NAME = 0,
  122. WIDTH = 1,
  123. MAX = 1
  124. }REPORT_LEVEL_CLASSN_GRID_CLUMN;
  125. typedef enum class __declspec(dllexport) REPORT_COMMON_FIVE_GRID_CLUMN
  126. {
  127. INVALID = -1,
  128. MIN = 0,
  129. SULFIDE_OXIDE = 0,
  130. OXIDE = 1,
  131. SULFIDE = 2,
  132. NITRIDES = 3,
  133. SPINEL = 4,
  134. MAX = 4
  135. }REPORT_COMMON_FIVE_GRID_CLUMN;
  136. class __declspec(dllexport) CGridRow
  137. {
  138. public:
  139. // constructor
  140. CGridRow(); // constructor
  141. CGridRow(const CGridRow&); // copy constructor
  142. CGridRow(CGridRow*); // copy constructor
  143. CGridRow& operator=(const CGridRow&); // =operator
  144. BOOL operator==(const CGridRow&); // ==operator
  145. virtual ~CGridRow(); // destructor
  146. // data type
  147. REPORT_GRID_DATA_TYPE GetDataType() { return m_nDataType; }
  148. void SetDataType(REPORT_GRID_DATA_TYPE a_nDataType) { m_nDataType = a_nDataType; }
  149. // get string value
  150. CString GetStringValue() { return m_strValue; }
  151. void SetStringValue(CString a_strValue) { m_strValue = a_strValue; }
  152. COTSParticlePtr GetParticle() { return m_oParticle; }
  153. BOOL SetParticle(COTSParticlePtr a_oParticle);
  154. int GetIntValue() { return m_nIntValue; }
  155. void SetIntValue(int a_nIntValue) { m_nIntValue = a_nIntValue; }
  156. double GetDoubleValue() { return m_dFloatValue; }
  157. void SetDoubleValue(double a_dFloatValue) { m_dFloatValue = a_dFloatValue; }
  158. protected:
  159. // cleanup
  160. void Cleanup();
  161. // initialization
  162. void Init();
  163. // duplication
  164. void Duplicate(const CGridRow& a_oSource);
  165. // data type
  166. REPORT_GRID_DATA_TYPE m_nDataType;
  167. // string data
  168. CString m_strValue;
  169. // particle data
  170. COTSParticlePtr m_oParticle;
  171. // int value
  172. int m_nIntValue;
  173. // float value
  174. double m_dFloatValue;
  175. };
  176. typedef std::shared_ptr<CGridRow> __declspec(dllexport) CGridRowPtr;
  177. typedef std::vector<CGridRowPtr> __declspec(dllexport) CGridRowsList;
  178. class __declspec(dllexport) CGridColumn
  179. {
  180. public:
  181. // constructor
  182. CGridColumn(); // constructor
  183. CGridColumn(const CGridColumn&); // copy constructor
  184. CGridColumn(CGridColumn*); // copy constructor
  185. CGridColumn& operator=(const CGridColumn&); // =operator
  186. BOOL operator==(const CGridColumn&); // ==operator
  187. virtual ~CGridColumn(); // destructor
  188. CString GetName() { return m_strName; }
  189. void SetName(CString a_strName) { m_strName = a_strName; }
  190. CGridRowsList GetRowList() { return m_listGridRows; }
  191. BOOL SetGridRowsList(CGridRowsList a_listGridRows, BOOL a_bClear = TRUE);
  192. protected:
  193. // cleanup
  194. void Cleanup();
  195. // initialization
  196. void Init();
  197. // duplication
  198. void Duplicate(const CGridColumn& a_oSource);
  199. // name
  200. CString m_strName;
  201. // list of rows
  202. CGridRowsList m_listGridRows;
  203. };
  204. typedef std::shared_ptr<CGridColumn> __declspec(dllexport) CGridColumnPtr;
  205. typedef std::vector<CGridColumnPtr> __declspec(dllexport) CGridColumnsList;
  206. class __declspec(dllexport) CGridData
  207. {
  208. public:
  209. // constructor
  210. CGridData(); // constructor
  211. CGridData(const CGridData&); // copy constructor
  212. CGridData(CGridData*); // copy constructor
  213. CGridData& operator=(const CGridData&); // =operator
  214. BOOL operator==(const CGridData&); // ==operator
  215. virtual ~CGridData(); // destructor
  216. CGridColumnsList GetGridColumnList() { return m_listGridColumn; }
  217. BOOL SetGridColumnList(CGridColumnsList a_listGridColumn, BOOL a_bClear = TRUE);
  218. // data source id
  219. std::vector<CString>& GetDataSourceList() { return m_listDataSource; }
  220. BOOL SetDataSourceList(std::vector<CString> a_listDataSource);
  221. int GetDataSourceId() { return m_nDataSourceId; }
  222. BOOL SetDataSourceId(int a_nDataSourceId);
  223. protected:
  224. // cleanup
  225. void Cleanup();
  226. // initialization
  227. void Init();
  228. // duplication
  229. void Duplicate(const CGridData& a_oSource);
  230. // list of column
  231. CGridColumnsList m_listGridColumn;
  232. // data source id
  233. std::vector<CString> m_listDataSource;
  234. int m_nDataSourceId;
  235. };
  236. typedef std::shared_ptr<CGridData> __declspec(dllexport) CGridDataPtr;
  237. typedef std::vector<CGridDataPtr> __declspec(dllexport) CGridDatasList;
  238. /*typedef std::vector<CGridDatasList> __declspec(dllexport) CMultiGridDataList;*/
  239. }