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
vtkSlicerMarkupsInteractionWidgetRepresentation.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
28
29#ifndef vtkSlicerMarkupsInteractionWidgetRepresentation_h
30#define vtkSlicerMarkupsInteractionWidgetRepresentation_h
31
32#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
33
34// MRMLDM includes
36
37// MRML includes
39
40class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerMarkupsInteractionWidgetRepresentation
42{
43public:
48
50
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57 int GetActiveComponentType() override;
58 void SetActiveComponentType(int type) override;
60 void SetActiveComponentIndex(int type) override;
61 bool GetHandleVisibility(int type, int index) override;
62 bool GetApplyScaleToPosition(int type, int index) override;
63
66
68 virtual void SetDisplayNode(vtkMRMLMarkupsDisplayNode* displayNode);
69
71
73
75 virtual void UpdateROIScaleHandles();
78
80 void UpdateHandleToWorldTransform(vtkTransform* handleToWorldTransform) override;
81
82 double GetInteractionScalePercent() override; // Size relative to screen
83 double GetInteractionSizeMm() override; // Size in mm
84 bool GetInteractionSizeAbsolute() override; // True -> size in mm; false -> relative to screen
85
86 void GetInteractionHandlePositionWorld(int type, int index, double positionWorld[3]) override;
87
88 bool IsDisplayable() override;
89
90 void CreateScaleHandles() override;
91
92 void GetInteractionHandleAxisLocal(int type, int index, double axis_Local[3]) override;
93 void GetHandleColor(int type, int index, double color[4]) override;
94
95 bool AddScaleEdgeIntersection(int pointIndex, vtkIdTypeArray* visibilityArray, vtkPoints* scaleHandleArray,
96 double sliceNormal[3], double sliceOrigin[3], double edgePoint[3], double edgeVector[3]);
97
98protected:
101
102 vtkSmartPointer<vtkMRMLMarkupsDisplayNode> DisplayNode{ nullptr };
103
104private:
106 void operator=(const vtkSlicerMarkupsInteractionWidgetRepresentation&) = delete;
107};
108
109#endif
Abstract representation for the transform handle widgets.
bool GetApplyScaleToPosition(int type, int index) override
Get if the view scaling should be applied to the position of the handle.
bool AddScaleEdgeIntersection(int pointIndex, vtkIdTypeArray *visibilityArray, vtkPoints *scaleHandleArray, double sliceNormal[3], double sliceOrigin[3], double edgePoint[3], double edgeVector[3])
virtual vtkMRMLMarkupsDisplayNode * GetDisplayNode()
void GetInteractionHandlePositionWorld(int type, int index, double positionWorld[3]) override
bool GetHandleVisibility(int type, int index) override
Get the visibility of the specified handle.
static vtkSlicerMarkupsInteractionWidgetRepresentation * New()
virtual void SetDisplayNode(vtkMRMLMarkupsDisplayNode *displayNode)
void GetHandleColor(int type, int index, double color[4]) override
virtual vtkMRMLMarkupsNode * GetMarkupsNode()
void UpdateHandleToWorldTransform(vtkTransform *handleToWorldTransform) override
void GetInteractionHandleAxisLocal(int type, int index, double axis_Local[3]) override
Get the axis for the handle specified by the index in local coordinates.
void UpdateInteractionPipeline() override
Update the interaction pipeline.
void PrintSelf(ostream &os, vtkIndent indent) override