Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerROIWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16  and was supported through CANARIE's Research Software Program, Cancer
17  Care Ontario, OpenAnatomy, and Brigham and Women's Hospital through NIH grant R01MH112748.
18 
19 ==============================================================================*/
20 
29 #ifndef vtkSlicerROIWidget_h
30 #define vtkSlicerROIWidget_h
31 
32 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
33 #include "vtkSlicerMarkupsWidget.h"
34 
35 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerROIWidget : public vtkSlicerMarkupsWidget
36 {
37 public:
39  static vtkSlicerROIWidget *New();
40 
43 
45  enum
46  {
47  WidgetStateSymmetricScale = WidgetStateMarkups_Last,
48  WidgetStateMarkupsROI_Last
49  };
50 
51  // Widget events
52  enum
53  {
54  WidgetEventSymmetricScaleStart = WidgetEventMarkups_Last,
56  WidgetEventMarkupsROI_Last
57  };
58 
60  void CreateDefaultRepresentation(vtkMRMLMarkupsDisplayNode* markupsDisplayNode, vtkMRMLAbstractViewNode* viewNode, vtkRenderer* renderer) override;
61 
65  void FlipROIHandles(bool flipLRHandle, bool flipAPHandle, bool flipISHandle);
66 
69 
70 protected:
72  ~vtkSlicerROIWidget() override;
73 
74  bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2) override;
75  bool ProcessInteractionEvent(vtkMRMLInteractionEventData* eventData) override;
76  bool ProcessWidgetSymmetricScaleStart(vtkMRMLInteractionEventData* eventData);
77  bool ProcessMouseMove(vtkMRMLInteractionEventData* eventData) override;
78  bool ProcessEndMouseDrag(vtkMRMLInteractionEventData* eventData) override;
79 
80  void ScaleWidget(double eventPos[2]) override;
81  void ScaleWidget(double eventPos[2], bool symmetricScale);
82 
83 private:
84  vtkSlicerROIWidget(const vtkSlicerROIWidget&) = delete;
85  void operator=(const vtkSlicerROIWidget&) = delete;
86 };
87 
88 #endif
Create an ROI representation.
#define vtkSlicerMarkupsWidgetCreateInstanceMacro(type)
virtual void ScaleWidget(double eventPos[2])
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData) override
Process interaction event.
Process interaction events to update state of markup widget nodes.
virtual bool ProcessEndMouseDrag(vtkMRMLInteractionEventData *eventData)
bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2) override
Return true if the widget can process the event.
virtual void CreateDefaultRepresentation(vtkMRMLMarkupsDisplayNode *markupsDisplayNode, vtkMRMLAbstractViewNode *viewNode, vtkRenderer *renderer)=0
Create the default widget representation and initializes the widget and representation.
virtual bool ProcessMouseMove(vtkMRMLInteractionEventData *eventData)