Commit de345070 authored by Ken Martin's avatar Ken Martin

ios improvements and new example

A number of improvements and a new ios example

- expose more module options in the ios build process
- add support for gesture based events
- add gesture reconition for cases where the native gesture
  recognizers are not used
- modify the multitouch interactor style to be based off
  the gestures
- modify the plane widget to support the pinch gesture as an example
- create a new iOS example called planeview that demonstrates
  - using multitouch gestures
  - loading data from a cloud provider
  - using a splash screen
  - using a settings page to control options
  - using a probe widget
parent 4c9fe5c4
Pipeline #7546 passed with stage
...@@ -702,7 +702,8 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event) ...@@ -702,7 +702,8 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event)
// pan is a move of the center point // pan is a move of the center point
// compute the distance along each of these axes in pixels // compute the distance along each of these axes in pixels
// the first to break thresh wins // the first to break thresh wins
double thresh = sqrt(this->Size[0]*this->Size[0] + this->Size[1]*this->Size[1])*0.01; double thresh = 0.01*sqrt(
static_cast<double>(this->Size[0]*this->Size[0] + this->Size[1]*this->Size[1]));
if (thresh < 15.0) if (thresh < 15.0)
{ {
thresh = 15.0; thresh = 15.0;
...@@ -732,32 +733,6 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event) ...@@ -732,32 +733,6 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event)
this->Translation[1] = 0.0; this->Translation[1] = 0.0;
this->StartPanEvent(); this->StartPanEvent();
} }
// // if we are a reasonable distance apart and the rotation is > some degrees
// // then start a rotation
// if (newDistance > 50.0 && fabs(angleDeviation) > 10.0)
// {
// this->CurrentGesture = vtkCommand::RotateEvent;
// this->Rotation = 0.0;
// }
// // if the distance has significantly changed then start a pinch event
// if (fabs(newDistance - originalDistance)/
// sqrt(this->Size[0]*this->Size[0] + this->Size[1]*this->Size[1]) > 0.1 ||
// fabs(newDistance - originalDistance) > 100.0)
// {
// this->CurrentGesture = vtkCommand::PinchEvent;
// this->Scale = 1.0;
// }
// // if
// if (fabs(angleDeviation) < 10.0 && // there is little rotation and
// (transDistance/sqrt(this->Size[0]*this->Size[0] + this->Size[1]*this->Size[1]) > 0.1 ||
// transDistance > 100.0))
// {
// this->CurrentGesture = vtkCommand::PanEvent;
// this->Translation[0] = 0.0;
// this->Translation[1] = 0.0;
// }
} }
// if we have found a specific type of movement then // if we have found a specific type of movement then
...@@ -777,9 +752,6 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event) ...@@ -777,9 +752,6 @@ void vtkRenderWindowInteractor::RecognizeGesture(vtkCommand::EventIds event)
if (this->CurrentGesture == vtkCommand::PanEvent) if (this->CurrentGesture == vtkCommand::PanEvent)
{ {
double trans[2];
trans[0] = (posVals[0][0] - startVals[0][0] + posVals[1][0] - startVals[1][0])/2.0;
trans[1] = (posVals[0][1] - startVals[0][1] + posVals[1][1] - startVals[1][1])/2.0;
this->SetTranslation(trans); this->SetTranslation(trans);
this->PanEvent(); this->PanEvent();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment