forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vtkMRMLViewLinkLogic.h
75 lines (56 loc) · 2.63 KB
/
vtkMRMLViewLinkLogic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*==============================================================================
Copyright (c) Kapteyn Astronomical Institute
University of Groningen, Groningen, Netherlands. All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Davide Punzo, Kapteyn Astronomical Institute,
and was supported through the European Research Council grant nr. 291531.
==============================================================================*/
/// vtkMRMLViewLinkLogic - slicer logic class for linked view manipulation
///
/// This class manages the logic associated with linking the controls
/// of multiple view and camera nodes. It listens to the
/// MRML scene for new view and camera nodes and observes
/// these nodes for ModifiedEvents. When notified of a ModifiedEvent
/// on a view or camera node, this logic class will
/// propagate state to other view and camera nodes. A
/// critical component of the design is that view and camera
/// nodes "know" when they are be changed interactively verses when
/// their state is being updated programmatically.
#ifndef __vtkMRMLViewLinkLogic_h
#define __vtkMRMLViewLinkLogic_h
// MRMLLogic includes
#include "vtkMRMLAbstractLogic.h"
// STD includes
#include <vector>
class vtkMRMLViewNode;
class vtkMRMLCameraNode;
class VTK_MRML_LOGIC_EXPORT vtkMRMLViewLinkLogic : public vtkMRMLAbstractLogic
{
public:
/// The Usual VTK class functions
static vtkMRMLViewLinkLogic *New();
vtkTypeMacro(vtkMRMLViewLinkLogic,vtkMRMLAbstractLogic);
void PrintSelf(ostream& os, vtkIndent indent) override;
protected:
vtkMRMLViewLinkLogic();
~vtkMRMLViewLinkLogic() override;
// On a change in scene, we need to manage the observations.
void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
void OnMRMLNodeModified(vtkMRMLNode* node) override;
/// Broadcast a view node to other view nodes.
void BroadcastViewNodeEvent(vtkMRMLViewNode* viewNode);
/// Broadcast a camera node to other camera nodes
void BroadcastCameraNodeEvent(vtkMRMLCameraNode* cameraNode);
private:
vtkMRMLViewLinkLogic(const vtkMRMLViewLinkLogic&) = delete;
void operator=(const vtkMRMLViewLinkLogic&) = delete;
};
#endif