NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkThumbnailView.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkThumbnailView_h
16 #define niftkThumbnailView_h
17 
18 #include <QmitkAbstractView.h>
19 #include <berryIPartListener.h>
20 #include <berryIPreferences.h>
21 #include <berryIPreferencesService.h>
22 #include <berryIBerryPreferences.h>
23 #include <berryISelection.h>
24 #include <berryISelectionProvider.h>
25 #include <berryISelectionListener.h>
26 
27 #include <mitkRenderingManager.h>
28 
29 
30 namespace niftk
31 {
32 
33 class ThumbnailRenderWindow;
34 
46 class ThumbnailView : public QmitkAbstractView
47 {
48  // this is needed for all Qt objects that should have a Qt meta-object
49  // (everything that derives from QObject and wants to have signal/slots)
50  Q_OBJECT
51 
52 public:
53 
55  ThumbnailView();
56  virtual ~ThumbnailView();
57 
59  static const std::string VIEW_ID;
60 
62  virtual std::string GetViewID() const;
63 
65  virtual void OnPreferencesChanged(const berry::IBerryPreferences*);
66 
68  virtual bool IsExclusiveFunctionality() const { return false; }
69 
71  mitk::BaseRenderer* GetTrackedRenderer() const;
72 
75  void SetTrackedRenderer(mitk::BaseRenderer* renderer);
76 
77 protected:
78 
80  virtual void CreateQtPartControl(QWidget *parent);
81 
83  virtual void SetFocus();
84 
85 private:
86 
89  void OnFocusChanged();
90 
92  void RetrievePreferenceValues();
93 
96  mitk::IRenderWindowPart* GetSelectedEditor();
97 
98  mitk::RenderingManager::Pointer m_RenderingManager;
99 
101  unsigned long m_FocusManagerObserverTag;
102 
104  ThumbnailRenderWindow* m_ThumbnailWindow;
105 
107  bool m_TrackOnlyMainWindows;
108 
110  QScopedPointer<berry::IPartListener> m_EditorLifeCycleListener;
111 
112 };
113 
114 }
115 
116 #endif
Provides a thumbnail view of the currently focused QmitkRenderWindow. ....Note: This class should bas...
Definition: niftkThumbnailView.h:46
virtual void CreateQtPartControl(QWidget *parent)
Called by framework, this method creates all the controls for this view.
Definition: niftkThumbnailView.cxx:158
virtual void OnPreferencesChanged(const berry::IBerryPreferences *)
Called when preferences are updated.
Definition: niftkThumbnailView.cxx:227
virtual std::string GetViewID() const
Returns the view ID.
Definition: niftkThumbnailView.cxx:151
berryObjectMacro(ThumbnailView)
static const std::string VIEW_ID
Static view ID = uk.ac.ucl.cmic.thumbnailview.
Definition: niftkThumbnailView.h:59
void SetTrackedRenderer(mitk::BaseRenderer *renderer)
Instructs the contained thumbnail viewer widget to track the given renderer. Supposed to be called wh...
Definition: niftkThumbnailView.cxx:346
virtual ~ThumbnailView()
Definition: niftkThumbnailView.cxx:131
Subclass of QmitkRenderWindow to track to another QmitkRenderWindow and provide a zoomed-out view wit...
Definition: niftkThumbnailRenderWindow.h:71
ThumbnailView()
Definition: niftkThumbnailView.cxx:118
mitk::BaseRenderer * GetTrackedRenderer() const
Returns the renderer being tracked if there is one, otherwise NULL.
Definition: niftkThumbnailView.cxx:339
virtual void SetFocus()
Called by framework, sets the focus on a specific widget.
Definition: niftkThumbnailView.cxx:220
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194
virtual bool IsExclusiveFunctionality() const
This is not an exclusive functionality, as it just listens to input and updates itself, and can happily live alongside other functionalities.
Definition: niftkThumbnailView.h:68