ParaView
pqMultiSliceView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: pqMultiSliceView.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME pqMultiSliceView - QT GUI that allow multi slice control
16 
17 #ifndef pqMultiSliceView_h
18 #define pqMultiSliceView_h
19 
20 #include "pqCoreModule.h"
21 #include "pqRenderView.h"
22 
23 #include <QtCore>
24 #include <QtGui>
25 
27 
28 class PQCORE_EXPORT pqMultiSliceView : public pqRenderView
29 {
30  Q_OBJECT
31  typedef pqRenderView Superclass;
32 
33 public:
34  static QString multiSliceViewType() { return "MultiSlice"; }
35 
40  pqMultiSliceView(const QString& viewtype, const QString& group, const QString& name,
41  vtkSMViewProxy* viewmodule, pqServer* server, QObject* p);
42  virtual ~pqMultiSliceView();
43 
48  const double* GetVisibleSlices(int axisIndex, int& numberOfSlices);
49 
54  const double* GetSlices(int axisIndex, int& numberOfSlices)
55  {
56  return this->GetVisibleSlices(axisIndex, numberOfSlices);
57  }
58 
63  const double* GetAllSlices(int axisIndex, int& numberOfSlices);
64 
69  const double* GetSliceNormal(int axisIndex);
70 
75  const double* GetSliceOrigin(int axisIndex);
76 
80  virtual void setCursor(const QCursor&);
81 
85  bool getOutlineVisibility();
86  void setOutlineVisibility(bool visible);
87 
88 signals:
89  // Fired when the slices are changed by user interaction.
90  // Provides information about which slice is being
91  // changed. axisIndex is the index of axis [0,2], while sliceIndex is the
92  // index for the slice in the slices returned by GetAllSlices(). If a slice is
93  // deleted, the sliceIndex will point to its index before the slice was
94  // deleted.
95  void sliceAdded(int axisIndex, int sliceIndex);
96  void sliceRemoved(int axisIndex, int sliceIndex);
97  void sliceModified(int axisIndex, int sliceIndex);
98 
99  void sliceClicked(int axisIndex, double sliceOffsetOnAxis, int button, int modifier);
100 
101 public slots:
102  void updateSlices();
103 
104 private slots:
105  void updateAxisBounds();
106  void onSliceAdded(int activeSliceIndex);
107  void onSliceRemoved(int activeSliceIndex);
108  void onSliceModified(int activeSliceIndex);
109 
110 protected:
111  void updateViewModelCallBack(vtkObject*, unsigned long, void*);
112 
116  virtual QWidget* createWidget();
117 
121  QVTKWidget* getInternalWidget();
122 
126  int getAxisIndex(QObject*);
127 
128  QPointer<QVTKWidget> InternalWidget;
130  QPointer<pqMultiSliceAxisWidget> AxisX;
131  QPointer<pqMultiSliceAxisWidget> AxisY;
132  QPointer<pqMultiSliceAxisWidget> AxisZ;
133  QPointer<pqMultiSliceAxisWidget> AxisXYZ[3];
134 
135  QMap<pqRepresentation*, unsigned int> ObserverIdX;
136  QMap<pqRepresentation*, unsigned int> ObserverIdY;
137  QMap<pqRepresentation*, unsigned int> ObserverIdZ;
138 
139  double NormalValuesHolder[9];
140  double OriginValuesHolder[9];
141 
142 protected slots:
143  // Internal slot that will emit sliceClicked()
144  void onSliceClicked(int button, int modifier, double value);
145 
146 private:
147  Q_DISABLE_COPY(pqMultiSliceView)
148 };
149 
150 #endif
QMap< pqRepresentation *, unsigned int > ObserverIdX
QPointer< pqMultiSliceAxisWidget > AxisY
virtual QWidget * createWidget()
Creates a new instance of the QWidget subclass to be used to show this view.
virtual void setCursor(const QCursor &)
Let internal class handle which internal widget should change its cursor This is usually used for sel...
QMap< pqRepresentation *, unsigned int > ObserverIdY
Superclass for all view proxies.
static QString multiSliceViewType()
QPointer< pqMultiSliceAxisWidget > AxisX
QPointer< pqMultiSliceAxisWidget > AxisZ
const double * GetSlices(int axisIndex, int &numberOfSlices)
QMap< pqRepresentation *, unsigned int > ObserverIdZ
QPointer< QVTKWidget > InternalWidget
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64