Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLSliceViewInteractorStyle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile: vtkMRMLSliceViewInteractorStyle.h,v $
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef __vtkMRMLSliceViewInteractorStyle_h
17 #define __vtkMRMLSliceViewInteractorStyle_h
18 
19 // VTK includes
20 #include "vtkWeakPointer.h"
21 
22 // MRML includes
23 #include "vtkMRMLDisplayableManagerExport.h"
25 
30 class vtkMRMLSliceLogic;
31 class vtkTimerLog;
32 
42 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLSliceViewInteractorStyle :
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  bool DelegateInteractionEventToDisplayableManagers(vtkEventData* inputEventData) override;
54 
56 
58  enum
59  {
60  None = 0,
61  Translate = 1,
62  Zoom = 2,
63  Rotate = 4, /* Rotate not currently used */
64  Blend = 8, /* fg to bg, labelmap to bg */
65  AdjustWindowLevelBackground = 16,
66  AdjustWindowLevelForeground = 32,
67  BrowseSlice = 64,
68  ShowSlice = 128,
69  AdjustLightbox = 256, /* not used */
70  SelectVolume = 512,
71  SetCursorPosition = 1024, /* adjust cursor position in crosshair node as mouse is moved */
72  SetCrosshairPosition = 2048,
73  TranslateSliceIntersection = 4096,
74  RotateSliceIntersection = 8192,
75  AllActionsMask = Translate | Zoom | Rotate | Blend | AdjustWindowLevelBackground | AdjustWindowLevelForeground
76  | BrowseSlice | ShowSlice | AdjustLightbox | SelectVolume | SetCursorPosition | SetCrosshairPosition
77  | TranslateSliceIntersection | RotateSliceIntersection
78  };
79 
84  void SetActionEnabled(int actionsMask, bool enable = true);
87  bool GetActionEnabled(int actionsMask);
88 
91  void SetSliceLogic(vtkMRMLSliceLogic* SliceLogic);
92  vtkGetObjectMacro(SliceLogic, vtkMRMLSliceLogic);
93 
94  vtkMRMLCrosshairDisplayableManager* GetCrosshairDisplayableManager();
95 
96  vtkMRMLScalarBarDisplayableManager* GetScalarBarDisplayableManager();
97 
98 protected:
101 
102  static void SliceViewProcessEvents(vtkObject* object, unsigned long event, void* clientdata, void* calldata);
103 
104  void SetMouseCursor(int cursor);
105 
107 
108  //bool MouseMovedSinceButtonDown;
109 
110  //vtkSmartPointer<vtkTimerLog> ClickTimer;
111  //int NumberOfClicks;
112 
114 
115 private:
117  void operator=(const vtkMRMLSliceViewInteractorStyle&) = delete;
118 };
119 
120 #endif
void SetMouseCursor(int cursor)
Superclass for displayable manager classes.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual bool DelegateInteractionEventToDisplayableManagers(unsigned long event)
Common base class for processing interaction events in MRML views.
MRML node for representing segmentation display attributes.
static vtkMRMLViewInteractorStyle * New()
Displayable manager for the scalar bars and window/level adjustment.
Provides customizable interaction routines.
Slicer logic class for slice manipulation.
Displayable manager for the crosshair on slice (2D) views.