Slicer 5.9
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
25
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{
57public:
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
95
98
100 bool DistanceFromSliceIntersectionToPoint(vtkMRMLSliceNode* intersectingSlice, double point_RAS[3], double& distance);
101
103 double* GetSliceIntersectionPoint() VTK_SIZEHINT(3);
104
106 bool IsMouseCursorInSliceView(double cursorPosition[2]);
107
109 void SetPipelinesHandlesOpacity(double opacity);
110
111 void TransformIntersectingSlices(vtkMatrix4x4* rotatedSliceToSliceTransformMatrix);
112
116 virtual std::string CanInteract(vtkMRMLInteractionEventData* interactionEventData,
117 int& foundComponentType,
118 int& foundComponentIndex,
119 double& closestDistance2,
120 double& handleOpacity);
121
123
125 {
126 public:
127 HandleInfo(int index, int componentType, const std::string& intersectingSliceNodeID, double positionWorld[3], double positionLocal[3])
128 : Index(index)
129 , ComponentType(componentType)
130 , IntersectingSliceNodeID(intersectingSliceNodeID)
131 {
132 for (int i = 0; i < 3; ++i)
133 {
134 this->PositionWorld[i] = positionWorld[i];
135 }
136 this->PositionWorld[3] = 1.0;
137 for (int i = 0; i < 3; ++i)
138 {
139 this->PositionLocal[i] = positionLocal[i];
140 }
141 this->PositionLocal[3] = 1.0;
142 }
143 int Index;
146 double PositionLocal[4];
147 double PositionWorld[4];
148 };
149
151 typedef std::vector<HandleInfo> HandleInfoList;
152 virtual HandleInfoList GetHandleInfoList(SliceIntersectionInteractionDisplayPipeline* pipeline);
153
154 virtual int GetTranslateArrowCursor(const std::string& intersectingSliceNodeID);
155
156protected:
159
160 SliceIntersectionInteractionDisplayPipeline* GetDisplayPipelineFromSliceLogic(vtkMRMLSliceLogic* sliceLogic);
161
162 static void SliceNodeModifiedCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
165
166 void UpdateSliceIntersectionDisplay(SliceIntersectionInteractionDisplayPipeline* pipeline);
167
169
171
172 double GetSliceRotationAngleRad(int eventPos[2]);
173
174 double GetLineThicknessFromMode(int lineThicknessMode);
175
178
181
184
189 double InteractionSize{ 3.0 };
190
192
193 class vtkInternal;
194 vtkInternal* Internal;
195
196 vtkSmartPointer<vtkMRMLSliceIntersectionInteractionRepresentationHelper> Helper;
197
198private:
200 void operator=(const vtkMRMLSliceIntersectionInteractionRepresentation&) = delete;
201};
202
203#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.
HandleInfo(int index, int componentType, const std::string &intersectingSliceNodeID, double positionWorld[3], double positionLocal[3])
void SetSliceDisplayNode(vtkMRMLSliceDisplayNode *sliceDisplayNode)
double GetLineThicknessFromMode(int lineThicknessMode)
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLSliceDisplayNode * GetSliceDisplayNode()
bool DistanceFromSliceIntersectionToPoint(vtkMRMLSliceNode *intersectingSlice, double point_RAS[3], double &distance)
Compute distance between a point and a slice intersection.
bool SliceIntersectionPointFound
Indicate whether a valid slice intersection point was found or not.
virtual HandleInfoList GetHandleInfoList(SliceIntersectionInteractionDisplayPipeline *pipeline)
vtkSmartPointer< vtkMRMLSliceIntersectionInteractionRepresentationHelper > Helper
bool IsMouseCursorInSliceView(double cursorPosition[2])
Check whether the mouse cursor is within the slice view or not.
void TransformIntersectingSlices(vtkMatrix4x4 *rotatedSliceToSliceTransformMatrix)
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)
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)
virtual std::string CanInteract(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2, double &handleOpacity)
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.