Slicer 5.4
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;
35class vtkMRMLViewNode;
36class vtkCollection;
37
42class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
43{
44 Q_OBJECT
45public:
47 typedef ctkVTKRenderView Superclass;
48
50 explicit qMRMLThreeDView(QWidget* parent = nullptr);
51 ~qMRMLThreeDView() override;
52
62 void addDisplayableManager(const QString& displayableManager);
63 Q_INVOKABLE void getDisplayableManagers(vtkCollection* displayableManagers);
64
67
69 Q_INVOKABLE vtkMRMLViewNode* mrmlViewNode()const;
70
72 //vtkInteractorObserver* interactorStyle()const;
73
79 Q_INVOKABLE void rotateToViewAxis(unsigned int axisId);
80 Q_INVOKABLE void rotateToViewAxis(const std::string& axisLabel);
81 Q_INVOKABLE void resetCamera(bool resetRotation = true,
82 bool resetTranslation = true,
83 bool resetDistance = true);
84
87
89 Q_INVOKABLE void setViewCursor(const QCursor &);
90
92 Q_INVOKABLE void unsetViewCursor();
93
95 Q_INVOKABLE void setDefaultViewCursor(const QCursor &cursor);
96
97 void dragEnterEvent(QDragEnterEvent* event) override;
98 void dropEvent(QDropEvent* event) override;
99
100public slots:
101
105 void setMRMLScene(vtkMRMLScene* newScene);
106
109
111 void lookFromViewAxis(const ctkAxesWidget::Axis& axis)
112 {
113 qWarning("This function is deprecated. Use lookFromAxis(const ctkAxesWidget::Axis& axis) instead.");
114 this->lookFromAxis(axis);
115 };
116
119 virtual void resetFocalPoint();
120
121protected:
122 QScopedPointer<qMRMLThreeDViewPrivate> d_ptr;
123
124private:
125 Q_DECLARE_PRIVATE(qMRMLThreeDView);
126 Q_DISABLE_COPY(qMRMLThreeDView);
127};
128
129#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.
Q_INVOKABLE void rotateToViewAxis(unsigned int axisId)
Returns the interactor style of the view.
Q_INVOKABLE vtkMRMLCameraNode * cameraNode()
Returns camera node of the 3D view.
Q_INVOKABLE void resetCamera(bool resetRotation=true, bool resetTranslation=true, bool resetDistance=true)
QScopedPointer< qMRMLThreeDViewPrivate > d_ptr
ctkVTKRenderView Superclass
Superclass typedef.
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.
MRML node to represent a 3D view.