Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLViewLogic.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Kapteyn Astronomical Institute
4 University of Groningen, Groningen, Netherlands. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Davide Punzo, Kapteyn Astronomical Institute,
16 and was supported through the European Research Council grant nr. 291531.
17
18==============================================================================*/
19
20#ifndef __vtkMRMLViewLogic_h
21#define __vtkMRMLViewLogic_h
22
23// MRMLLogic includes
25
26// VTK includes
27#include <vtkObject.h>
28#include <vtkWeakPointer.h>
29
30// STD includes
31#include <vector>
32#include <deque>
33
38class vtkMRMLViewNode;
41
42class vtkAlgorithmOutput;
43class vtkCollection;
44class vtkImageBlend;
45class vtkTransform;
46class vtkImageData;
47class vtkImageReslice;
48class vtkTransform;
49
50struct SliceLayerInfo;
51struct BlendPipeline;
52
59class VTK_MRML_LOGIC_EXPORT vtkMRMLViewLogic : public vtkMRMLAbstractLogic
60{
61public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
68 virtual void SetName(const char* name);
69 virtual const char* GetName() const;
70
72 vtkGetObjectMacro(ViewNode, vtkMRMLViewNode);
73
75 vtkGetObjectMacro(CameraNode, vtkMRMLCameraNode);
76
80 void StartCameraNodeInteraction(unsigned int parameters);
81
84
88 void StartViewNodeInteraction(unsigned int parameters);
89
92
94 vtkMRMLViewNode* AddViewNode(const char* layoutName);
95
98 static vtkMRMLViewNode* GetViewNode(vtkMRMLScene* scene, const char* layoutName);
99
102 static vtkMRMLCameraNode* GetCameraNode(vtkMRMLScene* scene, const char* layoutName);
103
106 vtkGetObjectMacro(DisplayableManagerGroup, vtkObject);
107 void SetDisplayableManagerGroup(vtkObject* obj);
109
110protected:
113
114 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
115 void SetViewNode(vtkMRMLViewNode* newViewNode);
116 void SetCameraNode(vtkMRMLCameraNode* newCameraNode);
117
118 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
120 void UpdateFromMRMLScene() override;
121
123
124 // View and camera nodes are looked up from the scene based on the layout name.
125 std::string Name;
126
130
131 // Weak reference to the view's displayable manager group.
132 //
133 // Stored as vtkObject to keep MRMLLogic independent of
134 // MRMLDisplayableManager headers. The expected dynamic type is
135 // vtkMRMLDisplayableManagerGroup.
136 //
137 // Set by the layout factories when the view widget is created, and used by
138 // vtkSlicerApplicationLogic::GetViewDisplayableManagerByClassName() to
139 // resolve managers without Qt. This works because vtkSlicerApplicationLogic
140 // lives in SlicerBaseLogic, which can depend on MRMLDisplayableManager.
141 //
142 // Ownership: the group is owned by the view/widget; this logic holds only a
143 // weak pointer. May be nullptr (e.g., headless or before view creation).
144 // Type is validated in SetDisplayableManagerGroup().
145 vtkWeakPointer<vtkObject> DisplayableManagerGroup;
146
147private:
148 vtkMRMLViewLogic(const vtkMRMLViewLogic&) = delete;
149 void operator=(const vtkMRMLViewLogic&) = delete;
150};
151
152#endif
MRML node to represent camera node.
Abstract class that contains graphical display properties for displayable nodes.
MRML node for representing a linear transformation.
MRML node to represent a display property of 3D surface model.
MRML node to represent a 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
void EndCameraNodeInteraction()
Indicate an interaction with the slice node has been completed.
static vtkMRMLCameraNode * GetCameraNode(vtkMRMLScene *scene, const char *layoutName)
vtkWeakPointer< vtkObject > DisplayableManagerGroup
virtual const char * GetName() const
void SetDisplayableManagerGroup(vtkObject *obj)
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLViewNode * AddViewNode(const char *layoutName)
Convenience function for adding a view node and setting it in this logic.
virtual void SetName(const char *name)
Set/Get layout name. This is used for finding the camera and view node in the scene.
vtkMRMLCameraNode * CameraNode
void SetViewNode(vtkMRMLViewNode *newViewNode)
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
void StartViewNodeInteraction(unsigned int parameters)
void EndViewNodeInteraction()
Indicate an interaction with the view node has been completed.
void StartCameraNodeInteraction(unsigned int parameters)
~vtkMRMLViewLogic() override
void UpdateMRMLNodes()
static vtkMRMLViewNode * GetViewNode(vtkMRMLScene *scene, const char *layoutName)
void SetCameraNode(vtkMRMLCameraNode *newCameraNode)
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
vtkMRMLViewNode * ViewNode
void UpdateFromMRMLScene() override
static vtkMRMLViewLogic * New()
The Usual VTK class functions.
MRML node to represent a 3D view.
MRML node for representing a volume (image stack).