VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Geovis
vtkGeoInteractorStyle.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkGeoInteractorStyle.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
/*-------------------------------------------------------------------------
16
Copyright 2008 Sandia Corporation.
17
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18
the U.S. Government retains certain rights in this software.
19
-------------------------------------------------------------------------*/
35
#ifndef __vtkGeoInteractorStyle_h
36
#define __vtkGeoInteractorStyle_h
37
38
#include "
vtkInteractorStyleTrackballCamera.h
"
39
#include "
vtkSmartPointer.h
"
// for SP
40
41
class
vtkCamera
;
42
class
vtkCommand
;
43
class
vtkCompassWidget
;
44
class
vtkGeoCamera
;
45
class
vtkUnsignedCharArray
;
46
47
class
VTK_GEOVIS_EXPORT
vtkGeoInteractorStyle
:
48
public
vtkInteractorStyleTrackballCamera
49
{
50
public
:
51
static
vtkGeoInteractorStyle
*
New
();
52
vtkTypeMacro(
vtkGeoInteractorStyle
,
53
vtkInteractorStyleTrackballCamera
);
54
void
PrintSelf
(ostream& os,
vtkIndent
indent);
55
57
58
virtual
void
OnEnter
();
59
virtual
void
OnLeave
();
60
virtual
void
OnMouseMove
();
61
virtual
void
OnLeftButtonUp
();
62
virtual
void
OnMiddleButtonUp
();
63
virtual
void
OnRightButtonUp
();
64
virtual
void
OnLeftButtonDown
();
65
virtual
void
OnMiddleButtonDown
();
66
virtual
void
OnRightButtonDown
();
67
virtual
void
OnChar
();
69
70
virtual
void
RubberBandZoom();
71
virtual
void
Pan
();
72
virtual
void
Dolly
();
73
74
// Public for render callback.
75
void
RedrawRectangle();
76
77
// See cxx for description of why we need this method.
78
void
StartState
(
int
newstate);
79
80
// Used for updating the terrain.
81
vtkGeoCamera
* GetGeoCamera();
82
84
void
ResetCamera();
85
87
void
WidgetInteraction(
vtkObject
*caller);
88
91
virtual
void
SetInteractor
(
vtkRenderWindowInteractor
*interactor);
92
93
int
ViewportToWorld(
double
x,
double
y,
94
double
&wx,
double
&wy,
double
&wz);
95
void
WorldToLongLat(
double
wx,
double
wy,
double
wz,
96
double
&lon,
double
&lat);
97
void
ViewportToLongLat(
double
x,
double
y,
98
double
&lon,
double
&lat);
99
int
GetRayIntersection(
double
origin[3],
100
double
direction
[3],
101
double
intersection[3]);
102
104
virtual
void
SetCurrentRenderer
(
vtkRenderer
*);
105
107
108
vtkGetMacro(LockHeading,
bool
);
109
vtkSetMacro(LockHeading,
bool
);
110
vtkBooleanMacro(LockHeading,
bool
);
112
114
void
ResetCameraClippingRange();
115
116
protected
:
117
vtkGeoInteractorStyle
();
118
~
vtkGeoInteractorStyle
();
119
120
// To avoid a warning.
121
// We should really inherit directy from vtkInteractorStyle
122
virtual
void
Dolly
(
double
);
123
124
void
OnTimer
();
125
// Used to get a constant speed regardless of frame rate.
126
double
LastTime
;
127
128
// Rubberband zoom has a verification stage.
129
int
RubberBandExtent[4];
130
int
RubberBandExtentEnabled
;
131
int
RenderCallbackTag
;
132
void
EnableRubberBandRedraw();
133
void
DisableRubberBandRedraw();
134
bool
InRubberBandRectangle(
int
x,
int
y);
135
void
DrawRectangle();
136
137
void
KeepCameraAboveGround(
vtkCamera
* camera);
138
void
UpdateLights();
139
void
GetPanCenter(
double
&px,
double
&py);
140
141
int
StartPosition[2];
142
int
EndPosition[2];
143
int
DraggingRubberBandBoxState
;
144
double
MotionFactor
;
145
vtkUnsignedCharArray
*
PixelArray
;
146
int
PixelDims[2];
147
bool
LockHeading
;
148
149
//BTX
150
vtkSmartPointer<vtkGeoCamera>
GeoCamera
;
151
152
// widget handling members
153
vtkSmartPointer<vtkCompassWidget>
CompassWidget
;
154
vtkSmartPointer<vtkCommand>
EventCommand
;
155
156
//ETX
157
158
private
:
159
vtkGeoInteractorStyle
(
const
vtkGeoInteractorStyle
&);
// Not implemented.
160
void
operator=(
const
vtkGeoInteractorStyle
&);
// Not implemented.
161
};
162
163
#endif
Generated on Wed May 30 2012 13:21:58 for VTK by
1.8.1