VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkContextInteractorStyle.h 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 =========================================================================*/ 00027 #ifndef __vtkContextInteractorStyle_h 00028 #define __vtkContextInteractorStyle_h 00029 00030 #include "vtkInteractorStyle.h" 00031 #include "vtkNew.h" // For ivars 00032 00033 class vtkContextMouseEvent; 00034 class vtkContextScene; 00035 00036 class VTK_CHARTS_EXPORT vtkContextInteractorStyle : public vtkInteractorStyle 00037 { 00038 public: 00039 static vtkContextInteractorStyle *New(); 00040 vtkTypeMacro(vtkContextInteractorStyle, vtkInteractorStyle); 00041 void PrintSelf(ostream& os, vtkIndent indent); 00042 00047 void SetScene(vtkContextScene* scene); 00048 00050 00051 vtkGetObjectMacro(Scene, vtkContextScene); 00053 00055 virtual void OnSceneModified(); 00056 00059 virtual void OnMouseMove(); 00060 00063 virtual void OnLeftButtonDown(); 00064 00067 virtual void OnLeftButtonUp(); 00068 00071 virtual void OnMiddleButtonDown(); 00072 00075 virtual void OnMiddleButtonUp(); 00076 00079 virtual void OnRightButtonDown(); 00080 00083 virtual void OnRightButtonUp(); 00084 00087 virtual void OnMouseWheelForward(); 00088 00091 virtual void OnMouseWheelBackward(); 00092 00095 virtual void OnSelection(unsigned int rect[5]); 00096 00098 virtual void OnChar(); 00099 00101 virtual void OnKeyPress(); 00102 00104 virtual void OnKeyRelease(); 00105 00106 protected: 00107 vtkContextInteractorStyle(); 00108 ~vtkContextInteractorStyle(); 00109 00110 static void ProcessSceneEvents(vtkObject* object, unsigned long event, 00111 void* clientdata, void* calldata); 00112 00113 static void ProcessInteractorEvents(vtkObject* object, unsigned long event, 00114 void* clientdata, void* calldata); 00115 00116 void RenderNow(); 00117 00121 void BeginProcessingEvent(); 00122 00126 void EndProcessingEvent(); 00127 00128 vtkContextScene* Scene; 00129 vtkNew<vtkCallbackCommand> SceneCallbackCommand; 00130 vtkNew<vtkCallbackCommand> InteractorCallbackCommand; 00131 int ProcessingEvents; 00132 unsigned long int LastSceneRepaintMTime; 00133 00134 unsigned long int TimerId; 00135 bool TimerCallbackInitialized; 00136 00137 private: 00138 vtkContextInteractorStyle(const vtkContextInteractorStyle&); // Not implemented 00139 void operator=(const vtkContextInteractorStyle&); // Not implemented 00140 00141 void ConstructMouseEvent(vtkContextMouseEvent &event, int button); 00142 bool ProcessMousePress(const vtkContextMouseEvent &event); 00143 }; 00144 00145 #endif