Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkScalarBar.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB
18 #define MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB
19 
20 #include <MitkQtOverlaysExports.h>
21 #include <mitkCommon.h>
22 
23 #include <QPen>
24 #include <QWidget>
25 
26 class MITKQTOVERLAYS_EXPORT QmitkScalarBar : public QWidget
27 {
28  Q_OBJECT
29 public:
30  enum alignment
31  {
32  vertical = 0,
33  horizontal = 1
34  };
35 
39  QmitkScalarBar(QWidget *parent = nullptr);
40 
44  virtual ~QmitkScalarBar();
45 
46  virtual void SetScaleFactor(double scale);
47 
48  virtual void SetAlignment(alignment align);
49 
50  void SetPen(const QPen &pen);
51 
52  void SetNumberOfSubdivisions(unsigned int subs);
53 
54  unsigned int GetNumberOfSubdivisions();
55 
56 protected:
57  void paintEvent(QPaintEvent *event) override;
58 
59  void SetupGeometry(alignment align);
60 
61  void CleanUpLines();
62  // void moveEvent(QMoveEvent*);
63 
65 
66  double m_ScaleFactor;
67 
68  QLine *m_MainLine;
69 
70  std::vector<QLine *> m_SubDivisionLines;
71 
72  QPen m_Pen;
73 
74  unsigned int m_NumberOfSubDivisions;
75 };
76 
77 #endif /* MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB */
std::vector< QLine * > m_SubDivisionLines
unsigned int m_NumberOfSubDivisions
alignment m_Alignment
double m_ScaleFactor
#define MITKQTOVERLAYS_EXPORT
QLine * m_MainLine