Slicer 5.9
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
vtkSlicerMarkupsInteractionWidget.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
27
28#ifndef vtkSlicerMarkupsInteractionWidget_h
29#define vtkSlicerMarkupsInteractionWidget_h
30
31#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
32
34
40class vtkIdList;
41class vtkPolyData;
42class vtkTransform;
45
46class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerMarkupsInteractionWidget
48{
49public:
52
56 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60 virtual void CreateDefaultRepresentation(vtkMRMLMarkupsDisplayNode* displayNode, vtkMRMLAbstractViewNode* viewNode, vtkRenderer* renderer);
61
64
65 int GetActiveComponentType() override;
66 void SetActiveComponentType(int type) override;
67
69 void SetActiveComponentIndex(int type) override;
70
72
73 void ScaleWidget(double eventPos[2], bool uniformScale=false) override;
74 virtual void ScaleWidgetPlane(double eventPos[2], bool symmetricScale);
75 virtual void FlipPlaneHandles(bool flipLRHandle, bool flipPAHandle);
76 virtual void ScaleWidgetROI(double eventPos[2], bool symmetricScale);
77 virtual void FlipROIHandles(bool flipLRHandle, bool flipPAHandle, bool flipISHandle);
78
80
82
84
86
87protected:
90
91 void ApplyTransform(vtkTransform* transform) override;
92
93private:
95 void operator=(const vtkSlicerMarkupsInteractionWidget&) = delete;
96};
97
98//----------------------------------------------------------------------
99// CREATE INSTANCE MACRO
100
101#ifdef VTK_HAS_INITIALIZE_OBJECT_BASE
102#define vtkSlicerMarkupsInteractionWidgetCreateInstanceMacroBody(type) \
103 vtkObject* ret = vtkObjectFactory::CreateInstance(#type); \
104 if(ret) \
105 { \
106 return static_cast<type *>(ret); \
107 } \
108 type* result = new type; \
109 result->InitializeObjectBase(); \
110 return result;
111#else
112#define vtkSlicerMarkupsInteractionWidgetCreateInstanceMacroBody(type) \
113 vtkObject* ret = vtkObjectFactory::CreateInstance(#type); \
114 if (ret) \
115 { \
116 return static_cast<type*>(ret); \
117 } \
118return new type;
119#endif
120
121#define vtkSlicerMarkupsInteractionWidgetCreateInstanceMacro(type) \
122vtkSlicerMarkupsInteractionWidget* CreateInstance() const override\
123{ \
124 vtkSlicerMarkupsInteractionWidgetCreateInstanceMacroBody(type) \
125}
126
127#endif
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
Abstract Superclass for all specific types of MRML nodes.
virtual void FlipROIHandles(bool flipLRHandle, bool flipPAHandle, bool flipISHandle)
virtual vtkSlicerMarkupsInteractionWidget * CreateInstance() const
vtkMRMLNode * GetMRMLNode() override
void SetActiveComponentType(int type) override
void ScaleWidget(double eventPos[2], bool uniformScale=false) override
virtual void FlipPlaneHandles(bool flipLRHandle, bool flipPAHandle)
virtual void ScaleWidgetROI(double eventPos[2], bool symmetricScale)
virtual vtkMRMLMarkupsDisplayNode * GetDisplayNode()
void SetActiveComponentIndex(int type) override
virtual vtkMRMLMarkupsNode * GetMarkupsNode()
static vtkSlicerMarkupsInteractionWidget * New()
Instantiate this class.
void ApplyTransform(vtkTransform *transform) override
bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData) override
Process interaction event.
virtual void ScaleWidgetPlane(double eventPos[2], bool symmetricScale)
void PrintSelf(ostream &os, vtkIndent indent) override
bool ProcessWidgetJumpCursor(vtkMRMLInteractionEventData *eventData)
virtual void CreateDefaultRepresentation(vtkMRMLMarkupsDisplayNode *displayNode, vtkMRMLAbstractViewNode *viewNode, vtkRenderer *renderer)
Create the default widget representation and initializes the widget and representation.
bool ProcessWidgetMenu(vtkMRMLInteractionEventData *eventData) override