Shapeworks Studio  2.1
Shape analysis software suite
bargraph.h
1 #ifndef BARGRAPH_H
2 #define BARGRAPH_H
3 
4 #include <QWidget>
5 #include <utility>
6 #include <vector>
7 
8 class BarGraph : public QWidget
9 {
10  Q_OBJECT
11 public:
12  BarGraph(QWidget *parent = 0);
13  ~BarGraph();
14  void setData(std::vector<double> values);
15  void paintBargraph(QPainter& painter);
16  QBrush getBrush() const;
17  void setBrush(const QBrush &value);
18  void setLogScale(bool b);
19 private:
20  virtual void paintEvent(QPaintEvent *event);
21  virtual void resizeEvent(QResizeEvent *event);
22  void recalcBasicValues();
23  //members
24  std::vector<double> values;
25  double max_val,min_val;
26  int barwidth,margin;
27  std::vector<QRect> bars;
28  bool use_log_;
29 };
30 
31 #endif // BARGRAPH_H