NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
VLRendererView.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 VLRendererView_h
16 #define VLRendererView_h
17 
18 #include "ui_VLRendererViewControls.h"
19 #include <vlGraphics/OpenGL.hpp>
20 
21 #include <berryQtViewPart.h>
22 #include <berryIBerryPreferences.h>
23 #include <niftkBaseView.h>
24 #include <QmitkRenderWindow.h>
25 #include <mitkDataNode.h>
26 #include <mitkSurface.h>
27 #include <mitkImage.h>
28 #include <mitkDataStorage.h>
29 #include <mitkDataNode.h>
30 
31 //#include <niftkDataNodePropertyListener.h>
32 
33 class VLQtWidget;
34 
35 // Note:
36 // On Linux, some of the above includes include Xlib.h, transitively.
37 // Xlib.h defines a 'Bool' symbol that clashes with QMetaType::Bool
38 // what makes the Qt metaobject compiler fail to compile the moc file.
39 #undef Bool
40 
47 {
48 
49  // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
50  Q_OBJECT
51 
52 public:
53  explicit VLRendererView();
54  virtual ~VLRendererView();
55 
56  static const std::string VIEW_ID;
57 
58 
59 protected slots:
61  void On_SliderMoved(int val);
62 
63 protected:
64 
65  virtual void CreateQtPartControl(QWidget *parent);
66 
67  virtual void SetFocus();
68 
70  //virtual void OnNodeRemoved(mitk::DataNode* node);
71 
73  //virtual void OnNodeAdded(mitk::DataNode* node);
74  //virtual void OnNodeDeleted(mitk::DataNode* node);
75 
76  //void OnNamePropertyChanged(mitk::DataNode* node, const mitk::BaseRenderer* renderer = 0);
77 
78  virtual void Visible();
79 
80 private slots:
81  void OnBackgroundNodeSelected(const mitk::DataNode* node);
82  void OnCameraNodeSelected(const mitk::DataNode* node);
83  void OnCameraNodeEnabled(bool enabled);
84 
85 private:
86  void InitVLRendering();
87 
89  void ReinitDisplay(bool viewEnabled = true);
90 
92  Ui::VLRendererViewControls* m_Controls;
93 
95  QWidget *m_Parent;
96 
97  // VL rendering specific members
98  // We use a naked pointer not a vl::ref<> because this is also a QObject managed by Qt
99  VLQtWidget* m_VLQtRenderWindow;
100 
102  //niftk::DataNodePropertyListener::Pointer m_SelectionListener;
103  //niftk::DataNodePropertyListener::Pointer m_NamePropertyListener;
104 };
105 
106 #endif // VLRendererView_h
GLenum GLsizei const GLuint GLboolean enabled
Definition: glew.h:2537
GLuint const GLfloat * val
Definition: glew.h:2691
virtual void CreateQtPartControl(QWidget *parent)
Provides a simple GUI to visualize stuff.
Definition: VLRendererView.h:46
static const std::string VIEW_ID
Definition: VLRendererView.h:56
virtual void Visible()
Base view component for plugins listening to visibility change events, focus changed events and so on...
Definition: niftkBaseView.h:47
void On_SliderMoved(int val)
Slider moved.
virtual void SetFocus()
GLsizei const GLcharARB ** string
Definition: glew.h:5194
virtual ~VLRendererView()