Blame view

UtteranceTreeWidget.h 1.51 KB
3f2992b2c   bostx   V1.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  #ifndef UTTERANCETREEWIDGET_H
  #define UTTERANCETREEWIDGET_H
  
  #include <QWidget>
  #include <QRectF>
  #include <QMap>
  
  #include <armadillo>
  
  #include "UtteranceTree.h"
  
  class UtteranceTreeWidget: public QWidget
  {
    Q_OBJECT
    
   public:
    UtteranceTreeWidget(int width = 480, int height = 270, QWidget *parent = 0);
    QList<QList<int>> getPartition();
  
    public slots:
      void updateUtteranceTree(const arma::mat &S, const arma::mat &W, const arma::umat &map, const arma::mat &SigmaInv);
      void setDistance(UtteranceTree::DistType dist);
      void setCovInv(const arma::mat &CovInv);
      void setAgrCrit(UtteranceTree::AgrCrit agr);
      void setPartitionMethod(UtteranceTree::PartMeth partMeth);
      void setWeight(const arma::mat &W);
      void setCurrSubtitle(int subIdx);
      void normalizeVectors(bool checked);
      void setDiff(const arma::mat &Diff);
      void releasePos(bool released);
      
   signals:
      void playSubtitle(QList<int> utter);
      void setSpeakers(QList<int> spkIdx);
      
   protected:
    void paintEvent(QPaintEvent * event);
    void mousePressEvent(QMouseEvent * event);
    void mouseDoubleClickEvent(QMouseEvent * event);
    void mouseMoveEvent(QMouseEvent * event);
  
   private:
    int m_width;
    int m_height;
    arma::mat m_S;
    arma::mat m_unnormS;
    arma::mat m_W;
    arma::mat m_SigmaInv;
    arma::umat m_map;
    UtteranceTree *m_tree;
    QString m_currSub;
    QVector<qreal> m_cutDist;
    QList<QList<int>> m_partition;
    qreal m_yPad;
    qreal m_YRatio;
    QPoint m_mousePos;
    QList<int> m_selectedUtter;
    bool m_posReleased;
  };
  
  #endif