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 class pqQVTKWidget;
28 
30 {
31  Q_OBJECT
32  typedef pqRenderView Superclass;
33 
34 public:
35  static QString multiSliceViewType() { return "MultiSlice"; }
36 
41  pqMultiSliceView(const QString& viewtype, const QString& group, const QString& name,
42  vtkSMViewProxy* viewmodule, pqServer* server, QObject* p);
43  ~pqMultiSliceView() override;
44 
49  const double* GetVisibleSlices(int axisIndex, int& numberOfSlices);
50 
55  const double* GetSlices(int axisIndex, int& numberOfSlices)
56  {
57  return this->GetVisibleSlices(axisIndex, numberOfSlices);
58  }
59 
64  const double* GetAllSlices(int axisIndex, int& numberOfSlices);
65 
70  const double* GetSliceNormal(int axisIndex);
71 
76  const double* GetSliceOrigin(int axisIndex);
77 
81  void setCursor(const QCursor&) override;
82 
86  bool getOutlineVisibility();
87  void setOutlineVisibility(bool visible);
88 
89 Q_SIGNALS:
90  // Fired when the slices are changed by user interaction.
91  // Provides information about which slice is being
92  // changed. axisIndex is the index of axis [0,2], while sliceIndex is the
93  // index for the slice in the slices returned by GetAllSlices(). If a slice is
94  // deleted, the sliceIndex will point to its index before the slice was
95  // deleted.
96  void sliceAdded(int axisIndex, int sliceIndex);
97  void sliceRemoved(int axisIndex, int sliceIndex);
98  void sliceModified(int axisIndex, int sliceIndex);
99 
100  void sliceClicked(int axisIndex, double sliceOffsetOnAxis, int button, int modifier);
101 
102 public Q_SLOTS:
103  void updateSlices();
104 
105 private Q_SLOTS:
106  void updateAxisBounds();
107  void onSliceAdded(int activeSliceIndex);
108  void onSliceRemoved(int activeSliceIndex);
109  void onSliceModified(int activeSliceIndex);
110 
111 protected:
112  void updateViewModelCallBack(vtkObject*, unsigned long, void*);
113 
117  QWidget* createWidget() override;
118 
122  pqQVTKWidget* getInternalWidget();
123 
127  int getAxisIndex(QObject*);
128 
129  QPointer<pqQVTKWidget> InternalWidget;
131  QPointer<pqMultiSliceAxisWidget> AxisX;
132  QPointer<pqMultiSliceAxisWidget> AxisY;
133  QPointer<pqMultiSliceAxisWidget> AxisZ;
134  QPointer<pqMultiSliceAxisWidget> AxisXYZ[3];
135 
136  QMap<pqRepresentation*, unsigned int> ObserverIdX;
137  QMap<pqRepresentation*, unsigned int> ObserverIdY;
138  QMap<pqRepresentation*, unsigned int> ObserverIdZ;
139 
140  double NormalValuesHolder[9];
141  double OriginValuesHolder[9];
142 
143 protected Q_SLOTS:
144  // Internal slot that will emit sliceClicked()
145  void onSliceClicked(int button, int modifier, double value);
146 
147 private:
148  Q_DISABLE_COPY(pqMultiSliceView)
149 };
150 
151 #endif
QMap< pqRepresentation *, unsigned int > ObserverIdX
QPointer< pqMultiSliceAxisWidget > AxisY
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.
pqQVTKWidget has a QVTKOpenGL*Widget object to which it adds awareness for view proxies.
Definition: pqQVTKWidget.h:58
static QString multiSliceViewType()
QWidget * createWidget() override
Creates a new instance of the QWidget subclass to be used to show this view.
name
QPointer< pqMultiSliceAxisWidget > AxisX
QPointer< pqMultiSliceAxisWidget > AxisZ
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
const double * GetSlices(int axisIndex, int &numberOfSlices)
QPointer< pqQVTKWidget > InternalWidget
QMap< pqRepresentation *, unsigned int > ObserverIdZ
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64