Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLSliceLinkLogic.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8 Program: 3D Slicer
9 Module: $RCSfile: vtkMRMLSliceLinkLogic.h,v $
10 Date: $Date$
11 Version: $Revision$
12
13=========================================================================auto=*/
14
26
27#ifndef __vtkMRMLSliceLinkLogic_h
28#define __vtkMRMLSliceLinkLogic_h
29
30// MRMLLogic includes
32
33// STD includes
34#include <vector>
35
38
39class VTK_MRML_LOGIC_EXPORT vtkMRMLSliceLinkLogic : public vtkMRMLAbstractLogic
40{
41public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
47protected:
50
51 // On a change in scene, we need to manage the observations.
52 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
53
54 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
55 void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
56 void OnMRMLNodeModified(vtkMRMLNode* node) override;
59 void OnMRMLSceneStartImport() override;
60 void OnMRMLSceneEndImport() override;
61 void OnMRMLSceneStartRestore() override;
62 void OnMRMLSceneEndRestore() override;
63
64 // Used internally to control whether we are in the process of
65 // broadcasting events. PIMPL it?
69
72
75
77 bool IsOrientationMatching(vtkMRMLSliceNode* sliceNode1, vtkMRMLSliceNode* sliceNode2, double comparisonTolerance = 0.001);
78
79private:
81 void operator=(const vtkMRMLSliceLinkLogic&) = delete;
82
84 void BroadcastLastRotation(vtkMRMLSliceNode*, vtkMRMLSliceNode*);
85 void UpdateSliceNodeInteractionStatus(vtkMRMLSliceNode*);
86
87 // Counter on nested requests for Broadcasting events. Counter is
88 // used as scene restores and scene view restores issue several
89 // nested events and we want to block from the first Start to the
90 // last End event (StartBatchProcess, StartImport, StartRestore).
91 int BroadcastingEvents;
92
93 struct SliceNodeInfos
94 {
95 SliceNodeInfos(int interacting)
96 : Interacting(interacting)
97 {
98 }
99 double LastNormal[3];
100 int Interacting;
101 };
102
103 typedef std::map<std::string, SliceNodeInfos> SliceNodeStatusMap;
104 SliceNodeStatusMap SliceNodeInteractionStatus;
105};
106
107#endif
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing a slice through RAS space.
static vtkMRMLSliceLinkLogic * New()
The Usual VTK class functions.
~vtkMRMLSliceLinkLogic() override
void OnMRMLSceneEndRestore() override
void OnMRMLSceneEndBatchProcess() override
void OnMRMLSceneStartRestore() override
void BroadcastSliceNodeEvent(vtkMRMLSliceNode *sliceNode)
Broadcast a slice node to other slice nodes.
void OnMRMLNodeModified(vtkMRMLNode *node) override
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
void BroadcastSliceCompositeNodeEvent(vtkMRMLSliceCompositeNode *compositeNode)
Broadcast a slice composite node to other slice composite nodes.
void OnMRMLSceneEndImport() override
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
bool IsOrientationMatching(vtkMRMLSliceNode *sliceNode1, vtkMRMLSliceNode *sliceNode2, double comparisonTolerance=0.001)
Returns true if orientation of the slices match. Slice position and scaling is ignored.
void OnMRMLSceneStartBatchProcess() override
void OnMRMLSceneStartImport() override
void PrintSelf(ostream &os, vtkIndent indent) override
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
MRML node for storing a slice through RAS space.