Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLCameraDisplayableManager.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  Based on Slicer/Base/GUI/vtkSlicerViewerWidget.h,
17  this file was developed by Jean-Christophe Fillion-Robin, Kitware Inc.
18  and was partially funded by NIH grant 3P41RR013218-12S1
19 
20 ==============================================================================*/
21 
22 #ifndef __vtkMRMLCameraDisplayableManager_h
23 #define __vtkMRMLCameraDisplayableManager_h
24 
25 // MRMLDisplayableManager includes
27 
28 #include "vtkMRMLDisplayableManagerExport.h"
29 
30 class vtkMRMLCameraNode;
32 
33 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLCameraDisplayableManager :
35 {
36 
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  void RemoveMRMLObservers() override;
43 
44  void UpdateCameraNode();
45 
46  vtkMRMLCameraNode* GetCameraNode();
47 
49  enum
50  {
51  ActiveCameraChangedEvent = 30000
52  };
53 
54  bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &closestDistance2) override;
55  bool ProcessInteractionEvent(vtkMRMLInteractionEventData* eventData) override;
56 
57  vtkMRMLCameraWidget* GetCameraWidget();
58 
59 protected:
60 
63 
64  void Create() override;
65 
66  void OnMRMLSceneEndClose() override;
67  void OnMRMLSceneStartImport() override;
68  void OnMRMLSceneEndImport() override;
69  void OnMRMLSceneEndRestore() override;
70  void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
71  void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
72 
73  void ProcessMRMLNodesEvents(vtkObject *caller,
74  unsigned long event,
75  void *callData) override;
76  void OnMRMLNodeModified(vtkMRMLNode* node) override;
77 
78  void SetAndObserveCameraNode(vtkMRMLCameraNode * newCameraNode);
79  void AdditionalInitializeStep() override;
80  void SetCameraToRenderer();
81  void SetCameraToInteractor();
82 
83 private:
84 
86  void operator=(const vtkMRMLCameraDisplayableManager&) = delete;
87 
88  class vtkInternal;
89  vtkInternal * Internal;
90 
91 };
92 
93 #endif
virtual void RemoveMRMLObservers()
Remove MRML observers.
virtual void OnMRMLSceneEndImport()
virtual void OnMRMLSceneEndClose()
Process camera manipulation events.
virtual void OnMRMLSceneStartImport()
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void OnMRMLNodeModified(vtkMRMLNode *)
virtual bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData)
virtual void OnMRMLSceneNodeAdded(vtkMRMLNode *)
static vtkMRMLAbstractThreeDViewDisplayableManager * New()
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2)
virtual void OnMRMLSceneEndRestore()
MRML node to represent camera node.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167