Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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
25 #include "vtkMRMLAbstractLogic.h"
26 
27 #include "vtkMRMLDisplayableManagerExport.h"
28 
33 class vtkMRMLNode;
34 class vtkMRMLScene;
36 
37 class vtkRenderer;
38 class vtkRenderWindowInteractor;
39 
47 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager
48  : public vtkMRMLAbstractLogic
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
57  bool IsCreated();
58 
64  virtual void SetLightBoxRendererManagerProxy(vtkMRMLLightBoxRendererManagerProxy *);
65 
68  virtual vtkMRMLLightBoxRendererManagerProxy* GetLightBoxRendererManagerProxy();
69 
71  vtkRenderer* GetRenderer();
72 
78  vtkRenderer* GetRenderer(int idx);
79 
81  vtkRenderWindowInteractor* GetInteractor();
82 
84  vtkMRMLInteractionNode* GetInteractionNode();
85 
87  vtkMRMLSelectionNode* GetSelectionNode();
88 
91  virtual std::string GetDataProbeInfoStringForPosition(
92  double vtkNotUsed(xyz)[3]) { return ""; }
93 
97  virtual bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &distance2);
98 
101  virtual bool ProcessInteractionEvent(vtkMRMLInteractionEventData* eventData);
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 
117 protected:
118 
121 
123  vtkMRMLNode * GetMRMLDisplayableNode();
124 
127 
128  virtual void SetMRMLDisplayableManagerGroup(vtkMRMLDisplayableManagerGroup* group);
129  virtual void SetRenderer(vtkRenderer* newRenderer);
130 
136  virtual void AdditionalInitializeStep(){}
137 
143  virtual int ActiveInteractionModes();
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 
173  vtkObserverManager * GetWidgetsObserverManager()const;
174 
178  void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
179 
183  virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
184 
188  void AddMRMLDisplayableManagerEvent(int eventId);
189 
192  void SetAndObserveMRMLDisplayableNode(vtkMRMLNode * newMRMLDisplayableNode);
193 
195  vtkMRMLDisplayableManagerGroup * GetMRMLDisplayableManagerGroup();
196 
199  void CreateIfPossible();
200 
205  virtual void Create();
206 
208  virtual void RemoveMRMLObservers();
209 
212  void SetUpdateFromMRMLRequested(bool requested);
213 
216  virtual void UpdateFromMRML(){}
217 
223  void RequestRender();
224 
229  void AddInteractorStyleObservableEvent(int eventid, float priority=0.0);
230 
232  void RemoveInteractorStyleObservableEvent(int eventid);
233 
238  void AddInteractorObservableEvent(int eventid, float priority=0.0);
239 
241  void RemoveInteractorObservableEvent(int eventid);
242 
259  virtual void OnInteractorStyleEvent(int eventid);
260 
264  virtual void OnInteractorEvent(int eventid);
265 
267  void SetInteractorStyleAbortFlag(int f);
268  int GetInteractorStyleAbortFlag();
269  void InteractorStyleAbortFlagOn();
270  void InteractorStyleAbortFlagOff();
271 
273  void SetInteractorAbortFlag(int f);
274  int GetInteractorAbortFlag();
275  void InteractorAbortFlagOn();
276  void InteractorAbortFlagOff();
277 
278 private:
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 MRML logic classes.
Superclass for displayable manager classes.
void PrintSelf(ostream &os, vtkIndent indent) override
void SetRenderer(vtkRenderer *newRenderer)
Manages adding and deleting of obserevers with events.
virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
Proxy class to provide mechanisms for a displayable manager to communicate with 3rd party renderer ma...
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
virtual std::string GetDataProbeInfoStringForPosition(double vtkNotUsed(xyz)[3])
DisplayableManagerGroup is a collection of DisplayableManager.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
static vtkMRMLAbstractLogic * New()
MRML node for storing information about the active nodes in the scene.