Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmlMitkRenderWindowItem.h
Go to the documentation of this file.
1 /*===================================================================
2 
3  The Medical Imaging Interaction Toolkit (MITK)
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
17 #ifndef __QmlMitkRenderWindowItem_h
18 #define __QmlMitkRenderWindowItem_h
19 
20 #include "MitkQmlItemsExports.h"
21 
22 #include "QVTKQuickItem.h"
23 
24 #include "mitkRenderWindowBase.h"
25 
26 #include <vtkCornerAnnotation.h>
27 #include <vtkMitkRectangleProp.h>
28 
30 
32 {
33  Q_OBJECT
34  Q_PROPERTY(int viewType READ getViewType WRITE setViewType NOTIFY viewTypeChanged);
35  Q_PROPERTY(QmlMitkStdMultiItem* multiItem READ getMultiItem WRITE setMultiItem NOTIFY multiItemChanged);
36 private:
37  QmlMitkStdMultiItem* m_multiItem;
38  vtkSmartPointer<vtkCornerAnnotation> m_annotation;
39  vtkSmartPointer<vtkMitkRectangleProp> m_rectangle;
40 
41  int m_viewType;
42 
43 public:
45  static QmlMitkRenderWindowItem* GetInstanceForVTKRenderWindow( vtkRenderWindow* rw );
46 
47  QmlMitkRenderWindowItem(QQuickItem* parent = 0, const QString& name = "QML render window", mitk::VtkPropRenderer* renderer = NULL, mitk::RenderingManager* renderingManager = NULL);
49 
50  virtual vtkRenderWindow* GetVtkRenderWindow();
51  virtual vtkRenderWindowInteractor* GetVtkRenderWindowInteractor();
52 
53  void SetDataStorage(mitk::DataStorage::Pointer storage);
55 
56  virtual bool prepareForRender();
57  virtual void cleanupAfterRender();
58  void createPlaneNode();
59 
60  void setMultiItem(QmlMitkStdMultiItem* multiItem);
61  QmlMitkStdMultiItem* getMultiItem();
62 
63  void setDecorationProperties(std::string text, mitk::Color color);
64 
65  void setViewType(int type);
66  int getViewType();
67 
68  void geometryChanged(const QRectF & newGeometry, const QRectF & oldGeometry);
69 
70  virtual void mousePressEvent(QMouseEvent* e);
71  virtual void mouseReleaseEvent(QMouseEvent* e);
72  virtual void mouseMoveEvent(QMouseEvent* e);
73  virtual void wheelEvent(QWheelEvent* e);
74 
75  mitk::Point2D GetMousePosition(QMouseEvent* me) const;
76  mitk::Point2D GetMousePosition(QWheelEvent* we) const;
79  mitk::InteractionEvent::ModifierKeys GetModifiers(QInputEvent* me) const;
81 
82  static QMap<vtkRenderWindow*, QmlMitkRenderWindowItem*>& GetInstances();
83 
84 public slots:
85  void setupView();
86 
87 signals:
88  void multiItemChanged();
89  void viewTypeChanged();
90 };
91 
92 #endif
Base class of MITK RenderWindows.
virtual void cleanupAfterRender()
virtual bool prepareForRender()
virtual void mouseMoveEvent(QMouseEvent *e)
#define MITKQMLITEMS_EXPORT
static std::string GetEventButton(mitk::InteractionEvent *event)
GetEventButton Return EventButton as String.
static std::string GetButtonState(mitk::InteractionEvent *event)
GetEventButton Return EventButton as String.
virtual void wheelEvent(QWheelEvent *e)
virtual void mouseReleaseEvent(QMouseEvent *e)
int MapperSlotId
MapperSlotId defines which kind of mapper (e.g., 2D or 3D) shoud be used.
Manager for coordinating the rendering process.
static QmlMitkRenderWindowItem * instance
virtual void mousePressEvent(QMouseEvent *e)
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
virtual vtkRenderWindow * GetVtkRenderWindow()=0
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
ViewDirection
Possible view directions, Original will uses the PlaneGeometry instances in a SlicedGeometry3D provid...
virtual vtkRenderWindowInteractor * GetVtkRenderWindowInteractor()=0