GreyClusteringSampleTable.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef GREYCLUSTERINGSAMPLETABLE_H
  2. #define GREYCLUSTERINGSAMPLETABLE_H
  3. #include <QStandardItemModel>
  4. #include <QTableView>
  5. #include <QVector>
  6. #include <QSharedPointer>
  7. class CMind;
  8. struct GreyRange
  9. {
  10. QString name;
  11. bool leftClose; // 左闭合
  12. double leftValue;
  13. bool rightClose; // 右闭合
  14. double rightValue;
  15. };
  16. struct GreyClusteringValue
  17. {
  18. QString units; // 单位
  19. double weiget;
  20. QVector<GreyRange> greyRanges; // 灰类
  21. double leftExtension; // 延拓值左
  22. double rightExtension; // 延拓值右
  23. double oldValue; // 实现值改前
  24. double newValue; // 实现值改后
  25. };
  26. struct GreyClusteringItem
  27. {
  28. QString indexName; // 指标名字
  29. int row;
  30. int col;
  31. int rowSpan;
  32. int colSpan;
  33. QSharedPointer<GreyClusteringValue> value;
  34. };
  35. class GreyClusteringSampleTable : public QTableView
  36. {
  37. Q_OBJECT
  38. public:
  39. GreyClusteringSampleTable(CMind *mind, int grayNumber, QWidget *parent = nullptr);
  40. void refreshTableView();
  41. private:
  42. void init();
  43. void initClusteringItems();
  44. private:
  45. QVector<GreyClusteringItem> m_greyClusterings;
  46. QStandardItemModel *m_model;
  47. CMind *m_mind;
  48. int m_nodeDepth; // 节点深度
  49. int m_rowCount; // 行数
  50. QStringList m_grayNames;
  51. const int nodeDepth = 2; // 节点深度
  52. int m_grayNumber;
  53. };
  54. #endif // GREYCLUSTERINGSAMPLETABLE_H