Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Rendering/vtkInteractorObserver.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkInteractorObserver.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00047 #ifndef __vtkInteractorObserver_h 00048 #define __vtkInteractorObserver_h 00049 00050 #include "vtkObject.h" 00051 00052 class vtkRenderWindowInteractor; 00053 class vtkRenderer; 00054 class vtkCallbackCommand; 00055 00056 class VTK_RENDERING_EXPORT vtkInteractorObserver : public vtkObject 00057 { 00058 public: 00059 vtkTypeRevisionMacro(vtkInteractorObserver,vtkObject); 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 00069 virtual void SetEnabled(int) = 0; 00070 int GetEnabled() {return this->Enabled;} 00071 void EnabledOn() {this->SetEnabled(1);} 00072 void EnabledOff() {this->SetEnabled(0);} 00073 void On() {this->SetEnabled(1);} 00074 void Off() {this->SetEnabled(0);} 00076 00078 00083 virtual void SetInteractor(vtkRenderWindowInteractor* iren); 00084 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor); 00086 00088 00096 vtkSetClampMacro(Priority,float,0.0f,1.0f); 00097 vtkGetMacro(Priority,float); 00099 00101 00105 vtkSetMacro(KeyPressActivation,int); 00106 vtkGetMacro(KeyPressActivation,int); 00107 vtkBooleanMacro(KeyPressActivation,int); 00109 00111 00117 vtkSetMacro(KeyPressActivationValue,char); 00118 vtkGetMacro(KeyPressActivationValue,char); 00120 00122 00127 virtual void SetCurrentRenderer(vtkRenderer*); 00128 vtkGetObjectMacro(CurrentRenderer,vtkRenderer); 00130 00131 // Sets up the keypress-i event. 00132 virtual void OnChar(); 00133 00134 protected: 00135 vtkInteractorObserver(); 00136 ~vtkInteractorObserver(); 00137 00139 00142 virtual void StartInteraction(); 00143 virtual void EndInteraction(); 00145 00147 00149 static void ProcessEvents(vtkObject* object, 00150 unsigned long event, 00151 void* clientdata, 00152 void* calldata); 00154 00156 00157 void ComputeDisplayToWorld(double x, double y, double z, 00158 double worldPt[4]); 00159 void ComputeDisplayToWorld(double x, double y, double z, 00160 float worldPt[4]); 00161 void ComputeWorldToDisplay(double x, double y, double z, 00162 double displayPt[3]); 00163 void ComputeWorldToDisplay(double x, double y, double z, 00164 float displayPt[3]); 00166 00167 // The state of the widget, whether on or off (observing events or not) 00168 int Enabled; 00169 00170 // Used to process events 00171 vtkCallbackCommand* EventCallbackCommand; //subclasses use one 00172 vtkCallbackCommand* KeyPressCallbackCommand; //listens to key activation 00173 00174 // Priority at which events are processed 00175 float Priority; 00176 00177 // Keypress activation controls 00178 int KeyPressActivation; 00179 char KeyPressActivationValue; 00180 00181 // Used to associate observers with the interactor 00182 vtkRenderWindowInteractor *Interactor; 00183 00184 // Internal ivars for processing events 00185 vtkRenderer *CurrentRenderer; 00186 00187 private: 00188 vtkInteractorObserver(const vtkInteractorObserver&); // Not implemented. 00189 void operator=(const vtkInteractorObserver&); // Not implemented. 00190 00191 }; 00192 00193 #endif