pqMultiSliceView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
4 // .NAME pqMultiSliceView - QT GUI that allow multi slice control
5 
6 #ifndef pqMultiSliceView_h
7 #define pqMultiSliceView_h
8 
9 #include "pqCoreModule.h"
10 #include "pqRenderView.h"
11 
12 #include <QtCore>
13 #include <QtGui>
14 
16 class pqQVTKWidget;
17 
19 {
20  Q_OBJECT
21  typedef pqRenderView Superclass;
22 
23 public:
24  static QString multiSliceViewType() { return "MultiSlice"; }
25 
30  pqMultiSliceView(const QString& viewtype, const QString& group, const QString& name,
31  vtkSMViewProxy* viewmodule, pqServer* server, QObject* p);
32  ~pqMultiSliceView() override;
33 
38  const double* GetVisibleSlices(int axisIndex, int& numberOfSlices);
39 
44  const double* GetSlices(int axisIndex, int& numberOfSlices)
45  {
46  return this->GetVisibleSlices(axisIndex, numberOfSlices);
47  }
48 
53  const double* GetAllSlices(int axisIndex, int& numberOfSlices);
54 
59  const double* GetSliceNormal(int axisIndex);
60 
65  const double* GetSliceOrigin(int axisIndex);
66 
70  void setCursor(const QCursor&) override;
71 
75  bool getOutlineVisibility();
76  void setOutlineVisibility(bool visible);
77 
78 Q_SIGNALS:
79  // Fired when the slices are changed by user interaction.
80  // Provides information about which slice is being
81  // changed. axisIndex is the index of axis [0,2], while sliceIndex is the
82  // index for the slice in the slices returned by GetAllSlices(). If a slice is
83  // deleted, the sliceIndex will point to its index before the slice was
84  // deleted.
85  void sliceAdded(int axisIndex, int sliceIndex);
86  void sliceRemoved(int axisIndex, int sliceIndex);
87  void sliceModified(int axisIndex, int sliceIndex);
88 
89  void sliceClicked(int axisIndex, double sliceOffsetOnAxis, int button, int modifier);
90 
91 public Q_SLOTS:
92  void updateSlices();
93 
94 private Q_SLOTS:
95  void updateAxisBounds();
96  void onSliceAdded(int activeSliceIndex);
97  void onSliceRemoved(int activeSliceIndex);
98  void onSliceModified(int activeSliceIndex);
99 
100 protected:
101  void updateViewModelCallBack(vtkObject*, unsigned long, void*);
102 
106  QWidget* createWidget() override;
107 
111  pqQVTKWidget* getInternalWidget();
112 
116  int getAxisIndex(QObject*);
117 
118  QPointer<pqQVTKWidget> InternalWidget;
120  QPointer<pqMultiSliceAxisWidget> AxisX;
121  QPointer<pqMultiSliceAxisWidget> AxisY;
122  QPointer<pqMultiSliceAxisWidget> AxisZ;
123  QPointer<pqMultiSliceAxisWidget> AxisXYZ[3];
124 
125  QMap<pqRepresentation*, unsigned int> ObserverIdX;
126  QMap<pqRepresentation*, unsigned int> ObserverIdY;
127  QMap<pqRepresentation*, unsigned int> ObserverIdZ;
128 
129  double NormalValuesHolder[9];
130  double OriginValuesHolder[9];
131 
132 protected Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
133  // Internal slot that will emit sliceClicked()
134  void onSliceClicked(int button, int modifier, double value);
135 
136 private:
137  Q_DISABLE_COPY(pqMultiSliceView)
138 };
139 
140 #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.
QWidget subclass to show rendering results from vtkSMViewProxy.
Definition: pqQVTKWidget.h:35
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:35