Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLSliceIntersectionInteractionRepresentation.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Ebatinca S.L., Las Palmas de Gran Canaria, Spain
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
26#ifndef vtkMRMLSliceIntersectionInteractionRepresentation_h
27#define vtkMRMLSliceIntersectionInteractionRepresentation_h
28
29#include "vtkMRMLDisplayableManagerExport.h" // For export macro
32
34#include "vtkMRMLSliceNode.h"
35
39
40class vtkProperty2D;
41class vtkActor2D;
42class vtkPolyDataMapper2D;
43class vtkPolyData;
44class vtkPoints;
45class vtkCellArray;
46class vtkTextProperty;
47class vtkLeaderActor2D;
48class vtkTextMapper;
49class vtkTransform;
50class vtkActor2D;
51
52class SliceIntersectionInteractionDisplayPipeline;
54
56{
57 public:
62
64
68 void PrintSelf(ostream& os, vtkIndent indent) override;
70
73
75
77 void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void* callData = nullptr) override;
78
83
85
88 void GetActors2D(vtkPropCollection*) override;
89 void ReleaseGraphicsResources(vtkWindow*) override;
90 int RenderOverlay(vtkViewport* viewport) override;
92
94 vtkGetObjectMacro(MRMLApplicationLogic, vtkMRMLApplicationLogic);
95
98
100 double* GetSliceIntersectionPoint() VTK_SIZEHINT(3);
101
103 bool IsMouseCursorInSliceView(double cursorPosition[2]);
104
105 void SetPipelinesHandlesVisibility(bool visible);
106 void SetPipelinesHandlesOpacity(double opacity);
107
108 void TransformIntersectingSlices(vtkMatrix4x4* rotatedSliceToSliceTransformMatrix);
109
113 virtual std::string CanInteract(vtkMRMLInteractionEventData* interactionEventData,
114 int& foundComponentType, int& foundComponentIndex, double& closestDistance2, double& handleOpacity);
115
116 virtual double GetMaximumHandlePickingDistance2();
117
119 {
120 public:
121 HandleInfo(int index, int componentType, const std::string& intersectingSliceNodeID, double positionWorld[3], double positionLocal[3])
122 : Index(index)
123 , ComponentType(componentType)
124 , IntersectingSliceNodeID(intersectingSliceNodeID)
125 {
126 for (int i = 0; i < 3; ++i)
127 {
128 this->PositionWorld[i] = positionWorld[i];
129 }
130 this->PositionWorld[3] = 1.0;
131 for (int i = 0; i < 3; ++i)
132 {
133 this->PositionLocal[i] = positionLocal[i];
134 }
135 this->PositionLocal[3] = 1.0;
136 }
137 int Index;
140 double PositionLocal[4];
141 double PositionWorld[4];
142 };
143
145 typedef std::vector<HandleInfo> HandleInfoList;
146 virtual HandleInfoList GetHandleInfoList(SliceIntersectionInteractionDisplayPipeline* pipeline);
147
148 virtual int GetTranslateArrowCursor(const std::string& intersectingSliceNodeID);
149
150 protected:
153
154 SliceIntersectionInteractionDisplayPipeline* GetDisplayPipelineFromSliceLogic(vtkMRMLSliceLogic* sliceLogic);
155
156 static void SliceNodeModifiedCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
159
160 void UpdateSliceIntersectionDisplay(SliceIntersectionInteractionDisplayPipeline* pipeline);
161
163
165
166 double GetSliceRotationAngleRad(int eventPos[2]);
167
168 double GetLineThicknessFromMode(int lineThicknessMode);
169
171 double LastEventPosition[2];
172
174 double SliceIntersectionPoint[4];
175
178
183 double InteractionSize{ 3.0 };
184
185 double GetViewScaleFactorAtPosition(double positionWorld[3]);
186
188
189 class vtkInternal;
190 vtkInternal* Internal;
191
193
194 private:
196 void operator=(const vtkMRMLSliceIntersectionInteractionRepresentation&) = delete;
197};
198
199#endif
MRML node to represent a display property of 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
MRML node to store display properties of slice nodes.
represent intersections of other slice views in the current slice view
HandleInfo(int index, int componentType, const std::string &intersectingSliceNodeID, double positionWorld[3], double positionLocal[3])
represent intersections of other slice views in the current slice view
void SetSliceDisplayNode(vtkMRMLSliceDisplayNode *sliceDisplayNode)
vtkMRMLSliceIntersectionInteractionRepresentationHelper * Helper
double GetLineThicknessFromMode(int lineThicknessMode)
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLSliceDisplayNode * GetSliceDisplayNode()
bool SliceIntersectionPointFound
Indicate whether a valid slice intersection point was found or not.
virtual HandleInfoList GetHandleInfoList(SliceIntersectionInteractionDisplayPipeline *pipeline)
virtual int GetTranslateArrowCursor(const std::string &intersectingSliceNodeID)
vtkMRMLSliceDisplayNode * GetSliceDisplayNode(vtkMRMLSliceNode *sliceNode)
void UpdateFromMRML(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
static void SliceNodeModifiedCallback(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
double GetViewScaleFactorAtPosition(double positionWorld[3])
void SetSliceNode(vtkMRMLSliceNode *sliceNode)
void SetMRMLApplicationLogic(vtkMRMLApplicationLogic *)
void ComputeSliceIntersectionPoint()
Compute slice intersection point between red, green and yellow slice nodes.
double * GetSliceIntersectionPoint() VTK_SIZEHINT(3)
Get slice intersection point between red, green and yellow slice nodes.
static vtkMRMLSliceIntersectionInteractionRepresentation * New()
void GetActors2D(vtkPropCollection *) override
SliceIntersectionInteractionDisplayPipeline * GetDisplayPipelineFromSliceLogic(vtkMRMLSliceLogic *sliceLogic)
int RenderOverlay(vtkViewport *viewport) override
void UpdateSliceIntersectionDisplay(SliceIntersectionInteractionDisplayPipeline *pipeline)
void RemoveIntersectingSliceNode(vtkMRMLSliceNode *sliceNode)
void SliceNodeModified(vtkMRMLSliceNode *sliceNode)
void AddIntersectingSliceLogic(vtkMRMLSliceLogic *sliceLogic)
std::vector< HandleInfo > HandleInfoList
Get the list of info for all interaction handles.
void ReleaseGraphicsResources(vtkWindow *) override
void SliceModelDisplayNodeModified(vtkMRMLModelDisplayNode *sliceNode)
Slicer logic class for slice manipulation.
MRML node for storing a slice through RAS space.