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 #include <vtkImageImport.h>
35 #include <vtkCamera.h>
36 #include <vtkVolumeRayCastCompositeFunction.h>
37 #include <vtkVolumeRayCastMIPFunction.h>
38 #include <vtkVolumeRayCastMapper.h>
39 #include <vtkVolume.h>
40 #include <vtkRenderer.h>
41 #include <vtkRenderWindow.h>
42 #include <vtkPiecewiseFunction.h>
43 #include <vtkVolumeProperty.h>
44 #include <vtkCubeSource.h>
45 #include <vtkOutlineFilter.h>
46 #include <vtkPolyDataMapper.h>
47 #include <vtkActor.h>
48 #include <vtkAxesActor.h>
49 #include <vtkImageCast.h>
50 #include <vtkOrientationMarkerWidget.h>
51 #include <vtkEventQtSlotConnect.h>
52 #include <vtkDiscretizableColorTransferFunction.h>
53 
54 #include "Gui/Qt/PureQt/ImageViewerWidget.h"
55 
57 {
58  Q_OBJECT
59 
60 public:
62 
63  QVTKWidget *qvtkWidget;
64 
65  QVtkViewerWidget(QWidget *parent = 0);
67 
68  enum RepresentationType { NONE, COMPOSITE, MIP };
69  virtual void update();
70 
71 protected:
72  vtkRenderer *renderer;
73  vtkRenderWindow *renderWindow;
74  vtkRenderWindowInteractor *interactor;
75  vtkCamera *camera;
76 
77  vtkImageImport *imageImport;
78  RepresentationType representationType;
79  vtkVolumeRayCastFunction *volumeRayCastFunction;
80  vtkVolumeRayCastMapper *volumeRayCastMapper;
81  vtkVolume *volume;
82  vtkVolumeProperty *volumeProperty;
83  vtkPiecewiseFunction *opacityTransfertFunction;
84  vtkPiecewiseFunction *colorOpacityTransfertFunction;
85  vtkDiscretizableColorTransferFunction *colorTransfertFunction;
86 
87  vtkCubeSource *cube;
88  vtkOutlineFilter *outline;
89  vtkPolyDataMapper *outlineMapper;
90  vtkActor *outlineActor;
91 
92  vtkAxesActor *axesActor;
93  vtkOrientationMarkerWidget *orientationMarker;
94 
95  vtkEventQtSlotConnect *vtkQtEventConnect;
96 
97  void initLookup(int typeMax);
98 
99  void setRepresentationType(RepresentationType type);
100  void showAxes();
101  void showNormal();
102  void showLabel();
103  void hideAxes();
104  void setInterpolationTypeToLinear();
105  void setInterpolationTypeToNearest();
106 
107  // virtual void keyPressEvent(QKeyEvent *event) {
108  // parentClass::keyPressEvent(event); }
109  virtual void setLabelImage(bool val);
110  virtual void setAutoRange(bool /*on*/){};
111 public slots:
112  void showContextMenu(vtkObject *, unsigned long, void *, void *,
113  vtkCommand *command);
114  void keyPressed(vtkObject *, unsigned long, void *, void *,
115  vtkCommand *command);
116 };
117 
118 #endif
Definition: QVtkViewerWidget.h:56
Definition: ImageViewerWidget.h:62