CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkAxesWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkAxesWidget_h
22 #define __ctkAxesWidget_h
23 
24 // Qt includes
25 #include <QMetaType>
26 #include <QWidget>
27 
28 // CTK includes
29 #include "ctkWidgetsExport.h"
30 
31 class ctkAxesWidgetPrivate;
32 
34 class CTK_WIDGETS_EXPORT ctkAxesWidget : public QWidget
35 {
36  Q_OBJECT
37  Q_ENUMS(Axis)
38  Q_PROPERTY(Axis currentAxis READ currentAxis WRITE setCurrentAxis NOTIFY currentAxisChanged)
39  Q_PROPERTY(bool autoReset READ autoReset WRITE setAutoReset)
40 public :
41 
42  enum Axis
43  {
44  None=0,
51  };
52 
53  ctkAxesWidget(QWidget *parent = 0);
54  virtual ~ctkAxesWidget();
55 
58  Axis currentAxis() const;
59 
64  bool autoReset() const;
65 
66 Q_SIGNALS:
67  void currentAxisChanged(ctkAxesWidget::Axis axis);
68 
69 public slots :
74  void setCurrentAxis(Axis axis);
75 
78  void setCurrentAxisToNone();
79 
82  void setAutoReset(bool reset);
83 
85  virtual QSize minimumSizeHint()const;
86  virtual QSize sizeHint()const;
87  virtual bool hasHeightForWidth()const;
88  virtual int heightForWidth(int width)const;
89 
90 protected:
91  void paintEvent(QPaintEvent *);
92  void mousePressEvent(QMouseEvent *mouseEvent);
93  void mouseMoveEvent(QMouseEvent *mouseEvent);
94  void mouseReleaseEvent(QMouseEvent *mouseEvent);
95 
96  QScopedPointer<ctkAxesWidgetPrivate> d_ptr;
97 private :
98  Q_DECLARE_PRIVATE(ctkAxesWidget);
99  Q_DISABLE_COPY(ctkAxesWidget);
100 };
101 
103 
104 #endif
105 
QScopedPointer< ctkAxesWidgetPrivate > d_ptr
Definition: ctkAxesWidget.h:96
Q_DECLARE_METATYPE(ctkDICOMPersonName)