Slicer 5.8
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:
42
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
48protected:
49
52
53 // On a change in scene, we need to manage the observations.
54 void SetMRMLSceneInternal(vtkMRMLScene * newScene) override;
55
56 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
57 void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
58 void OnMRMLNodeModified(vtkMRMLNode* node) override;
61 void OnMRMLSceneStartImport() override;
62 void OnMRMLSceneEndImport() override;
63 void OnMRMLSceneStartRestore() override;
64 void OnMRMLSceneEndRestore() override;
65
66 // Used internally to control whether we are in the process of
67 // broadcasting events. PIMPL it?
71
74
77
79 bool IsOrientationMatching(vtkMRMLSliceNode *sliceNode1, vtkMRMLSliceNode *sliceNode2, double comparisonTolerance = 0.001);
80
81private:
82
84 void operator=(const vtkMRMLSliceLinkLogic&) = delete;
85
87 void BroadcastLastRotation(vtkMRMLSliceNode*, vtkMRMLSliceNode*);
88 void UpdateSliceNodeInteractionStatus(vtkMRMLSliceNode*);
89
90 // Counter on nested requests for Broadcasting events. Counter is
91 // used as scene restores and scene view restores issue several
92 // nested events and we want to block from the first Start to the
93 // last End event (StartBatchProcess, StartImport, StartRestore).
94 int BroadcastingEvents;
95
96 struct SliceNodeInfos
97 {
98 SliceNodeInfos(int interacting) : Interacting(interacting) {}
99 double LastNormal[3];
100 int Interacting;
101 };
102
103 typedef std::map<std::string, SliceNodeInfos> SliceNodeStatusMap;
104 SliceNodeStatusMap SliceNodeInteractionStatus;
105
106};
107
108#endif
Superclass for MRML logic classes.
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.