GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoSynchronizedViewMainWindow.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 __QGoSynchronizedViewMainWindow_h
35 #define __QGoSynchronizedViewMainWindow_h
36 
37 #include <QMainWindow>
38 #include <QMdiArea>
39 
40 #include "itkImage.h"
41 #include "itkSmartPointer.h"
42 
44 
47 class vtkImageData;
48 
49 QT_BEGIN_NAMESPACE
50 class QAction;
51 class QMenu;
52 class QMdiArea;
53 class QMdiSubWindow;
54 class QSignalMapper;
55 QT_END_NAMESPACE
56 
71 // \example GUI/lib/qgosynchronizedviewguitest.cxx
72 
74 {
75 // QT macro
76  Q_OBJECT
77 public:
78 
81 
83 
84  void Update();
85 
87  QString iSynchronizedViewName,
88  vtkImageData *iImage);
89 
90  template< typename TPixel >
92  QString iSynchronizedViewName,
93  typename itk::Image< TPixel, 3 >::Pointer iImage)
94  {
95  QGoSynchronizedView *synchronizedView;
96 
97  synchronizedView = m_SynchronizedViewManager->newSynchronizedView< TPixel >(
98  iSynchronizedViewName, iImage);
99 
100  mdiArea->addSubWindow(synchronizedView, Qt::SubWindow);
101  synchronizedView->parentWidget()
102  ->resize(300, 300);
103  synchronizedView->show();
104  tileAct->trigger();
105  return synchronizedView;
106  }
107 
108  template< typename TPixel >
110  QString iSynchronizedViewName,
111  typename itk::Image< TPixel, 2 >::Pointer iImage)
112  {
113  QGoSynchronizedView *synchronizedView;
114 
115  synchronizedView = m_SynchronizedViewManager->newSynchronizedView< TPixel >(
116  iSynchronizedViewName, iImage);
117 
118  mdiArea->addSubWindow(synchronizedView, Qt::SubWindow);
119  synchronizedView->parentWidget()
120  ->resize(300, 300);
121  synchronizedView->show();
122  tileAct->trigger();
123  return synchronizedView;
124  }
125 
126  void OpenSynchronizedViewForFile(QString & iFile);
127 
128  void deleteSynchronizedView2D(const int & iId);
129 
130  void deleteSynchronizedView3D(const int & iId);
131 
132 protected:
134 
135 private slots:
136 
137  void openfile();
138 
139  void snapshotAs();
140 
141  void about();
142 
143  void aboutGF2();
144 
145  void updateMenus();
146 
147  void updateWindowMenu();
148 
150 
151  void synchronize();
152 
153  void FullscreenXY();
154 
155  void FullscreenXZ();
156 
157  void FullscreenYZ();
158 
159  void FullscreenXYZ();
160 
161  void Quadscreen();
162 
163 private:
164 
165  void SaveSnapshotInFile(QString & iFile, QGoSynchronizedView *SynchronizedView);
166 
167  void createActions();
168 
169  void createMenus();
170 
171  void createToolBars();
172 
173  void createStatusBar();
174 
175  void readSettings();
176 
177  void writeSettings();
178 
179  void imageinfo();
180 
182 
183  QMdiSubWindow * findSynchronizedView(const QString & iSynchronizedViewName);
184 
187 
192 
197 // QAction * openmemAct;
212 
214 };
215 
216 #endif // QGOSYNCHRONIZEDVIEWMAINWINDOW_H
This object is intended to demonstrate the use of the comparer classes package : QGoSynchronizedViewM...
abstract class for QGoSynchronizedView2D and QGoSynchronizedView3D. Those classes are used to display...
QWidget * window() const
QGoSynchronizedViewManager * GetSynchronizedViewManager()
QGoSynchronizedViewManager * m_SynchronizedViewManager
void trigger()
void resize(int w, int h)
QGoSynchronizedView * newSynchronizedView(QString iSynchronizedViewName, typename itk::Image< TPixel, 2 >::Pointer iImage)
virtual bool event(QEvent *event)
QMdiSubWindow * addSubWindow(QWidget *widget, QFlags< Qt::WindowType > windowFlags)
class used to display a QWidget containing a two dimensional vtkimagedata* or itkimage*. QGoSynchronizedView3D provide the interface to synchronize cameras among several GoSynchronizedView3D.
QGoSynchronizedView * newSynchronizedView(QString iSynchronizedViewName, typename itk::Image< TPixel, 3 >::Pointer iImage)
QWidget * parentWidget() const
High level class for QGoSynchronizedView2D, QGoSynchronizedView2DCallbacks QGoSynchronizedView3D, QGoSynchronizedView3DCallbacks.
QMdiSubWindow * findSynchronizedView(const QString &iSynchronizedViewName)
void show()
void SaveSnapshotInFile(QString &iFile, QGoSynchronizedView *SynchronizedView)
QGoSynchronizedView3D * newSynchronizedView(QString iSynchronizedViewName, typename itk::Image< TPixel, 3 >::Pointer iImage)
create and add a QGoSynchronizedView to QGoSynchronizedViewManager's parent Object/Widget ...
QGoSynchronizedView * newSynchronizedView(QString iSynchronizedViewName, vtkImageData *iImage)