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;
36
37class vtkRenderer;
38class vtkRenderWindowInteractor;
39
47class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager : public vtkMRMLAbstractLogic
48{
49public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
53
56 bool IsCreated();
57
64
68
70 vtkRenderer* GetRenderer();
71
77 vtkRenderer* GetRenderer(int idx);
78
80 vtkRenderWindowInteractor* GetInteractor();
81
84
87
90 virtual std::string GetDataProbeInfoStringForPosition(double vtkNotUsed(xyz)[3]) { return ""; }
91
95 virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2);
96
100
102 virtual void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData* eventData);
103
105 virtual bool GetGrabFocus();
106
108 virtual bool GetInteractive();
109
111 virtual int GetMouseCursor();
112
113 void SetMouseCursor(int cursor);
114
115protected:
118
121
124
126 virtual void SetRenderer(vtkRenderer* newRenderer);
127
133 virtual void AdditionalInitializeStep() {}
134
141
142 void ProcessMRMLNodesEvents(vtkObject* caller, unsigned long event, void* callData) override;
143
156 virtual void ProcessWidgetsEvents(vtkObject* caller, unsigned long event, void* callData);
157
159 static void WidgetsCallback(vtkObject* caller, unsigned long eid, void* clientData, void* callData);
160
162 vtkCallbackCommand* GetWidgetsCallbackCommand();
163
166
170 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
171
175 virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
176
181
184 void SetAndObserveMRMLDisplayableNode(vtkMRMLNode* newMRMLDisplayableNode);
185
188
192
197 virtual void Create();
198
200 virtual void RemoveMRMLObservers();
201
204 void SetUpdateFromMRMLRequested(bool requested);
205
208 virtual void UpdateFromMRML() {}
209
216
221 void AddInteractorStyleObservableEvent(int eventid, float priority = 0.0);
222
225
230 void AddInteractorObservableEvent(int eventid, float priority = 0.0);
231
234
251 virtual void OnInteractorStyleEvent(int eventid);
252
256 virtual void OnInteractorEvent(int eventid);
257
258private:
260 void operator=(const vtkMRMLAbstractDisplayableManager&) = delete;
261
262 class vtkInternal;
263 vtkInternal* Internal;
264 friend class vtkInternal; // For access from the callback function
265};
266
267#endif
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)
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.
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.
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.
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.