|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 /*============================================================================== 00002 00003 Program: 3D Slicer 00004 00005 Copyright (c) Kitware Inc. 00006 00007 See COPYRIGHT.txt 00008 or http://www.slicer.org/copyright/copyright.txt for details. 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 00016 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc. 00017 and was partially funded by NIH grant 3P41RR013218-12S1 00018 00019 ==============================================================================*/ 00020 00021 #ifndef __vtkMRMLAbstractDisplayableManager_h 00022 #define __vtkMRMLAbstractDisplayableManager_h 00023 00024 // MRMLLogic includes 00025 #include "vtkMRMLAbstractLogic.h" 00026 00027 #include "vtkMRMLDisplayableManagerWin32Header.h" 00028 00029 class vtkMRMLInteractionNode; 00030 class vtkMRMLSelectionNode; 00031 class vtkMRMLDisplayableManagerGroup; 00032 class vtkMRMLNode; 00033 class vtkMRMLScene; 00034 class vtkMRMLLightBoxRendererManagerProxy; 00035 00036 class vtkRenderer; 00037 class vtkRenderWindowInteractor; 00038 00046 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLAbstractDisplayableManager 00047 : public vtkMRMLAbstractLogic 00048 { 00049 public: 00050 static vtkMRMLAbstractDisplayableManager *New(); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 vtkTypeRevisionMacro(vtkMRMLAbstractDisplayableManager, vtkMRMLAbstractLogic); 00053 00056 bool IsCreated(); 00057 00063 virtual void SetLightBoxRendererManagerProxy(vtkMRMLLightBoxRendererManagerProxy *); 00064 00067 virtual vtkMRMLLightBoxRendererManagerProxy* GetLightBoxRendererManagerProxy(); 00068 00070 vtkRenderer* GetRenderer(); 00071 00077 vtkRenderer* GetRenderer(int idx); 00078 00080 vtkRenderWindowInteractor* GetInteractor(); 00081 00083 vtkMRMLInteractionNode* GetInteractionNode(); 00084 00086 vtkMRMLSelectionNode* GetSelectionNode(); 00087 00088 protected: 00089 00090 vtkMRMLAbstractDisplayableManager(); 00091 virtual ~vtkMRMLAbstractDisplayableManager(); 00092 00094 vtkMRMLNode * GetMRMLDisplayableNode(); 00095 00097 friend class vtkMRMLDisplayableManagerGroup; 00098 00099 virtual void SetMRMLDisplayableManagerGroup(vtkMRMLDisplayableManagerGroup* group); 00100 virtual void SetRenderer(vtkRenderer* newRenderer); 00101 00107 virtual void AdditionalInitializeStep(){} 00108 00114 virtual int ActiveInteractionModes(); 00115 00116 virtual void ProcessMRMLNodesEvents(vtkObject* caller, 00117 unsigned long event, 00118 void * callData); 00119 00132 virtual void ProcessWidgetsEvents(vtkObject* caller, 00133 unsigned long event, 00134 void * callData); 00135 00137 static void WidgetsCallback(vtkObject *caller, unsigned long eid, 00138 void *clientData, void *callData); 00139 00141 vtkCallbackCommand * GetWidgetsCallbackCommand(); 00142 00144 vtkObserverManager * GetWidgetsObserverManager()const; 00145 00149 virtual void SetMRMLSceneInternal(vtkMRMLScene* newScene); 00150 00154 virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller); 00155 00159 void AddMRMLDisplayableManagerEvent(int eventId); 00160 00163 void SetAndObserveMRMLDisplayableNode(vtkMRMLNode * newMRMLDisplayableNode); 00164 00166 vtkMRMLDisplayableManagerGroup * GetMRMLDisplayableManagerGroup(); 00167 00170 void CreateIfPossible(); 00171 00176 virtual void Create(); 00177 00179 virtual void RemoveMRMLObservers(); 00180 00183 void SetUpdateFromMRMLRequested(bool requested); 00184 00187 virtual void UpdateFromMRML(){} 00188 00194 void RequestRender(); 00195 00200 void AddInteractorStyleObservableEvent(int eventid, float priority=0.0); 00201 00203 void RemoveInteractorStyleObservableEvent(int eventid); 00204 00209 void AddInteractorObservableEvent(int eventid, float priority=0.0); 00210 00212 void RemoveInteractorObservableEvent(int eventid); 00213 00230 virtual void OnInteractorStyleEvent(int eventid); 00231 00235 virtual void OnInteractorEvent(int eventid); 00236 00238 void SetInteractorStyleAbortFlag(int f); 00239 int GetInteractorStyleAbortFlag(); 00240 void InteractorStyleAbortFlagOn(); 00241 void InteractorStyleAbortFlagOff(); 00242 00244 void SetInteractorAbortFlag(int f); 00245 int GetInteractorAbortFlag(); 00246 void InteractorAbortFlagOn(); 00247 void InteractorAbortFlagOff(); 00248 00249 private: 00250 00251 vtkMRMLAbstractDisplayableManager(const vtkMRMLAbstractDisplayableManager&); // Not implemented 00252 void operator=(const vtkMRMLAbstractDisplayableManager&); // Not implemented 00253 00254 class vtkInternal; 00255 vtkInternal* Internal; 00256 friend class vtkInternal; // For access from the callback function 00257 }; 00258 00259 #endif
1.7.4