Slicer 5.9
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;
35class vtkMRMLScene;
37class vtkMRMLViewNode;
38class vtkCollection;
39class vtkSSAOPass;
40
45class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
46{
47 Q_OBJECT
64
65public:
67 typedef ctkVTKRenderView Superclass;
68
70 explicit qMRMLThreeDView(QWidget* parent = nullptr);
71 ~qMRMLThreeDView() override;
72
74 void setInteractor(vtkRenderWindowInteractor* interactor) override;
75
78
88 void addDisplayableManager(const QString& displayableManager);
89 Q_INVOKABLE void getDisplayableManagers(vtkCollection* displayableManagers);
90
93
95 Q_INVOKABLE vtkMRMLViewNode* mrmlViewNode() const;
96
102 Q_INVOKABLE void rotateToViewAxis(unsigned int axisId);
103 Q_INVOKABLE void rotateToViewAxis(const std::string& axisLabel);
104 Q_INVOKABLE void resetCamera(bool resetRotation = true, bool resetTranslation = true, bool resetDistance = true);
105
108
110 Q_INVOKABLE void setViewCursor(const QCursor&);
111
113 Q_INVOKABLE void unsetViewCursor();
114
116 Q_INVOKABLE void setDefaultViewCursor(const QCursor& cursor);
117
118 void dragEnterEvent(QDragEnterEvent* event) override;
119 void dropEvent(QDropEvent* event) override;
120
121 bool shadowsVisibility() const;
126
129 Q_INVOKABLE vtkSSAOPass* ssaoPass() const;
130
131public slots:
132
136 void setMRMLScene(vtkMRMLScene* newScene);
137
140
142 void lookFromViewAxis(const ctkAxesWidget::Axis& axis)
143 {
144 qWarning("This function is deprecated. Use lookFromAxis(const ctkAxesWidget::Axis& axis) instead.");
145 this->lookFromAxis(axis);
146 };
147
150 virtual void resetFocalPoint();
151
157
158protected:
161
162private:
163 Q_DECLARE_PRIVATE(qMRMLThreeDView);
164 Q_DISABLE_COPY(qMRMLThreeDView);
165};
166
167#endif
Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers)
Q_INVOKABLE void unsetViewCursor()
Restore default cursor in the view area.
qMRMLThreeDView(QWidget *parent=nullptr)
Constructors.
vtkMRMLDisplayableManagerGroup * displayableManagerGroup() const
Q_INVOKABLE vtkMRMLViewNode * mrmlViewNode() const
Get the 3D View node observed by view.
void setAmbientShadowsSizeScale(double)
friend class qMRMLLayoutThreeDViewFactory
void setMRMLScene(vtkMRMLScene *newScene)
void addDisplayableManager(const QString &displayableManager)
virtual void resetFocalPoint()
void lookFromViewAxis(const ctkAxesWidget::Axis &axis)
void setMRMLViewNode(vtkMRMLViewNode *newViewNode)
Set the current viewNode to observe.
void setInteractor(vtkRenderWindowInteractor *interactor) override
Sets the interactor of the view.
Q_INVOKABLE void rotateToViewAxis(unsigned int axisId)
Q_INVOKABLE vtkMRMLCameraNode * cameraNode()
Returns camera node of the 3D view.
void setAmbientShadowsVolumeOpacityThreshold(double)
Q_INVOKABLE void resetCamera(bool resetRotation=true, bool resetTranslation=true, bool resetDistance=true)
void setAmbientShadowsIntensityScale(double)
ctkVTKRenderView Superclass
Superclass typedef.
Q_INVOKABLE vtkMRMLThreeDViewInteractorStyle * interactorObserver() const
Returns the interactor observer of the view.
void setShadowsVisibility(bool)
Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor)
Set default cursor in the view area.
double ambientShadowsSizeScale
void dropEvent(QDropEvent *event) override
double ambientShadowsVolumeOpacityThreshold
Volume rendering opacity above this value will cast shadows.
Q_INVOKABLE vtkSSAOPass * ssaoPass() const
Q_INVOKABLE void setViewCursor(const QCursor &)
Set cursor in the view area.
double ambientShadowsIntensityScale
void setAmbientShadowsIntensityShift(double)
void dragEnterEvent(QDragEnterEvent *event) override
double ambientShadowsIntensityShift
Q_INVOKABLE vtkMRMLAbstractDisplayableManager * displayableManagerByClassName(const char *className)
Return a DisplayableManager given its class name.
Superclass for displayable manager classes.
MRML node to represent camera node.
DisplayableManagerGroup is a collection of DisplayableManager.
A set of MRML Nodes that supports serialization and undo/redo.
Interactive manipulation of the camera.
MRML node to represent a 3D view.