Slicer 5.6
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;
38
43class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
44{
45 Q_OBJECT
46public:
48 typedef ctkVTKRenderView Superclass;
49
51 explicit qMRMLThreeDView(QWidget* parent = nullptr);
52 ~qMRMLThreeDView() override;
53
55 void setInteractor(vtkRenderWindowInteractor* interactor) override;
56
59
69 void addDisplayableManager(const QString& displayableManager);
70 Q_INVOKABLE void getDisplayableManagers(vtkCollection* displayableManagers);
71
74
76 Q_INVOKABLE vtkMRMLViewNode* mrmlViewNode()const;
77
83 Q_INVOKABLE void rotateToViewAxis(unsigned int axisId);
84 Q_INVOKABLE void rotateToViewAxis(const std::string& axisLabel);
85 Q_INVOKABLE void resetCamera(bool resetRotation = true,
86 bool resetTranslation = true,
87 bool resetDistance = true);
88
91
93 Q_INVOKABLE void setViewCursor(const QCursor &);
94
96 Q_INVOKABLE void unsetViewCursor();
97
99 Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor);
100
101 void dragEnterEvent(QDragEnterEvent* event) override;
102 void dropEvent(QDropEvent* event) override;
103
104public slots:
105
109 void setMRMLScene(vtkMRMLScene* newScene);
110
113
115 void lookFromViewAxis(const ctkAxesWidget::Axis& axis)
116 {
117 qWarning("This function is deprecated. Use lookFromAxis(const ctkAxesWidget::Axis& axis) instead.");
118 this->lookFromAxis(axis);
119 };
120
123 virtual void resetFocalPoint();
124
125private:
126 Q_DECLARE_PRIVATE(qMRMLThreeDView);
127 Q_DISABLE_COPY(qMRMLThreeDView);
128};
129
130#endif
3D view for view nodes. For performance reasons, the view block refreshes when the scene is in batch ...
Q_INVOKABLE void getDisplayableManagers(vtkCollection *displayableManagers)
Q_INVOKABLE void unsetViewCursor()
Restore default cursor in the view area.
qMRMLThreeDView(QWidget *parent=nullptr)
Constructors.
Q_INVOKABLE vtkMRMLViewNode * mrmlViewNode() const
Get the 3D View node observed by view.
Q_INVOKABLE void rotateToViewAxis(const std::string &axisLabel)
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.
Q_INVOKABLE void resetCamera(bool resetRotation=true, bool resetTranslation=true, bool resetDistance=true)
ctkVTKRenderView Superclass
Superclass typedef.
Q_INVOKABLE vtkMRMLThreeDViewInteractorStyle * interactorObserver() const
Returns the interactor observer of the view.
Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor)
Set default cursor in the view area.
void dropEvent(QDropEvent *event) override
Q_INVOKABLE void setViewCursor(const QCursor &)
Set cursor in the view area.
void dragEnterEvent(QDragEnterEvent *event) override
~qMRMLThreeDView() override
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.
A set of MRML Nodes that supports serialization and undo/redo.
Interactive manipulation of the camera.
MRML node to represent a 3D view.