Slicer 5.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLThreeDView.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qMRMLThreeDView_h
22#define __qMRMLThreeDView_h
23
24// CTK includes
25#include <ctkPimpl.h>
26#include <ctkVTKRenderView.h>
27
28#include "qMRMLWidgetsExport.h"
29
30class QDropEvent;
31class qMRMLThreeDViewPrivate;
34class vtkMRMLScene;
36class vtkMRMLViewNode;
37class vtkCollection;
38class vtkSSAOPass;
39
44class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
45{
46 Q_OBJECT
50 Q_PROPERTY(bool shadowsVisibility READ shadowsVisibility WRITE setShadowsVisibility)
54 Q_PROPERTY(double ambientShadowsSizeScale READ ambientShadowsSizeScale WRITE setAmbientShadowsSizeScale)
56 Q_PROPERTY(double ambientShadowsVolumeOpacityThreshold READ ambientShadowsVolumeOpacityThreshold WRITE setAmbientShadowsVolumeOpacityThreshold)
59 Q_PROPERTY(double ambientShadowsIntensityScale READ ambientShadowsIntensityScale WRITE setAmbientShadowsIntensityScale)
62 Q_PROPERTY(double ambientShadowsIntensityShift READ ambientShadowsIntensityShift WRITE setAmbientShadowsIntensityShift)
63
64public:
66 typedef ctkVTKRenderView Superclass;
67
69 explicit qMRMLThreeDView(QWidget* parent = nullptr);
70 ~qMRMLThreeDView() override;
71
73 void setInteractor(vtkRenderWindowInteractor* interactor) override;
74
76 Q_INVOKABLE vtkMRMLThreeDViewInteractorStyle* interactorObserver()const;
77
87 void addDisplayableManager(const QString& displayableManager);
88 Q_INVOKABLE void getDisplayableManagers(vtkCollection* displayableManagers);
89
91 Q_INVOKABLE vtkMRMLAbstractDisplayableManager* displayableManagerByClassName(const char* className);
92
94 Q_INVOKABLE vtkMRMLViewNode* mrmlViewNode()const;
95
101 Q_INVOKABLE void rotateToViewAxis(unsigned int axisId);
102 Q_INVOKABLE void rotateToViewAxis(const std::string& axisLabel);
103 Q_INVOKABLE void resetCamera(bool resetRotation = true,
104 bool resetTranslation = true,
105 bool resetDistance = true);
106
108 Q_INVOKABLE vtkMRMLCameraNode* cameraNode();
109
111 Q_INVOKABLE void setViewCursor(const QCursor &);
112
114 Q_INVOKABLE void unsetViewCursor();
115
117 Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor);
118
119 void dragEnterEvent(QDragEnterEvent* event) override;
120 void dropEvent(QDropEvent* event) override;
121
122 bool shadowsVisibility()const;
123 double ambientShadowsSizeScale()const;
124 double ambientShadowsVolumeOpacityThreshold()const;
125 double ambientShadowsIntensityScale()const;
126 double ambientShadowsIntensityShift()const;
127
130 Q_INVOKABLE vtkSSAOPass* ssaoPass()const;
131
132public slots:
133
137 void setMRMLScene(vtkMRMLScene* newScene);
138
140 void setMRMLViewNode(vtkMRMLViewNode* newViewNode);
141
143 void lookFromViewAxis(const ctkAxesWidget::Axis& axis)
144 {
145 qWarning("This function is deprecated. Use lookFromAxis(const ctkAxesWidget::Axis& axis) instead.");
146 this->lookFromAxis(axis);
147 };
148
151 virtual void resetFocalPoint();
152
158
159private:
160 Q_DECLARE_PRIVATE(qMRMLThreeDView);
161 Q_DISABLE_COPY(qMRMLThreeDView);
162};
163
164#endif
3D view for view nodes. For performance reasons, the view block refreshes when the scene is in batch ...
void setAmbientShadowsSizeScale(double)
virtual void resetFocalPoint()
void setAmbientShadowsVolumeOpacityThreshold(double)
void setAmbientShadowsIntensityScale(double)
ctkVTKRenderView Superclass
Superclass typedef.
void setShadowsVisibility(bool)
void setAmbientShadowsIntensityShift(double)
Superclass for displayable manager classes.
MRML node to represent camera node.
A set of MRML Nodes that supports serialization and undo/redo.
Interactive manipulation of the camera.
MRML node to represent a 3D view.