Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLSliceIntersectionRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMRMLSliceIntersectionRepresentation2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or https://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 
24 #ifndef vtkMRMLSliceIntersectionRepresentation2D_h
25 #define vtkMRMLSliceIntersectionRepresentation2D_h
26 
27 #include "vtkMRMLDisplayableManagerExport.h" // For export macro
29 
30 #include "vtkMRMLSliceNode.h"
31 
34 class vtkMRMLSliceLogic;
35 
36 class vtkProperty2D;
37 class vtkActor2D;
38 class vtkPolyDataMapper2D;
39 class vtkPolyData;
40 class vtkPoints;
41 class vtkCellArray;
42 class vtkTextProperty;
43 class vtkLeaderActor2D;
44 class vtkTextMapper;
45 class vtkTransform;
46 class vtkActor2D;
47 
48 class SliceIntersectionDisplayPipeline;
49 
50 
51 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLSliceIntersectionRepresentation2D : public vtkMRMLAbstractWidgetRepresentation
52 {
53 public:
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
67  void SetSliceNode(vtkMRMLSliceNode* sliceNode);
68  vtkMRMLSliceNode* GetSliceNode();
69 
70  void AddIntersectingSliceLogic(vtkMRMLSliceLogic* sliceLogic);
71  void RemoveIntersectingSliceNode(vtkMRMLSliceNode* sliceNode);
72  void UpdateIntersectingSliceNodes();
73  void RemoveAllIntersectingSliceNodes();
74 
76 
79  void GetActors2D(vtkPropCollection *) override;
80  void ReleaseGraphicsResources(vtkWindow *) override;
81  int RenderOverlay(vtkViewport *viewport) override;
83 
84  void SetMRMLApplicationLogic(vtkMRMLApplicationLogic*);
85  vtkGetObjectMacro(MRMLApplicationLogic, vtkMRMLApplicationLogic);
86 
87  double* GetSliceIntersectionPoint();
88 
89  void TransformIntersectingSlices(vtkMatrix4x4* rotatedSliceToSliceTransformMatrix);
90 
91 protected:
94 
95  SliceIntersectionDisplayPipeline* GetDisplayPipelineFromSliceLogic(vtkMRMLSliceLogic* sliceLogic);
96 
97  static void SliceNodeModifiedCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
98  void SliceNodeModified(vtkMRMLSliceNode* sliceNode);
99  void SliceModelDisplayNodeModified(vtkMRMLModelDisplayNode* sliceNode);
100 
101  void UpdateSliceIntersectionDisplay(SliceIntersectionDisplayPipeline *pipeline);
102 
103  double GetSliceRotationAngleRad(int eventPos[2]);
104 
105  // The internal transformation matrix
106  vtkTransform *CurrentTransform;
107  vtkTransform *TotalTransform;
108  double Origin[4]; //the current origin in world coordinates
109  double DisplayOrigin[3]; //the current origin in display coordinates
110  double CurrentTranslation[3]; //translation this movement
111  double StartWorldPosition[4]; //Start event position converted to world
112 
113  // Support picking
114  double LastEventPosition[2];
115 
116  // Slice intersection point in XY
117  double SliceIntersectionPoint[4];
118 
120 
121  class vtkInternal;
122  vtkInternal * Internal;
123 
124 private:
126  void operator=(const vtkMRMLSliceIntersectionRepresentation2D&) = delete;
127 };
128 
129 #endif
MRML node to represent a display property of 3D surface model.
void PrintSelf(ostream &os, vtkIndent indent) override
represent intersections of other slice views in the current slice view
MRML node for storing a slice through RAS space.
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Slicer logic class for slice manipulation.