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 #if CTK_USE_QVTKOPENGLWIDGET
33 class QVTKOpenGLWidget;
34 #else
35 class QVTKWidget;
36 #endif
37 
38 class ctkVTKMagnifyViewPrivate;
39 
45 
46 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKMagnifyView
47  : public ctkCrosshairLabel
48 {
49  Q_OBJECT
50  Q_PROPERTY(double magnification READ magnification WRITE setMagnification)
51  Q_PROPERTY(bool observeRenderWindowEvents
52  READ observeRenderWindowEvents WRITE setObserveRenderWindowEvents)
53  Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
54 
55 public:
58  explicit ctkVTKMagnifyView(QWidget* parent = 0);
59  virtual ~ctkVTKMagnifyView();
60 
63  double magnification() const;
64  void setMagnification(double newMagnification);
65 
71  void setObserveRenderWindowEvents(bool newObserve);
72 
76  int updateInterval() const;
77  void setUpdateInterval(int newInterval);
78 
82 #if CTK_USE_QVTKOPENGLWIDGET
83  void observe(QVTKOpenGLWidget * widget);
84 #else
85  void observe(QVTKWidget * widget);
86 #endif
87 
91 #if CTK_USE_QVTKOPENGLWIDGET
92  void observe(QList<QVTKOpenGLWidget *> widgets);
93 #else
95 #endif
96 
100 #if CTK_USE_QVTKOPENGLWIDGET
101  void remove(QVTKOpenGLWidget * widget);
102 #else
103  void remove(QVTKWidget * widget);
104 #endif
105 
109 #if CTK_USE_QVTKOPENGLWIDGET
110  void remove(QList<QVTKOpenGLWidget *> widgets);
111 #else
113 #endif
114 
116 #if CTK_USE_QVTKOPENGLWIDGET
117  bool isObserved(QVTKOpenGLWidget * widget) const;
118 #else
119  bool isObserved(QVTKWidget * widget) const;
120 #endif
121 
123  int numberObserved()const;
124 
128 protected:
129  QScopedPointer<ctkVTKMagnifyViewPrivate> d_ptr;
130 
133  virtual bool eventFilter(QObject *obj, QEvent *event);
134 
135 Q_SIGNALS:
136 #if CTK_USE_QVTKOPENGLWIDGET
137  void enteredObservedWidget(QVTKOpenGLWidget * widget);
138  void leftObservedWidget(QVTKOpenGLWidget * widget);
139 #else
140  void enteredObservedWidget(QVTKWidget * widget);
141  void leftObservedWidget(QVTKWidget * widget);
142 #endif
143 
144 private:
145  Q_DECLARE_PRIVATE(ctkVTKMagnifyView)
146  Q_DISABLE_COPY(ctkVTKMagnifyView)
147 };
148 
149 #endif
void setObserveRenderWindowEvents(bool newObserve)
bool isObserved(QVTKWidget *widget) const
Returns whether a QVTKWidget is observed.
double magnification() const
void enteredObservedWidget(QVTKWidget *widget)
int numberObserved() const
Returns the number of observed QVTKWidgets.
void observe(QList< QVTKWidget * > widgets)
void leftObservedWidget(QVTKWidget *widget)
ctkCrosshairLabel Superclass
Constructors.
bool hasCursorInObservedWidget() const
void observe(QVTKWidget *widget)
void setMagnification(double newMagnification)
QScopedPointer< ctkVTKMagnifyViewPrivate > d_ptr
void setUpdateInterval(int newInterval)
ctkVTKMagnifyView(QWidget *parent=0)
bool observeRenderWindowEvents() const
void remove(QVTKWidget *widget)
int updateInterval() const
void remove(QList< QVTKWidget * > widgets)
virtual bool eventFilter(QObject *obj, QEvent *event)
virtual ~ctkVTKMagnifyView()