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 public:
33  static QString multiSliceViewType() { return "MultiSlice"; }
34 
37  pqMultiSliceView( const QString& viewtype,
38  const QString& group,
39  const QString& name,
40  vtkSMViewProxy* viewmodule,
41  pqServer* server,
42  QObject* p);
43  virtual ~pqMultiSliceView();
44 
47  const double* GetVisibleSlices(int axisIndex, int &numberOfSlices);
48 
51  const double* GetSlices(int axisIndex, int &numberOfSlices)
52  { return this->GetVisibleSlices(axisIndex, numberOfSlices); }
53 
56  const double* GetAllSlices(int axisIndex, int &numberOfSlices);
57 
60  const double* GetSliceNormal(int axisIndex);
61 
64  const double* GetSliceOrigin(int axisIndex);
65 
67  virtual void setCursor(const QCursor &);
68 
70  bool getOutlineVisibility();
71  void setOutlineVisibility(bool visible);
72 
73 signals:
74  // Fired when the slices are changed by user interaction.
75  // Provides information about which slice is being
76  // changed. axisIndex is the index of axis [0,2], while sliceIndex is the
77  // index for the slice in the slices returned by GetAllSlices(). If a slice is
78  // deleted, the sliceIndex will point to its index before the slice was
79  // deleted.
80  void sliceAdded(int axisIndex, int sliceIndex);
81  void sliceRemoved(int axisIndex, int sliceIndex);
82  void sliceModified(int axisIndex, int sliceIndex);
83 
84  void sliceClicked(int axisIndex, double sliceOffsetOnAxis, int button, int modifier);
85 
86 public slots:
87  void updateSlices();
88 
89 private slots:
90  void updateAxisBounds();
91  void onSliceAdded(int activeSliceIndex);
92  void onSliceRemoved(int activeSliceIndex);
93  void onSliceModified(int activeSliceIndex);
94 
95 protected:
96  void updateViewModelCallBack(vtkObject*,unsigned long, void*);
97 
99  virtual QWidget* createWidget();
100 
102  QVTKWidget* getInternalWidget();
103 
105  int getAxisIndex(QObject*);
106 
107  QPointer<QVTKWidget> InternalWidget;
109  QPointer<pqMultiSliceAxisWidget> AxisX;
110  QPointer<pqMultiSliceAxisWidget> AxisY;
111  QPointer<pqMultiSliceAxisWidget> AxisZ;
112  QPointer<pqMultiSliceAxisWidget> AxisXYZ[3];
113 
114  QMap<pqRepresentation*, unsigned int> ObserverIdX;
115  QMap<pqRepresentation*, unsigned int> ObserverIdY;
116  QMap<pqRepresentation*, unsigned int> ObserverIdZ;
117 
118  double NormalValuesHolder[9];
119  double OriginValuesHolder[9];
120 
121 protected slots:
122  // Internal slot that will emit sliceClicked()
123  void onSliceClicked(int button, int modifier, double value);
124 
125 private:
126  Q_DISABLE_COPY(pqMultiSliceView)
127 };
128 
129 #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
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:62