Skip to content

Commit

Permalink
ENH: Remove obsolete "GestureEnabledButtons" ivar from interactor class
Browse files Browse the repository at this point in the history
Removes "GestureEnabledButtons" ivar that became obsolete following
these commits:
* c5c6d6f ("BUG: Restore complex gesture support", 2023-01-29),
* 22eba9f ("BUG: Fix integration with updated Slicer event delegation and VTK OpenVR API (KitwareMedical#131)", 2023-12-21)
* 0fa6102 ("BUG: Ensure handling of gesture triggers the "End" event", 2023-12-20)
* 512efe6 ("BUG: Do not report "Unrecognized device" if handling complex gesture", 2023-12-20)

For reference, it was originally introduced in 43bef4b ("ENH: Make trigger
button configurable", 2019-01-11).
  • Loading branch information
jcfr committed Dec 27, 2023
1 parent d1a4d40 commit dee0fb2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
20 changes: 0 additions & 20 deletions VirtualReality/MRMLDM/vtkVirtualRealityViewInteractor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ vtkStandardNewMacro(vtkVirtualRealityViewInteractor);
//----------------------------------------------------------------------------
vtkVirtualRealityViewInteractor::vtkVirtualRealityViewInteractor()
{
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Grip));
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -214,17 +213,10 @@ void vtkVirtualRealityViewInteractor::SetTriggerButtonFunction(std::string funct
if (functionId.empty())
{
vrInteractorStyle->MapInputToAction(vtkCommand::Select3DEvent, VTKIS_NONE);

this->GestureEnabledButtons.clear();
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Grip));
}
else if (!functionId.compare(vtkVirtualRealityViewInteractor::GetButtonFunctionIdForGrabObjectsAndWorld()))
{
vrInteractorStyle->MapInputToAction(vtkCommand::Select3DEvent, VTKIS_POSITION_PROP);

this->GestureEnabledButtons.clear();
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Grip));
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Trigger));
}
else
{
Expand All @@ -249,9 +241,6 @@ void vtkVirtualRealityViewInteractor::SetGestureButtonToTrigger()
this->AddAction("/actions/vtk/in/TriggerAction", /*isAnalog=*/false,
[this](vtkEventData* ed) { this->HandleComplexGestureEvents(ed); });
this->AddAction("/actions/vtk/in/ComplexGestureAction", vtkCommand::Select3DEvent, /*isAnalog=*/false);

this->GestureEnabledButtons.clear();
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Trigger));
}

//----------------------------------------------------------------------------
Expand All @@ -271,9 +260,6 @@ void vtkVirtualRealityViewInteractor::SetGestureButtonToGrip()
this->AddAction("/actions/vtk/in/TriggerAction", vtkCommand::Select3DEvent, /*isAnalog=*/false);
this->AddAction("/actions/vtk/in/ComplexGestureAction", /*isAnalog=*/false,
[this](vtkEventData* ed) { this->HandleComplexGestureEvents(ed); });

this->GestureEnabledButtons.clear();
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Grip));
}

//----------------------------------------------------------------------------
Expand All @@ -294,10 +280,6 @@ void vtkVirtualRealityViewInteractor::SetGestureButtonToTriggerAndGrip()
[this](vtkEventData* ed) { this->HandleComplexGestureEvents(ed); });
this->AddAction("/actions/vtk/in/ComplexGestureAction", /*isAnalog=*/false,
[this](vtkEventData* ed) { this->HandleComplexGestureEvents(ed); });

this->GestureEnabledButtons.clear();
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Grip));
this->GestureEnabledButtons.push_back(static_cast<int>(vtkEventDataDeviceInput::Trigger));
}

//----------------------------------------------------------------------------
Expand All @@ -318,6 +300,4 @@ void vtkVirtualRealityViewInteractor::SetGestureButtonToNone()
[](vtkEventData* vtkNotUsed(ed)) { });
this->AddAction("/actions/vtk/in/ComplexGestureAction", /*isAnalog=*/false,
[](vtkEventData* vtkNotUsed(ed)) { });

this->GestureEnabledButtons.clear();
}
5 changes: 0 additions & 5 deletions VirtualReality/MRMLDM/vtkVirtualRealityViewInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ class VTK_SLICER_VIRTUALREALITY_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT vtkVirtualR
void SetGestureButtonToNone();
///@}

protected:

/// List of buttons for which gesture recognition is enabled
std::vector<int> GestureEnabledButtons;

private:
vtkVirtualRealityViewInteractor();
~vtkVirtualRealityViewInteractor() override;
Expand Down

0 comments on commit dee0fb2

Please sign in to comment.