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  Q_PROPERTY(QStringList axesLabels READ axesLabels WRITE setAxesLabels)
41 public :
42 
43  enum Axis
44  {
45  None=0,
52  };
53 
54  ctkAxesWidget(QWidget *parent = 0);
55  virtual ~ctkAxesWidget();
56 
59  Axis currentAxis() const;
60 
65  bool autoReset() const;
66 
67 Q_SIGNALS:
68  void currentAxisChanged(ctkAxesWidget::Axis axis);
69 
70 public slots :
75  void setCurrentAxis(Axis axis);
76 
79  void setCurrentAxisToNone();
80 
83  void setAutoReset(bool reset);
84 
94  bool setAxesLabels(const QStringList& labels);
95 
97  QStringList axesLabels() const;
98 
100  virtual QSize minimumSizeHint()const;
101  virtual QSize sizeHint()const;
102  virtual bool hasHeightForWidth()const;
103  virtual int heightForWidth(int width)const;
104 
105 protected:
106  void paintEvent(QPaintEvent *);
107  void mousePressEvent(QMouseEvent *mouseEvent);
108  void mouseMoveEvent(QMouseEvent *mouseEvent);
109  void mouseReleaseEvent(QMouseEvent *mouseEvent);
110 
111  QScopedPointer<ctkAxesWidgetPrivate> d_ptr;
112 private :
113  Q_DECLARE_PRIVATE(ctkAxesWidget);
114  Q_DISABLE_COPY(ctkAxesWidget);
115 };
116 
118 
119 #endif
120 
ctkAxesWidget::Anterior
@ Anterior
Definition: ctkAxesWidget.h:50
ctkAxesWidget
Definition: ctkAxesWidget.h:34
ctkAxesWidget::Inferior
@ Inferior
Definition: ctkAxesWidget.h:49
ctkAxesWidget::Left
@ Left
Definition: ctkAxesWidget.h:47
ctkAxesWidget::d_ptr
QScopedPointer< ctkAxesWidgetPrivate > d_ptr
Definition: ctkAxesWidget.h:111
ctkAxesWidget::Superior
@ Superior
Definition: ctkAxesWidget.h:48
ctkAxesWidget::Axis
Axis
Definition: ctkAxesWidget.h:43
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ctkDICOMPersonName)
ctkAxesWidget::Posterior
@ Posterior
Definition: ctkAxesWidget.h:51
ctkAxesWidget::Right
@ Right
Definition: ctkAxesWidget.h:46