/usr/include/vtk-7.1/vtkRenderWindowInteractor3D.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkRenderWindowInteractor3D.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkRenderWindowInteractor3D
* @brief adds support for 3D events to vtkRenderWindowInteractor.
*
*
* vtkRenderWindowInteractor3D provides a platform-independent interaction
* support for 3D events including 3D clicks and 3D controller
* orientations. It follows the same basic model as
* vtkRenderWindowInteractor but adds methods to set and get 3D event
* locations and orientations. VR systems will subclass this class to
* provide the code to set these values based on events from their VR
* controllers.
*/
#ifndef vtkRenderWindowInteractor3D_h
#define vtkRenderWindowInteractor3D_h
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkRenderWindowInteractor.h"
class vtkCamera;
class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor3D : public vtkRenderWindowInteractor
{
public:
/**
* Construct object so that light follows camera motion.
*/
static vtkRenderWindowInteractor3D *New();
vtkTypeMacro(vtkRenderWindowInteractor3D,vtkRenderWindowInteractor);
void PrintSelf(ostream& os, vtkIndent indent);
//@{
/**
* Enable/Disable interactions. By default interactors are enabled when
* initialized. Initialize() must be called prior to enabling/disabling
* interaction. These methods are used when a window/widget is being
* shared by multiple renderers and interactors. This allows a "modal"
* display where one interactor is active when its data is to be displayed
* and all other interactors associated with the widget are disabled
* when their data is not displayed.
*/
virtual void Enable();
virtual void Disable();
//@}
/**
* OpenVR specific application terminate, calls ClassExitMethod then
* calls PostQuitMessage(0) to terminate the application. An application can Specify
* ExitMethod for alternative behavior (i.e. suppression of keyboard exit)
*/
void TerminateApp(void);
/**
* Create default picker. Used to create one when none is specified.
* Default is an instance of vtkPropPicker.
*/
virtual vtkAbstractPropPicker *CreateDefaultPicker();
//@{
/**
* With VR we know the world coordinate positions
* and orientations of events. These methods
* support querying them instead of going through
* a display X,Y coordinate approach as is standard
* for mouse/touch events
*/
virtual double *GetWorldEventPosition(int pointerIndex)
{
if (pointerIndex >= VTKI_MAX_POINTERS)
{
return NULL;
}
return this->WorldEventPositions[pointerIndex];
}
virtual double *GetLastWorldEventPosition(int pointerIndex)
{
if (pointerIndex >= VTKI_MAX_POINTERS)
{
return NULL;
}
return this->LastWorldEventPositions[pointerIndex];
}
virtual double *GetWorldEventOrientation(int pointerIndex)
{
if (pointerIndex >= VTKI_MAX_POINTERS)
{
return NULL;
}
return this->WorldEventOrientations[pointerIndex];
}
virtual double *GetLastWorldEventOrientation(int pointerIndex)
{
if (pointerIndex >= VTKI_MAX_POINTERS)
{
return NULL;
}
return this->LastWorldEventOrientations[pointerIndex];
}
//@}
//@{
/**
* With VR we know the physical/room coordinate positions
* and orientations of events. These methods
* support setting them.
*/
virtual void SetPhysicalEventPosition(double x, double y, double z, int pointerIndex)
{
if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
{
return;
}
vtkDebugMacro(
<< this->GetClassName() << " (" << this
<< "): setting PhysicalEventPosition to ("
<< x << "," << y << "," << z
<< ") for pointerIndex number " << pointerIndex);
if (this->PhysicalEventPositions[pointerIndex][0] != x ||
this->PhysicalEventPositions[pointerIndex][1] != y ||
this->PhysicalEventPositions[pointerIndex][2] != z ||
this->LastPhysicalEventPositions[pointerIndex][0] != x ||
this->LastPhysicalEventPositions[pointerIndex][1] != y ||
this->LastPhysicalEventPositions[pointerIndex][2] != z)
{
this->LastPhysicalEventPositions[pointerIndex][0] = this->PhysicalEventPositions[pointerIndex][0];
this->LastPhysicalEventPositions[pointerIndex][1] = this->PhysicalEventPositions[pointerIndex][1];
this->LastPhysicalEventPositions[pointerIndex][2] = this->PhysicalEventPositions[pointerIndex][2];
this->PhysicalEventPositions[pointerIndex][0] = x;
this->PhysicalEventPositions[pointerIndex][1] = y;
this->PhysicalEventPositions[pointerIndex][2] = z;
this->Modified();
}
}
//@}
//@{
/**
* With VR we know the world coordinate positions
* and orientations of events. These methods
* support setting them.
*/
virtual void SetWorldEventPosition(double x, double y, double z, int pointerIndex)
{
if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
{
return;
}
vtkDebugMacro(
<< this->GetClassName() << " (" << this
<< "): setting WorldEventPosition to ("
<< x << "," << y << "," << z
<< ") for pointerIndex number " << pointerIndex);
if (this->WorldEventPositions[pointerIndex][0] != x ||
this->WorldEventPositions[pointerIndex][1] != y ||
this->WorldEventPositions[pointerIndex][2] != z ||
this->LastWorldEventPositions[pointerIndex][0] != x ||
this->LastWorldEventPositions[pointerIndex][1] != y ||
this->LastWorldEventPositions[pointerIndex][2] != z)
{
this->LastWorldEventPositions[pointerIndex][0] = this->WorldEventPositions[pointerIndex][0];
this->LastWorldEventPositions[pointerIndex][1] = this->WorldEventPositions[pointerIndex][1];
this->LastWorldEventPositions[pointerIndex][2] = this->WorldEventPositions[pointerIndex][2];
this->WorldEventPositions[pointerIndex][0] = x;
this->WorldEventPositions[pointerIndex][1] = y;
this->WorldEventPositions[pointerIndex][2] = z;
this->Modified();
}
}
virtual void SetWorldEventOrientation(double w, double x, double y, double z, int pointerIndex)
{
if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
{
return;
}
vtkDebugMacro(
<< this->GetClassName() << " (" << this
<< "): setting WorldEventOrientation to ("
<< w << "," << x << "," << y << "," << z
<< ") for pointerIndex number " << pointerIndex);
if (this->WorldEventOrientations[pointerIndex][0] != w ||
this->WorldEventOrientations[pointerIndex][1] != x ||
this->WorldEventOrientations[pointerIndex][2] != y ||
this->WorldEventOrientations[pointerIndex][3] != z ||
this->LastWorldEventOrientations[pointerIndex][0] != w ||
this->LastWorldEventOrientations[pointerIndex][1] != x ||
this->LastWorldEventOrientations[pointerIndex][2] != y ||
this->LastWorldEventOrientations[pointerIndex][3] != z)
{
this->LastWorldEventOrientations[pointerIndex][0] = this->WorldEventOrientations[pointerIndex][0];
this->LastWorldEventOrientations[pointerIndex][1] = this->WorldEventOrientations[pointerIndex][1];
this->LastWorldEventOrientations[pointerIndex][2] = this->WorldEventOrientations[pointerIndex][2];
this->LastWorldEventOrientations[pointerIndex][3] = this->WorldEventOrientations[pointerIndex][3];
this->WorldEventOrientations[pointerIndex][0] = w;
this->WorldEventOrientations[pointerIndex][1] = x;
this->WorldEventOrientations[pointerIndex][2] = y;
this->WorldEventOrientations[pointerIndex][3] = z;
this->Modified();
}
}
//@}
//@{
/**
* Override to set pointers down
*/
virtual void RightButtonPressEvent();
virtual void RightButtonReleaseEvent();
//@}
//@{
/**
* Set/Get the latest touchpad position
*/
vtkSetVector2Macro(TouchPadPosition,float);
vtkGetVector2Macro(TouchPadPosition,float);
//@}
//@{
/**
* Set/Get the optional translation to map world coordinates into the
* 3D physical space (meters, 0,0,0).
*/
virtual void SetPhysicalTranslation(vtkCamera *, double, double, double) {};
virtual double *GetPhysicalTranslation(vtkCamera *) { return NULL; };
//@}
//@{
/**
* Set/get the tranlation for pan/swipe gestures, update LastTranslation
*/
void SetTranslation3D(double val[3]);
vtkGetVector3Macro(Translation3D, double);
vtkGetVector3Macro(LastTranslation3D, double);
//@}
protected:
vtkRenderWindowInteractor3D();
~vtkRenderWindowInteractor3D();
int MouseInWindow;
int StartedMessageLoop;
float TouchPadPosition[2];
double Translation3D[3];
double LastTranslation3D[3];
bool Done; // is the event loop done running
double WorldEventPositions[VTKI_MAX_POINTERS][3];
double LastWorldEventPositions[VTKI_MAX_POINTERS][3];
double PhysicalEventPositions[VTKI_MAX_POINTERS][3];
double LastPhysicalEventPositions[VTKI_MAX_POINTERS][3];
double StartingPhysicalEventPositions[VTKI_MAX_POINTERS][3];
double WorldEventOrientations[VTKI_MAX_POINTERS][4];
double LastWorldEventOrientations[VTKI_MAX_POINTERS][4];
virtual void RecognizeGesture(vtkCommand::EventIds);
private:
vtkRenderWindowInteractor3D(const vtkRenderWindowInteractor3D&) VTK_DELETE_FUNCTION; // Not implemented.
void operator=(const vtkRenderWindowInteractor3D&) VTK_DELETE_FUNCTION; // Not implemented.
};
#endif
|