Update integration to support VTK 9.1#90
Conversation
…_INFO Co-authored-by: Csaba Pinter <pinter.csaba@gmail.com>
The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.
(1) Compile project using Ninja specifying -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL
(2) Run run-clang-tidy specifying path to inner-build
BUILD_DIR=/home/jcfr/Projects/SlicerVirtualReality-Release/inner-build
run-clang-tidy-10 -p ${BUILD_DIR} -extra-arg=-D__clang__ -checks=-*,modernize-use-nullptr -header-filter=.* -fix
Adapted from Slicer/Slicer@526643353
and https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide#C.2B.2B11:_Update_source_code_to_use_nullptr
Co-authored-by: Csaba Pinter <pinter.csaba@gmail.com>
List of VTKExternalModule changes:
$ git shortlog 3bae71e5e..50f1c5be9 --no-merges
Jean-Christophe Fillion-Robin (3):
Add support for specifying path to vtk.kit file
vtkmodule-config: Skip include of properties if python wrappers are disabled
Add support for externally building a VTK modules and its dependencies
Co-authored-by: Csaba Pinter <pinter.csaba@gmail.com>
Co-authored-by: Rafael Moreta <rmoretamartinez@gmail.com>
…rStyle Based of Slicer/Slicer@364ff7b6d (ENH: Use common interactor style for slice and 3D views) Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
This change is done anticipating the transition to the updated API associated with VTK >= 9.1
In addition of the API changes documented below, this commit also updates "vtkVirtualRealityViewInteractor" to allow retrieving the last tracked device position stored in the array "vtkOpenVRRenderWindowInteractor::Trackers". The "Trackers" array contains "TrackerActions" each being a struct with two entries: - Source of type "vr::VRInputValueHandle_t" - LastPose of type "vr::TrackedDevicePose_t" Remaining issues ---------------- ### (1) Retrieval of last position associated with generic tracker Retrieval of last position associated with generic tracker in "vtkVirtualRealityViewInteractor::GetTrackedDevicePose" given the index is not possible. TODO: Handle retrieval of tracker position associated with generic tracker associated with index. Background: Add support for generic tracker originally contributed in these commits: * Kitware/VTK@6083532cf8 (ENH: Exposing the generic tracker openvr device type to downstream projects) * KitwareMedical/SlicerVirtualReality@59b7d1bf3 (Adding interface and logic to maintain MRML transforms for each generic VR tracker) but removed following the refactoring done in these commits: * Kitware/VTK@1aac3fe5f (Create VRInteractorStyle and VRRenderWindowInteractor) * Kitware/VTK@af0fab486 (Clean up VR and OpenVR classes) * Kitware/VTK@9bd64d666 (Cleanup and rework of the VRInteractorStyle and subclasses) * Kitware/VTK@09a478a22 (Cleanup VR camera code and subclasses) ### (2) RecognizeComplexGesture is not virtual anymore in base VTK class TODO: Assess with this function should still be overriden with VTK 9.1 Background: The function became non virtual in Kitware/VTK@af0fab486 (Clean up VR and OpenVR classes) API changes ----------- vtkEventData API changes: * vtkEventDataButton3D -> vtkEventDataDevice3D RenderWindow API changes * GetNumberOfTrackedDevicesForDevice -> GetNumberOfDeviceHandlesForDevice * GetTrackedDeviceIndexForDevice -> GetDeviceHandleForDevice * GetTrackedDeviceModel -> GetModelForDevice * GetTrackedDeviceIndexForDevice -> GetDeviceHandleForDevice InteractorStyle API changes * PositionProp sinature updated to include "lwpos" and "lwori"
7fab306 to
83beb31
Compare
|
|
I can confirm that the branch jcfr/SlicerVirtualReality@fix-build-against-vtk-9.1.20211022...fix-build-against-vtk-9.1.20211022-with-gui-widgets-module builds. I'll test it tomorrow in the office where I have access to VR hardware. |
|
I finally could test it with a Slicer build from March 1st. There are a few issues, but it's a bit tricky to know what is because of what. Scenario 1: HP Reverb 2 on Windows 11 (Windows updated from 10 without asking)
Scenario 2: HTC Vive Pro on Windows 10
|
|
@jcfr I can work a bit on this today. I'll check out the flying issue, and see if there is anything else to fix before integration (volume rendering works, it was simply a driver issue - see here). Please let me know if I should check out anything specific. |
I suggest you try copying the relevant file in the current working directory. Looking at https://github.com/Slicer/VTK/blob/slicer-v9.1.20220125-efbe2afc2/Rendering/OpenVR/vtkOpenVRRenderWindowInteractor.cxx#L34, we can see that the filename is looked using The files are the following: and should be copied in the current working directory. Source: https://github.com/Slicer/VTK/tree/slicer-v9.1.20220125-efbe2afc2/Rendering/OpenVR |
|
@cpinter We are working on fixing all extension builds for Slicer5. There are now only two extensions - SlicerVirtualReality and SlicerRadiomics - that must be fixed before the new release: https://docs.google.com/spreadsheets/d/1GC4DWDpOXhuDYdfYOjJ6PmjHTeMM3-K7SoiC5ZR1GYg/edit?usp=sharing It would be great if you could finalize this pull request so that we can start the Slicer5 release process. |
|
This is on my list every single day, but I have a very hard time finding time to work on this these weeks. I still haven't been able to reinstall the computer that I use for VR. Hopefully tomorrow I can do that, but to spend even two hours fixing real issues is quite unlikely over the next two weeks or so. I'd say that we integrate this to fix the build, and then fix the remaining issues afterwards. I cannot say with certainty that there are actual issues with the extension that haven't been there before, because my VR computer acted up as well as @dgmato 's, and nobody else seems to have tested this. Having the extension build successfully would at least facilitate this. |
|
OK, thanks, I'll merge the changes then. |
|
Great, let's see the dashboard tomorrow, it should be green and I'll at least try to test it with the preview after reinstall. Sorry I haven't been more help with this, but sometimes projects pile up. |
|
I copied the summary of remaining issues related to the integration with VTK 9.1 in #91 These would still need to be addressed. |

In addition of the API changes documented below, this commit also updates
vtkVirtualRealityViewInteractorto allow retrieving the last tracked deviceposition stored in the array
vtkOpenVRRenderWindowInteractor::Trackers.The
Trackersarray containsTrackerActionseach being a struct withtwo entries:
Sourceof typevr::VRInputValueHandle_tLastPoseof typevr::TrackedDevicePose_tObsolete branches
Remaining issues
(1) Retrieval of last position associated with generic tracker
Retrieval of last position associated with generic tracker in
vtkVirtualRealityViewInteractor::GetTrackedDevicePosegiventhe index is not possible.
Background:
Add support for generic tracker originally contributed in these commits:
but removed following the refactoring done in these commits:
(2) RecognizeComplexGesture is not virtual anymore in base VTK class
Background: The function became non virtual in Kitware/VTK@af0fab486 (Clean up VR and OpenVR classes)
API changes
vtkEventData API changes:
RenderWindow API changes
InteractorStyle API changes