Rendering/vtkInteractorObserver.h Source File

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

# 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 =========================================================================*/
    00059 #ifndef __vtkInteractorObserver_h
    00060 #define __vtkInteractorObserver_h
    00061
    00062 #include "vtkObject.h"
    00063
    00064 class vtkRenderWindowInteractor;
    00065 class vtkRenderer;
    00066 class vtkCallbackCommand;
    00067
    00068 class VTK_RENDERING_EXPORT vtkInteractorObserver : public vtkObject
    00069 {
    00070 public:
    00071   vtkTypeRevisionMacro(vtkInteractorObserver,vtkObject);
    00072   void PrintSelf(ostream& os, vtkIndent indent);
    00073
    00075
    00081   virtual void SetEnabled(int) = 0;
    00082   int GetEnabled() {return this->Enabled;}
    00083   void EnabledOn() {this->SetEnabled(1);}
    00084   void EnabledOff() {this->SetEnabled(0);}
    00085   void On() {this->SetEnabled(1);}
    00086   void Off() {this->SetEnabled(0);}
    00088
    00090
    00095   virtual void SetInteractor(vtkRenderWindowInteractor* iren);
    00096   vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
    00098
    00100
    00108   vtkSetClampMacro(Priority,float,0.0f,1.0f);
    00109   vtkGetMacro(Priority,float);
    00111
    00113
    00117   vtkSetMacro(KeyPressActivation,int);
    00118   vtkGetMacro(KeyPressActivation,int);
    00119   vtkBooleanMacro(KeyPressActivation,int);
    00121
    00123
    00129   vtkSetMacro(KeyPressActivationValue,char);
    00130   vtkGetMacro(KeyPressActivationValue,char);
    00132
    00134
    00139   virtual void SetCurrentRenderer(vtkRenderer*);
    00140   vtkGetObjectMacro(CurrentRenderer,vtkRenderer);
    00142
    00143   // Sets up the keypress-i event.
    00144   virtual void OnChar();
    00145
    00146 protected:
    00147   vtkInteractorObserver();
    00148   ~vtkInteractorObserver();
    00149
    00151
    00154   virtual void StartInteraction();
    00155   virtual void EndInteraction();
    00157
    00159
    00161   static void ProcessEvents(vtkObject* object,
    00162                             unsigned long event,
    00163                             void* clientdata,
    00164                             void* calldata);
    00166
    00168
    00169   void ComputeDisplayToWorld(double x, double y, double z,
    00170                              double worldPt[4]);
    00171   void ComputeDisplayToWorld(double x, double y, double z,
    00172                              float worldPt[4]);
    00173   void ComputeWorldToDisplay(double x, double y, double z,
    00174                              double displayPt[3]);
    00175   void ComputeWorldToDisplay(double x, double y, double z,
    00176                              float displayPt[3]);
    00178
    00179   // The state of the widget, whether on or off (observing events or not)
    00180   int Enabled;
    00181
    00182   // Used to process events
    00183   vtkCallbackCommand* EventCallbackCommand; //subclasses use one
    00184   vtkCallbackCommand* KeyPressCallbackCommand; //listens to key activation
    00185
    00186   // Priority at which events are processed
    00187   float Priority;
    00188
    00189   // Keypress activation controls
    00190   int KeyPressActivation;
    00191   char KeyPressActivationValue;
    00192
    00193   // Used to associate observers with the interactor
    00194   vtkRenderWindowInteractor *Interactor;
    00195
    00196   // Internal ivars for processing events
    00197   vtkRenderer *CurrentRenderer;
    00198
    00199 private:
    00200   vtkInteractorObserver(const vtkInteractorObserver&);  // Not implemented.
    00201   void operator=(const vtkInteractorObserver&);  // Not implemented.
    00202
    00203 };
    00204
    00205 #endif