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
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{
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
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, int& foundComponentIndex, double& closestDistance2, double& handleOpacity);
118
120
122 {
123 public:
124 HandleInfo(int index, int componentType, const std::string& intersectingSliceNodeID, double positionWorld[3], double positionLocal[3])
125 : Index(index)
126 , ComponentType(componentType)
127 , IntersectingSliceNodeID(intersectingSliceNodeID)
128 {
129 for (int i = 0; i < 3; ++i)
130 {
131 this->PositionWorld[i] = positionWorld[i];
132 }
133 this->PositionWorld[3] = 1.0;
134 for (int i = 0; i < 3; ++i)
135 {
136 this->PositionLocal[i] = positionLocal[i];
137 }
138 this->PositionLocal[3] = 1.0;
139 }
140 int Index;
143 double PositionLocal[4];
144 double PositionWorld[4];
145 };
146
148 typedef std::vector<HandleInfo> HandleInfoList;
149 virtual HandleInfoList GetHandleInfoList(SliceIntersectionInteractionDisplayPipeline* pipeline);
150
151 virtual int GetTranslateArrowCursor(const std::string& intersectingSliceNodeID);
152
153 protected:
156
157 SliceIntersectionInteractionDisplayPipeline* GetDisplayPipelineFromSliceLogic(vtkMRMLSliceLogic* sliceLogic);
158
159 static void SliceNodeModifiedCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
162
163 void UpdateSliceIntersectionDisplay(SliceIntersectionInteractionDisplayPipeline* pipeline);
164
166
168
169 double GetSliceRotationAngleRad(int eventPos[2]);
170
171 double GetLineThicknessFromMode(int lineThicknessMode);
172
175
178
181
186 double InteractionSize{ 3.0 };
187
189
190 class vtkInternal;
191 vtkInternal* Internal;
192
193 vtkSmartPointer<vtkMRMLSliceIntersectionInteractionRepresentationHelper> Helper;
194
195 private:
197 void operator=(const vtkMRMLSliceIntersectionInteractionRepresentation&) = delete;
198};
199
200#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.