CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKMagnifyView.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 __ctkVTKMagnifyView_h
22 #define __ctkVTKMagnifyView_h
23 
24 // QT includes
25 #include <QList>
26 
27 // CTK includes
28 #include "ctkCrosshairLabel.h"
29 #include "ctkVisualizationVTKWidgetsExport.h"
30 
31 // VTK includes
32 class QVTKWidget;
33 
34 class ctkVTKMagnifyViewPrivate;
35 
41 
42 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKMagnifyView
43  : public ctkCrosshairLabel
44 {
45  Q_OBJECT
46  Q_PROPERTY(double magnification READ magnification WRITE setMagnification)
47  Q_PROPERTY(bool observeRenderWindowEvents
48  READ observeRenderWindowEvents WRITE setObserveRenderWindowEvents)
49  Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
50 
51 public:
54  explicit ctkVTKMagnifyView(QWidget* parent = 0);
55  virtual ~ctkVTKMagnifyView();
56 
59  double magnification() const;
60  void setMagnification(double newMagnification);
61 
66  bool observeRenderWindowEvents() const;
67  void setObserveRenderWindowEvents(bool newObserve);
68 
72  int updateInterval() const;
73  void setUpdateInterval(int newInterval);
74 
78  void observe(QVTKWidget * widget);
79 
83  void observe(QList<QVTKWidget *> widgets);
84 
88  void remove(QVTKWidget * widget);
89 
93  void remove(QList<QVTKWidget *> widgets);
94 
96  bool isObserved(QVTKWidget * widget) const;
97 
99  int numberObserved()const;
100 
103  bool hasCursorInObservedWidget()const;
104 protected:
105  QScopedPointer<ctkVTKMagnifyViewPrivate> d_ptr;
106 
109  virtual bool eventFilter(QObject *obj, QEvent *event);
110 
111 Q_SIGNALS:
112  void enteredObservedWidget(QVTKWidget * widget);
113  void leftObservedWidget(QVTKWidget * widget);
114 
115 private:
116  Q_DECLARE_PRIVATE(ctkVTKMagnifyView)
117  Q_DISABLE_COPY(ctkVTKMagnifyView)
118 };
119 
120 #endif