SMILX  1.01
milxQtUnifiedWindow.h
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #ifndef MILXQTUNIFIEDWINDOW_H
19 #define MILXQTUNIFIEDWINDOW_H
20 
21 #include <QList>
22 //VTK
23 #include <vtkCheckerboardWidget.h>
24 #include <vtkImageCheckerboard.h>
25 
26 #include "milxQtImage.h"
27 #include "milxQtModel.h"
28 
37 {
38  Q_OBJECT
39 
40 public:
45  milxQtUnifiedWindow(QWidget *theParent = 0);
50  virtual ~milxQtUnifiedWindow();
51 
52 public slots:
57  void refresh();
58 
63  void addToWindow(milxQtModel *model);
68  void addToWindow(milxQtImage *image);
69 
74  void removeFromWindow(QWidget *passedWindow);
75 
80  void generateUnion();
85  void generateDifference(double pseudoInfinityFactor = -1.0);
90  void generateScalarDifference();
95  void generateCheckerBoard();
96 
100  vtkSmartPointer<vtkFloatArray> surfaceScalarsFromImage(vtkSmartPointer<vtkPolyData> surface, itk::SmartPointer<floatImageType> img, const bool absoluteValues);
101 
106  virtual void customOperation() {};
107 
108 signals:
109  void imageAvailable(milxQtImage *);
110  void modelAvailable(milxQtModel *);
111  void modelAvailable(QWidget *);
112 
113 protected:
114  QList< milxQtModel* > unifyModels;
115  QList< milxQtImage* > unifyImages;
116  QList< vtkSmartPointer<vtkImageReslice> > slices;
117 
118 // QPointer<milxQtModel> geoDiffModel; //!< Model maintaining the geometric difference of a vector field
119  vtkSmartPointer<vtkCheckerboardWidget> checkerWidget;
120  vtkSmartPointer<vtkImageCheckerboard> checker;
121 
122  //States (as actions)
123  QActionGroup* modeGroup;
124  QAction* unionAct;
125  QAction* geoDifferenceAct;
127  QAction* checkerBoardAct;
128 
133  void createActions();
138  void createConnections();
143  void contextMenuEvent(QContextMenuEvent *event);
144  void setCommonProperties(QWidget *passedWindow);
145 
146 private:
147 
148 };
149 
150 #endif // MILXQTUNIFIEDWINDOW_H
QAction * checkerBoardAct
Checkerboard of image data.
QActionGroup * modeGroup
Grouping for check boxes.
This class represents the MILX Qt Render Window Display object using QVTK.
This class represents the MILX Qt Image Display object using VTK.
Definition: milxQtImage.h:118
void createConnections()
Create the connections for context menu etc.
virtual void customOperation()
Custom operation, data dependent for viewing in unified environment.
QList< milxQtModel *> unifyModels
Model to maintain and operate on.
QAction * scalarDifferenceAct
Scalar Difference of data.
QAction * unionAct
Union of data.
QAction * geoDifferenceAct
Geometric Difference of data.
This class represents the MILX Qt Model/Mesh Display object using VTK.
Definition: milxQtModel.h:115
#define MILXQT_EXPORT
Define Windows DLL importing.
Definition: milxQtAliases.h:80
QList< milxQtImage *> unifyImages
Images to maintain and operate on.
The class maintains a state and render of multiple display objects (such as a milxQtModel or milxQtIm...
QList< vtkSmartPointer< vtkImageReslice > > slices
Images to maintain and operate on.
void contextMenuEvent(QContextMenuEvent *event)
The context menu setup member.
void createActions()
Create the actions for context menu etc.
vtkSmartPointer< vtkCheckerboardWidget > checkerWidget
Checker board widget for comparing images.
void modelAvailable(vtkPolyData *, QString)
Send signal that an surface etc. is available for showing.
void imageAvailable(vtkImageData *, QString)
Send signal that an image is available for showing.
void refresh()
Refresh the display of the model including widgets. Camera remains as is.