Slicer  4.10
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 
32 class vtkMRMLNode;
33 class vtkMRMLScene;
35 
36 class vtkRenderer;
37 class vtkRenderWindowInteractor;
38 
46 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager
47  : public vtkMRMLAbstractLogic
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
53 
56  bool IsCreated();
57 
63  virtual void SetLightBoxRendererManagerProxy(vtkMRMLLightBoxRendererManagerProxy *);
64 
67  virtual vtkMRMLLightBoxRendererManagerProxy* GetLightBoxRendererManagerProxy();
68 
70  vtkRenderer* GetRenderer();
71 
77  vtkRenderer* GetRenderer(int idx);
78 
80  vtkRenderWindowInteractor* GetInteractor();
81 
83  vtkMRMLInteractionNode* GetInteractionNode();
84 
86  vtkMRMLSelectionNode* GetSelectionNode();
87 
90  virtual std::string GetDataProbeInfoStringForPosition(
91  double vtkNotUsed(xyz)[3]) { return ""; }
92 
93 protected:
94 
97 
99  vtkMRMLNode * GetMRMLDisplayableNode();
100 
103 
104  virtual void SetMRMLDisplayableManagerGroup(vtkMRMLDisplayableManagerGroup* group);
105  virtual void SetRenderer(vtkRenderer* newRenderer);
106 
112  virtual void AdditionalInitializeStep(){}
113 
119  virtual int ActiveInteractionModes();
120 
121  virtual void ProcessMRMLNodesEvents(vtkObject* caller,
122  unsigned long event,
123  void * callData) VTK_OVERRIDE;
124 
137  virtual void ProcessWidgetsEvents(vtkObject* caller,
138  unsigned long event,
139  void * callData);
140 
142  static void WidgetsCallback(vtkObject *caller, unsigned long eid,
143  void *clientData, void *callData);
144 
146  vtkCallbackCommand * GetWidgetsCallbackCommand();
147 
149  vtkObserverManager * GetWidgetsObserverManager()const;
150 
154  virtual void SetMRMLSceneInternal(vtkMRMLScene* newScene) VTK_OVERRIDE;
155 
159  virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
160 
164  void AddMRMLDisplayableManagerEvent(int eventId);
165 
168  void SetAndObserveMRMLDisplayableNode(vtkMRMLNode * newMRMLDisplayableNode);
169 
171  vtkMRMLDisplayableManagerGroup * GetMRMLDisplayableManagerGroup();
172 
175  void CreateIfPossible();
176 
181  virtual void Create();
182 
184  virtual void RemoveMRMLObservers();
185 
188  void SetUpdateFromMRMLRequested(bool requested);
189 
192  virtual void UpdateFromMRML(){}
193 
199  void RequestRender();
200 
205  void AddInteractorStyleObservableEvent(int eventid, float priority=0.0);
206 
208  void RemoveInteractorStyleObservableEvent(int eventid);
209 
214  void AddInteractorObservableEvent(int eventid, float priority=0.0);
215 
217  void RemoveInteractorObservableEvent(int eventid);
218 
235  virtual void OnInteractorStyleEvent(int eventid);
236 
240  virtual void OnInteractorEvent(int eventid);
241 
243  void SetInteractorStyleAbortFlag(int f);
244  int GetInteractorStyleAbortFlag();
245  void InteractorStyleAbortFlagOn();
246  void InteractorStyleAbortFlagOff();
247 
249  void SetInteractorAbortFlag(int f);
250  int GetInteractorAbortFlag();
251  void InteractorAbortFlagOn();
252  void InteractorAbortFlagOff();
253 
254 private:
255 
257  void operator=(const vtkMRMLAbstractDisplayableManager&); // Not implemented
258 
259  class vtkInternal;
260  vtkInternal* Internal;
261  friend class vtkInternal; // For access from the callback function
262 };
263 
264 #endif
Superclass for MRML logic classes.
Superclass for displayable manager classes.
void SetRenderer(vtkRenderer *newRenderer)
Manages adding and deleting of obserevers with events.
virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
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:138
static vtkMRMLAbstractLogic * New()
MRML node for storing information about the active nodes in the scene.