Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
30 class QDropEvent;
31 class qMRMLThreeDViewPrivate;
33 class vtkMRMLCameraNode;
34 class vtkMRMLScene;
35 class vtkMRMLViewNode;
36 class vtkCollection;
37 
42 class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
43 {
44  Q_OBJECT
45 public:
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 
66  Q_INVOKABLE vtkMRMLAbstractDisplayableManager* displayableManagerByClassName(const char* className);
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 
86  Q_INVOKABLE vtkMRMLCameraNode* cameraNode();
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 
100 public slots:
101 
105  void setMRMLScene(vtkMRMLScene* newScene);
106 
108  void setMRMLViewNode(vtkMRMLViewNode* newViewNode);
109 
111  void lookFromViewAxis(const ctkAxesWidget::Axis& axis);
112 
115  virtual void resetFocalPoint();
116 
117 protected:
118  QScopedPointer<qMRMLThreeDViewPrivate> d_ptr;
119 
120 private:
121  Q_DECLARE_PRIVATE(qMRMLThreeDView);
122  Q_DISABLE_COPY(qMRMLThreeDView);
123 };
124 
125 #endif
Superclass for displayable manager classes.
QScopedPointer< qMRMLThreeDViewPrivate > d_ptr
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
3D view for view nodes. For performance reasons, the view block refreshs when the scene is in batch p...
MRML node to represent a 3D view.
MRML node to represent camera node.
ctkVTKRenderView Superclass
Superclass typedef.