OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkInteractorStyleTerrain.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkInteractorStyleTerrain.h,v $
5   Language:  C++
6   Date:      $Date: 2002/05/06 21:13:53 $
7   Version:   $Revision: 1.1 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkInteractorStyleTerrain - manipulate camera in scene with natural view up (e.g., terrain)
19 // .SECTION Description
20 // vtkInteractorStyleTerrain is used to manipulate a camera which is viewing
21 // a scene with a natural view up, e.g., terrain. The camera in such a
22 // scene is manipulated by specifying azimuth (angle around the view
23 // up vector) and elevation (the angle from the horizon).
24 //
25 // The mouse binding for this class is as follows. Left mouse click followed
26 // rotates the camera around the focal point using both elevation and azimuth
27 // invocations on the camera. Left mouse motion in the horizontal direction
28 // results in azimuth motion; left mouse motion in the vertical direction
29 // results in elevation motion. Therefore, diagonal motion results in a
30 // combination of azimuth and elevation. (If the shift key is held during
31 // motion, then only one of elevation or azimuth is invoked, depending on the
32 // whether the mouse motion is primarily horizontal or vertical.) Middle
33 // mouse button pans the camera across the scene (again the shift key has a
34 // similar effect on limiting the motion to the vertical or horizontal
35 // direction. The right mouse is used to dolly (e.g., a type of zoom) towards
36 // or away from the focal point.
37 //
38 // The class also supports some keypress events. The "r" key resets the
39 // camera.  The "e" key invokes the exit callback and by default exits the
40 // program. The "f" key sets a new camera focal point and flys towards that
41 // point. The "u" key invokes the user event. The "3" key toggles between 
42 // stereo and non-stero mode. The "l" key toggles on/off a latitude/longitude
43 // markers that can be used to estimate/control position.
44 // 
45
46 // .SECTION See Also
47 // vtkInteractorObserver vtkInteractorStyle vtk3DWidget
48
49 #ifndef __vtkInteractorStyleTerrain_h
50 #define __vtkInteractorStyleTerrain_h
51
52 #include "vtkInteractorStyle.h"
53
54 class vtkPolyDataMapper;
55 class vtkSphereSource;
56 class vtkExtractEdges;
57
58 class VTK_RENDERING_EXPORT vtkInteractorStyleTerrain : public vtkInteractorStyle
59 {
60 public:
61   // Description:
62   // Instantiate the object.
63   static vtkInteractorStyleTerrain *New();
64
65   vtkTypeRevisionMacro(vtkInteractorStyleTerrain,vtkInteractorStyle);
66   void PrintSelf(ostream& os, vtkIndent indent);
67
68   // Description:
69   // Event bindings controlling the effects of pressing mouse buttons
70   // or moving the mouse.
71   virtual void OnMouseMove();
72   virtual void OnLeftButtonDown();
73   virtual void OnLeftButtonUp();
74   virtual void OnMiddleButtonDown();
75   virtual void OnMiddleButtonUp();
76   virtual void OnRightButtonDown();
77   virtual void OnRightButtonUp();
78
79   // Description:
80   // Override the "fly-to" (f keypress) for images.
81   virtual void OnChar();
82
83   // These methods for the different interactions in different modes
84   // are overridden in subclasses to perform the correct motion.
85   virtual void Rotate();
86   virtual void Pan();
87   virtual void Dolly();
88
89   // Description:
90   // Turn on/off the latitude/longitude lines.
91   vtkSetMacro(LatLongLines,int);
92   vtkGetMacro(LatLongLines,int);
93   vtkBooleanMacro(LatLongLines,int);
94
95 protected:
96   vtkInteractorStyleTerrain();
97   ~vtkInteractorStyleTerrain();
98
99   // Internal helper attributes
100   int LatLongLines;
101
102   vtkSphereSource *LatLongSphere;
103   vtkPolyDataMapper *LatLongMapper;
104   vtkActor *LatLongActor;
105   vtkExtractEdges *LatLongExtractEdges;
106
107   void SelectRepresentation();
108   void CreateLatLong();
109   
110   float MotionFactor;
111
112 private:
113   vtkInteractorStyleTerrain(const vtkInteractorStyleTerrain&);  // Not implemented.
114   void operator=(const vtkInteractorStyleTerrain&);  // Not implemented.
115   
116 };
117
118 #endif
119