Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLCrosshairDisplayableManager.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 Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __vtkMRMLCrosshairDisplayableManager_h
22 #define __vtkMRMLCrosshairDisplayableManager_h
23 
24 // MRMLDisplayableManager includes
26 #include "vtkMRMLDisplayableManagerExport.h"
27 
29 class vtkMRMLScene;
31 
35 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLCrosshairDisplayableManager :
37 {
38 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  // Utility functions (used by 2D and 3D crosshair displayable managers)
45  static vtkMRMLCrosshairNode* FindCrosshairNode(vtkMRMLScene* scene);
46 
47  bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &closestDistance2) override;
48  bool ProcessInteractionEvent(vtkMRMLInteractionEventData* eventData) override;
49 
50  void SetActionsEnabled(int actions);
51  int GetActionsEnabled();
52 
53  vtkMRMLSliceIntersectionWidget* GetSliceIntersectionWidget();
54 
56  virtual int GetMouseCursor();
57 
58  // Called to notify the displayable manager that it has got or lost the focus.
59  void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData* eventData) override;
60 
61 protected:
64 
67  void Create() override;
68 
70  void OnMRMLSliceNodeModifiedEvent() override;
71 
73  void AdditionalInitializeStep() override;
74 
75 private:
77  void operator=(const vtkMRMLCrosshairDisplayableManager&) = delete;
78 
79  void UnobserveMRMLScene() override;
80  void ObserveMRMLScene() override;
81  void UpdateFromMRMLScene() override;
82  void OnMRMLNodeModified(vtkMRMLNode* node) override;
83 
84  class vtkInternal;
85  vtkInternal * Internal;
86 };
87 
88 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
MRML node for storing a crosshair through RAS space.
virtual void OnMRMLNodeModified(vtkMRMLNode *)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
virtual bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData)
virtual void UnobserveMRMLScene()
virtual void ObserveMRMLScene()
virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2)
static vtkMRMLAbstractSliceViewDisplayableManager * New()
virtual int GetMouseCursor()
Displayable manager returns ID of the mouse cursor shape that should be displayed.
virtual void UpdateFromMRMLScene()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData *eventData)
Set if the widget gets/loses focus (interaction events are processed by this displayable manager)...
Displayable manager for the crosshair on slice (2D) views.
virtual void OnMRMLSliceNodeModifiedEvent()
Could be overloaded if DisplayableManager subclass.