OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / SGI / util / SGI / include / graphics / vtkWin32RenderWindowInteractor.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkWin32RenderWindowInteractor.h,v $
5   Language:  C++
6   Date:      $Date: 2002/02/01 06:30:49 $
7   Version:   $Revision: 1.1.1.1 $
8   
9 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
10
11 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
12 The following terms apply to all files associated with the software unless
13 explicitly disclaimed in individual files. This copyright specifically does
14 not apply to the related textbook "The Visualization Toolkit" ISBN
15 013199837-4 published by Prentice Hall which is covered by its own copyright.
16
17 The authors hereby grant permission to use, copy, and distribute this
18 software and its documentation for any purpose, provided that existing
19 copyright notices are retained in all copies and that this notice is included
20 verbatim in any distributions. Additionally, the authors grant permission to
21 modify this software and its documentation for any purpose, provided that
22 such modifications are not distributed without the explicit consent of the
23 authors and that existing copyright notices are retained in all copies. Some
24 of the algorithms implemented by this software are patented, observe all
25 applicable patent law.
26
27 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
28 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
29 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
30 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
34 PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
35 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
36 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
37
38
39 =========================================================================*/
40 // .NAME vtkWin32RenderWindowInteractor - provide an event driven interface 
41 // to the renderer
42 // .SECTION Description
43 // vtkWin32RenderWindowInteractor is a convenience object that provides event 
44 // event bindings to common graphics functions. For example, camera
45 // zoom-in/zoom-out, azimuth, and roll. It is one of the window system
46 // specific subclasses of vtkRenderWindowInteractor.
47
48 // .SECTION see also
49 // vtkRenderWindowInteractor vtkWin32OpenGLRenderWindow
50
51 // .SECTION Event Bindings
52 // Mouse bindings: Button 1 - rotate, Button 2 - pan, Button 3 - zoom
53 // The distance from the center of the renderer viewport determines
54 // how quickly to rotate, pan and zoom.
55 // Keystrokes:
56 //    r - reset camera view
57 //    w - turn all actors wireframe
58 //    s - turn all actors surface
59 //    e - exits
60
61
62 #ifndef __vtkWin32RenderWindowInteractor_h
63 #define __vtkWin32RenderWindowInteractor_h
64
65 #include <stdlib.h>
66 #include "vtkRenderWindowInteractor.h"
67
68 class VTK_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
69 {
70 public:
71   vtkWin32RenderWindowInteractor();
72   ~vtkWin32RenderWindowInteractor();
73   static vtkWin32RenderWindowInteractor *New() {return new vtkWin32RenderWindowInteractor;};
74   const char *GetClassName() {return "vtkWin32RenderWindowInteractor";};
75   void PrintSelf(ostream& os, vtkIndent indent);
76
77   virtual void Initialize();
78   virtual void Start();
79   void UpdateSize(int,int);
80   void StartRotate();
81   void EndRotate();
82   void StartZoom();
83   void EndZoom();
84   void StartPan();
85   void EndPan();
86   void StartAnimation();
87   void EndAnimation();
88   //BTX
89   friend LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg,
90                                            WPARAM w, LPARAM l);
91   //ETX
92
93   // Description:
94   // Methods to set the default exit method for the class. This method is
95   // only used if no instance level ExitMethod has been defined.  It is
96   // provided as a means to control how an interactor is exited given
97   // the various language bindings (tcl, Win32, etc.).
98   static void SetClassExitMethod(void (*f)(void *), void *arg);
99   static void SetClassExitMethodArgDelete(void (*f)(void *));
100   
101 protected:
102   HWND WindowId;
103   UINT TimerId;
104   WNDPROC OldProc;
105   LPARAM LastPosition;
106
107   // Description:
108   // Class variables so an exit method can be defined for this class
109   // (used to set different exit methods for various language bindings,
110   // i.e. tcl, java, Win32)
111   static void (*ClassExitMethod)(void *);
112   static void (*ClassExitMethodArgDelete)(void *);
113   static void *ClassExitMethodArg;
114 };
115
116 #endif
117
118