00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkObserverMediator.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00030 #ifndef __vtkObserverMediator_h 00031 #define __vtkObserverMediator_h 00032 00033 #include "vtkObject.h" 00034 00035 class vtkRenderWindowInteractor; 00036 class vtkInteractorObserver; 00037 class vtkObserverMap; 00038 00039 00040 class VTK_RENDERING_EXPORT vtkObserverMediator : public vtkObject 00041 { 00042 public: 00044 static vtkObserverMediator *New(); 00045 00047 00048 vtkTypeRevisionMacro(vtkObserverMediator,vtkObject); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00055 void SetInteractor(vtkRenderWindowInteractor* iren); 00056 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor); 00058 00063 int RequestCursorShape(vtkInteractorObserver*, int cursorShape); 00064 00066 void RemoveAllCursorShapeRequests(vtkInteractorObserver*); 00067 00068 protected: 00069 vtkObserverMediator(); 00070 ~vtkObserverMediator(); 00071 00072 // The render window whose cursor we are controlling 00073 vtkRenderWindowInteractor *Interactor; 00074 00075 // A map whose key is the observer*, and whose data value is a cursor 00076 // request. Note that a special compare function is used to sort the 00077 // widgets based on the observer's priority. 00078 vtkObserverMap *ObserverMap; //given a widget*, return its data 00079 00080 // The current observer and cursor shape 00081 vtkInteractorObserver *CurrentObserver; 00082 int CurrentCursorShape; 00083 00084 private: 00085 vtkObserverMediator(const vtkObserverMediator&); //Not implemented 00086 void operator=(const vtkObserverMediator&); //Not implemented 00087 }; 00088 00089 #endif