SMIL  0.9.1
QVtkViewerWidget.h
1 /*
2  * Smil
3  * Copyright (c) 2011-2016 Matthieu Faessel
4  *
5  * This file is part of Smil.
6  *
7  * Smil is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * Smil is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with Smil. If not, see
19  * <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef QVTK_VIEWER_H
24 #define QVTK_VIEWER_H
25 
26 #include <QAction>
27 #include <QApplication>
28 #include <QButtonGroup>
29 #include <QHBoxLayout>
30 #include <QHeaderView>
31 #include <QWidget>
32 #include "QVTKWidget.h"
33 
34 
35 #include <vtkImageImport.h>
36 #include <vtkCamera.h>
37 #include <vtkVolumeRayCastCompositeFunction.h>
38 #include <vtkVolumeRayCastMIPFunction.h>
39 #include <vtkVolumeRayCastMapper.h>
40 #include <vtkVolume.h>
41 #include <vtkRenderer.h>
42 #include <vtkRenderWindow.h>
43 #include <vtkPiecewiseFunction.h>
44 #include <vtkVolumeProperty.h>
45 #include <vtkCubeSource.h>
46 #include <vtkOutlineFilter.h>
47 #include <vtkPolyDataMapper.h>
48 #include <vtkActor.h>
49 #include <vtkAxesActor.h>
50 #include <vtkImageCast.h>
51 #include <vtkOrientationMarkerWidget.h>
52 #include <vtkEventQtSlotConnect.h>
53 #include <vtkDiscretizableColorTransferFunction.h>
54 
55 #include "Gui/Qt/PureQt/ImageViewerWidget.h"
56 
58 {
59  Q_OBJECT
60 
61 public:
63 
64  QVTKWidget *qvtkWidget;
65 
66  QVtkViewerWidget(QWidget *parent = 0);
68 
69 
70  enum RepresentationType { NONE, COMPOSITE, MIP };
71  virtual void update();
72 
73 protected:
74  vtkRenderer *renderer;
75  vtkRenderWindow *renderWindow;
76  vtkRenderWindowInteractor *interactor;
77  vtkCamera *camera;
78 
79  vtkImageImport *imageImport;
80  RepresentationType representationType;
81  vtkVolumeRayCastFunction *volumeRayCastFunction;
82  vtkVolumeRayCastMapper *volumeRayCastMapper;
83  vtkVolume *volume;
84  vtkVolumeProperty *volumeProperty;
85  vtkPiecewiseFunction *opacityTransfertFunction;
86  vtkPiecewiseFunction *colorOpacityTransfertFunction;
87  vtkDiscretizableColorTransferFunction *colorTransfertFunction;
88 
89  vtkCubeSource *cube;
90  vtkOutlineFilter *outline;
91  vtkPolyDataMapper *outlineMapper;
92  vtkActor *outlineActor;
93 
94  vtkAxesActor *axesActor;
95  vtkOrientationMarkerWidget *orientationMarker;
96 
97  vtkEventQtSlotConnect *vtkQtEventConnect;
98 
99  void initLookup(int typeMax);
100 
101  void setRepresentationType(RepresentationType type);
102  void showAxes();
103  void showNormal();
104  void showLabel();
105  void hideAxes();
106  void setInterpolationTypeToLinear();
107  void setInterpolationTypeToNearest();
108 
109 // virtual void keyPressEvent(QKeyEvent *event) { parentClass::keyPressEvent(event); }
110  virtual void setLabelImage(bool val);
111  virtual void setAutoRange(bool /*on*/) {};
112 public slots:
113  void showContextMenu(vtkObject*, unsigned long, void*, void*, vtkCommand *command);
114  void keyPressed(vtkObject*, unsigned long, void*, void*, vtkCommand *command);
115 
116 };
117 
118 #endif
Definition: QVtkViewerWidget.h:57
Definition: ImageViewerWidget.h:62