GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoTabImageView3D.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 #ifndef __QGoTabImageView3D_h
35 #define __QGoTabImageView3D_h
36 
37 #include "QGoTabImageViewNDBase.h"
38 #include "SnapshotHelper.h"
39 
40 #include <QHBoxLayout>
41 #include <QSpinBox>
42 
43 class vtkImageData;
44 class vtkActor;
45 // class vtkQuadricLODActor;
46 
47 class QAction;
48 class QToolBar;
49 class QDockWidget;
50 
51 class QGoImageView3D;
52 
53 #include "QGoGUILibConfigure.h"
54 
60 class QGOGUILIB_EXPORT QGoTabImageView3D:public QGoTabImageViewNDBase
61 {
62  Q_OBJECT
63 public:
64  explicit QGoTabImageView3D(QWidget *parent = 0);
65  virtual ~QGoTabImageView3D();
66 
68 
70 
71  virtual void Update();
72 
73  void setupUi(QWidget *parent);
74 
75  void retranslateUi(QWidget *parent);
76 
77  virtual void WriteSettings() {}
78  virtual void ReadSettings() {}
79 
80  void CreateModeToolBar(QMenu* iMenu, QToolBar* iToolBar);
81 
82 signals:
83  void SliceViewXYChanged(int Slice);
84 
85  void SliceViewXZChanged(int Slice);
86 
87  void SliceViewYZChanged(int Slice);
88 
89  void FullScreenViewChanged(int View);
90 
91 public slots:
92  QString SnapshotViewXY( const GoFigure::FileType & iType,
93  const QString & iBaseName = QString("snapshot-xy-") );
94 
95  QString SnapshotViewXZ( const GoFigure::FileType & iType,
96  const QString & iBaseName = QString("snapshot-xz-") );
97 
98  QString SnapshotViewYZ( const GoFigure::FileType & iType,
99  const QString & iBaseName = QString("snapshot-yz-") );
100 
101  QString SnapshotViewXYZ( const GoFigure::FileType & iType,
102  const QString & iBaseName = QString("snapshot-xyz-") );
103 
104  void SetSliceViewXY(const int &);
105 
106  void SetSliceViewXZ(const int &);
107 
108  void SetSliceViewYZ(const int &);
109 
110  void SetFullScreenView(const int & iS);
111 
112  void Quadview();
113 
114  void FullScreenViewXY();
115 
116  void FullScreenViewXZ();
117 
118  void FullScreenViewYZ();
119 
120  void FullScreenViewXYZ();
121 
122  void ChangeLookupTable();
123 
124  void ShowScalarBar(const bool &);
125 
126  void ChangeBackgroundColor();
127 
128  void DisplayAnnotations();
129 
130  void DisplaySplinePlanes();
131 
132  void DisplayCube();
133 
134  void Change3DPerspectiveToAxial();
135 
136  void Change3DPerspectiveToCoronal();
137 
138  void Change3DPerspectiveToSagittal();
139 
143  virtual void DefaultInteractorBehavior(bool);
144 
149  virtual void ZoomInteractorBehavior(bool);
150 
154  virtual void PanInteractorBehavior(bool);
155 
156  void TakeSnapshot();
157 
158 protected:
160 
162 
164 
166 
167  void CreateAllViewActions();
168 
169  void SetImageToImageViewer(vtkImageData *image);
170 
171  int *GetImageCoordinatesFromWorldCoordinates(double pos[3]);
172 
173  virtual void RemoveActorFromViewer(const int & iId, vtkActor *iActor);
174 
175  virtual void DisplayActorInViewer(const int & iId, vtkActor *iActor);
176 
177 // virtual std::vector< vtkQuadricLODActor* >
178  virtual std::vector< vtkActor * > AddContour(vtkPolyData *dataset,
179  vtkProperty *property = NULL);
180 
181  virtual void SetSlice(int iDir, int *iIdx);
182 
183 private:
185 };
186 #endif
virtual void SetBackgroundColorToImageViewer()=0
virtual void SetImageToImageViewer(vtkImageData *image)=0
void setupUi(QWidget *widget)
virtual void RemoveActorFromViewer(const int &iId, vtkActor *iActor)=0
virtual void TakeSnapshot()=0
QAction * m_BackgroundColorAction
virtual int * GetImageCoordinatesFromWorldCoordinates(double pos[3])=0
virtual void ZoomInteractorBehavior(bool)
Mouse interaction style allows user to zoom in/out volume with all buttons.
class for the visualization of 3D Image represented by one vtkImageData*.
virtual void CreateModeToolBar(QMenu *iMenu, QToolBar *iToolBar)
virtual GoFigure::TabDimensionType GetTabDimensionType() const =0
Get the dimension type of the underlying data set.
virtual void WriteSettings()
Write Settings.
virtual void DefaultInteractorBehavior(bool)
Mouse interaction style set as default.
QGoImageView3D * m_ImageView
virtual void DisplayActorInViewer(const int &iId, vtkActor *iActor)=0
QGoTabImageViewNDBase::QGoDockWidgetStatusPair QGoDockWidgetStatusPair
virtual void GetBackgroundColorFromImageViewer()=0
QGoTabImageViewElementBase::QGoDockWidgetStatusPair QGoDockWidgetStatusPair
virtual void ReadSettings()
Read Settings.
Abstract class for representing one tab element which contains 2D or 3D image (without any temporal c...
void ChangeBackgroundColor()
Change the background color.
Q_DISABLE_COPY(QGoTabImageViewNDBase)
virtual void SetSlice(int iDir, int *iIdx)=0
virtual std::vector< vtkActor * > AddContour(vtkPolyData *dataset, vtkProperty *property=NULL)=0
virtual void Update()=0
Update the rendering of the tab.