Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAbstractDisplayableManager.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
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 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __vtkMRMLAbstractDisplayableManager_h
22#define __vtkMRMLAbstractDisplayableManager_h
23
24// MRMLLogic includes
26
27#include "vtkMRMLDisplayableManagerExport.h"
28
33class vtkMRMLNode;
34class vtkMRMLScene;
35
36class vtkRenderer;
37class vtkRenderWindowInteractor;
38
46class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager : public vtkMRMLAbstractLogic
47{
48public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
52
55 bool IsCreated();
56
58 vtkRenderer* GetRenderer();
59
61 vtkRenderer* GetRenderer(int idx);
62
64 vtkRenderWindowInteractor* GetInteractor();
65
68
71
74 virtual std::string GetDataProbeInfoStringForPosition(double vtkNotUsed(xyz)[3]) { return ""; }
75
79 virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2);
80
84
86 virtual void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData* eventData);
87
89 virtual bool GetGrabFocus();
90
92 virtual bool GetInteractive();
93
95 virtual int GetMouseCursor();
96
97 void SetMouseCursor(int cursor);
98
99protected:
102
105
108
110 virtual void SetRenderer(vtkRenderer* newRenderer);
111
117 virtual void AdditionalInitializeStep() {}
118
125
126 void ProcessMRMLNodesEvents(vtkObject* caller, unsigned long event, void* callData) override;
127
140 virtual void ProcessWidgetsEvents(vtkObject* caller, unsigned long event, void* callData);
141
143 static void WidgetsCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
144
146 vtkCallbackCommand* GetWidgetsCallbackCommand();
147
150
154 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
155
159 virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
160
165
168 void SetAndObserveMRMLDisplayableNode(vtkMRMLNode* newMRMLDisplayableNode);
169
172
176
181 virtual void Create();
182
184 virtual void RemoveMRMLObservers();
185
188 void SetUpdateFromMRMLRequested(bool requested);
189
192 virtual void UpdateFromMRML() {}
193
200
205 void AddInteractorStyleObservableEvent(int eventid, float priority = 0.0);
206
209
214 void AddInteractorObservableEvent(int eventid, float priority = 0.0);
215
218
235 virtual void OnInteractorStyleEvent(int eventid);
236
240 virtual void OnInteractorEvent(int eventid);
241
242private:
244 void operator=(const vtkMRMLAbstractDisplayableManager&) = delete;
245
246 class vtkInternal;
247 vtkInternal* Internal;
248 friend class vtkInternal; // For access from the callback function
249};
250
251#endif
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLNode * GetMRMLDisplayableNode()
Get MRML Displayable Node.
virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2)
virtual bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData)
virtual void SetMRMLDisplayableManagerGroup(vtkMRMLDisplayableManagerGroup *group)
friend class vtkMRMLDisplayableManagerGroup
Access to SetRenderer, SetMRMLDisplayableNode and CreateIfPossible methods.
void AddInteractorStyleObservableEvent(int eventid, float priority=0.0)
virtual void OnInteractorStyleEvent(int eventid)
virtual bool GetInteractive()
Displayable manager can indicate that the window is in interactive mode (faster updates).
virtual std::string GetDataProbeInfoStringForPosition(double vtkNotUsed(xyz)[3])
virtual void RemoveMRMLObservers()
Remove MRML observers.
void SetAndObserveMRMLDisplayableNode(vtkMRMLNode *newMRMLDisplayableNode)
vtkMRMLSelectionNode * GetSelectionNode()
Convenient method to get the current SelectionNode.
vtkMRMLDisplayableManagerGroup * GetMRMLDisplayableManagerGroup()
Get associated DisplayableManager group.
void AddMRMLDisplayableManagerEvent(int eventId)
Allow to specify additional events that the DisplayableNode will observe.
vtkRenderer * GetRenderer(int idx)
vtkRenderer * GetRenderer()
Get the default renderer for this displayable manager.
vtkObserverManager * GetWidgetsObserverManager() const
Get widget observerManager.
vtkMRMLInteractionNode * GetInteractionNode()
Convenient method to get the current InteractionNode.
void SetUpdateFromMRMLRequested(bool requested)
virtual int GetMouseCursor()
Displayable manager returns ID of the mouse cursor shape that should be displayed.
void RemoveInteractorObservableEvent(int eventid)
virtual void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData *eventData)
Set if the widget gets/loses focus (interaction events are processed by this displayable manager).
vtkRenderWindowInteractor * GetInteractor()
Convenient method to get the WindowInteractor associated with the Renderer.
virtual void ProcessWidgetsEvents(vtkObject *caller, unsigned long event, void *callData)
void RemoveInteractorStyleObservableEvent(int eventid)
static void WidgetsCallback(vtkObject *caller, unsigned long eid, void *clientData, void *callData)
WidgetsCallback is a static function to relay modified events from the vtk widgets.
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
vtkCallbackCommand * GetWidgetsCallbackCommand()
Get vtkWidget callbackCommand.
virtual void OnInteractorEvent(int eventid)
virtual bool GetGrabFocus()
Displayable manager can indicate that it would like to get all events (even when mouse pointer is out...
void AddInteractorObservableEvent(int eventid, float priority=0.0)
virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject *caller)
static vtkMRMLAbstractDisplayableManager * New()
virtual void SetRenderer(vtkRenderer *newRenderer)
DisplayableManagerGroup is a collection of DisplayableManager.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing information about the active nodes in the scene.
Manages adding and deleting of observers with events.