Slicer 5.4
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;
36
37class vtkRenderer;
38class vtkRenderWindowInteractor;
39
47class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
54
57 bool IsCreated();
58
65
69
71 vtkRenderer* GetRenderer();
72
78 vtkRenderer* GetRenderer(int idx);
79
81 vtkRenderWindowInteractor* GetInteractor();
82
85
88
92 double vtkNotUsed(xyz)[3]) { return ""; }
93
97 virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &distance2);
98
102
104 virtual void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData* eventData);
105
107 virtual bool GetGrabFocus();
108
110 virtual bool GetInteractive();
111
113 virtual int GetMouseCursor();
114
115 void SetMouseCursor(int cursor);
116
117protected:
118
121
124
127
129 virtual void SetRenderer(vtkRenderer* newRenderer);
130
137
144
145 void ProcessMRMLNodesEvents(vtkObject* caller,
146 unsigned long event,
147 void * callData) override;
148
161 virtual void ProcessWidgetsEvents(vtkObject* caller,
162 unsigned long event,
163 void * callData);
164
166 static void WidgetsCallback(vtkObject *caller, unsigned long eid,
167 void *clientData, void *callData);
168
170 vtkCallbackCommand * GetWidgetsCallbackCommand();
171
174
178 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
179
183 virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
184
189
192 void SetAndObserveMRMLDisplayableNode(vtkMRMLNode * newMRMLDisplayableNode);
193
196
200
205 virtual void Create();
206
208 virtual void RemoveMRMLObservers();
209
212 void SetUpdateFromMRMLRequested(bool requested);
213
216 virtual void UpdateFromMRML(){}
217
224
229 void AddInteractorStyleObservableEvent(int eventid, float priority=0.0);
230
233
238 void AddInteractorObservableEvent(int eventid, float priority=0.0);
239
242
259 virtual void OnInteractorStyleEvent(int eventid);
260
264 virtual void OnInteractorEvent(int eventid);
265
271
277
278private:
279
281 void operator=(const vtkMRMLAbstractDisplayableManager&) = delete;
282
283 class vtkInternal;
284 vtkInternal* Internal;
285 friend class vtkInternal; // For access from the callback function
286};
287
288#endif
Superclass for displayable manager classes.
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
virtual vtkMRMLLightBoxRendererManagerProxy * GetLightBoxRendererManagerProxy()
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)
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.
virtual void SetLightBoxRendererManagerProxy(vtkMRMLLightBoxRendererManagerProxy *)
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.
void SetInteractorAbortFlag(int f)
Set the Abort flag on the Interactor event callback.
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
void SetInteractorStyleAbortFlag(int f)
Set the Abort flag on the InteractorStyle event callback.
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)
Superclass for MRML logic classes.
DisplayableManagerGroup is a collection of DisplayableManager.
Proxy class to provide mechanisms for a displayable manager to communicate with 3rd party renderer ma...
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.