From 261d012c9786837fe634f6ead3fd7bb753a67315 Mon Sep 17 00:00:00 2001 From: Michael Migliore Date: Tue, 26 Nov 2024 23:32:08 +0100 Subject: [PATCH] coverage --- application/testing/CMakeLists.txt | 1 + .../baselines/TestInteractionPanWithShift.png | 3 + .../recordings/TestInteractionHDRIMove.log | 1 + .../TestInteractionPanWithShift.log | 232 ++++++++++++++++++ vtkext/private/module/vtkF3DImguiActor.cxx | 9 +- .../private/module/vtkF3DInteractorStyle.cxx | 28 +-- 6 files changed, 242 insertions(+), 32 deletions(-) create mode 100644 testing/baselines/TestInteractionPanWithShift.png create mode 100644 testing/recordings/TestInteractionPanWithShift.log diff --git a/application/testing/CMakeLists.txt b/application/testing/CMakeLists.txt index 79423c511e..4058ed420e 100644 --- a/application/testing/CMakeLists.txt +++ b/application/testing/CMakeLists.txt @@ -793,6 +793,7 @@ f3d_test(NAME TestInteractionOrthographicProjection DATA cow.vtp INTERACTION) #5 f3d_test(NAME TestInteractionZoomToggleOrthographicProjection DATA cow.vtp INTERACTION) #MouseWheel;5;Mousewheelx6;5 f3d_test(NAME TestInteractionRotateCameraMinus90 DATA f3d.glb INTERACTION) f3d_test(NAME TestInteractionRotateCamera90 DATA f3d.glb INTERACTION) +f3d_test(NAME TestInteractionPanWithShift DATA f3d.glb INTERACTION) #Shift;LeftMouse;MouseMovements # Progress test f3d_test(NAME TestProgress DATA cow.vtp ARGS --progress NO_BASELINE) diff --git a/testing/baselines/TestInteractionPanWithShift.png b/testing/baselines/TestInteractionPanWithShift.png new file mode 100644 index 0000000000..19c0061af1 --- /dev/null +++ b/testing/baselines/TestInteractionPanWithShift.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78ca69e442c6e24f1fde67461047dd97a7b789fcece29ffc15c794c103fe390e +size 2084 diff --git a/testing/recordings/TestInteractionHDRIMove.log b/testing/recordings/TestInteractionHDRIMove.log index d8945644d4..6c04fb6a98 100644 --- a/testing/recordings/TestInteractionHDRIMove.log +++ b/testing/recordings/TestInteractionHDRIMove.log @@ -34,4 +34,5 @@ RenderEvent 301 313 1 0 0 Shift_L RenderEvent 301 313 1 0 0 Shift_L InteractionEvent 301 313 1 0 0 Shift_L MouseMoveEvent 283 313 1 0 0 Shift_L +RightButtonReleaseEvent 283 313 1 0 0 Shift_L KeyReleaseEvent -2 309 1 0 1 Shift_L diff --git a/testing/recordings/TestInteractionPanWithShift.log b/testing/recordings/TestInteractionPanWithShift.log new file mode 100644 index 0000000000..d77c5307f1 --- /dev/null +++ b/testing/recordings/TestInteractionPanWithShift.log @@ -0,0 +1,232 @@ +# StreamVersion 1.2 +KeyPressEvent 76 95 0 0 1 Shift_L 0 +CharEvent 76 95 0 0 1 Shift_L 0 +MouseMoveEvent 77 95 1 0 0 Shift_L 0 +LeftButtonPressEvent 77 95 1 0 0 Shift_L 0 +StartInteractionEvent 77 95 1 0 0 Shift_L 0 +MouseMoveEvent 77 95 1 0 0 Shift_L 0 +RenderEvent 77 95 1 0 0 Shift_L 0 +InteractionEvent 77 95 1 0 0 Shift_L 0 +MouseMoveEvent 78 95 1 0 0 Shift_L 0 +RenderEvent 78 95 1 0 0 Shift_L 0 +InteractionEvent 78 95 1 0 0 Shift_L 0 +MouseMoveEvent 79 95 1 0 0 Shift_L 0 +RenderEvent 79 95 1 0 0 Shift_L 0 +InteractionEvent 79 95 1 0 0 Shift_L 0 +MouseMoveEvent 79 96 1 0 0 Shift_L 0 +RenderEvent 79 96 1 0 0 Shift_L 0 +InteractionEvent 79 96 1 0 0 Shift_L 0 +MouseMoveEvent 80 96 1 0 0 Shift_L 0 +RenderEvent 80 96 1 0 0 Shift_L 0 +InteractionEvent 80 96 1 0 0 Shift_L 0 +MouseMoveEvent 81 97 1 0 0 Shift_L 0 +RenderEvent 81 97 1 0 0 Shift_L 0 +InteractionEvent 81 97 1 0 0 Shift_L 0 +MouseMoveEvent 82 98 1 0 0 Shift_L 0 +RenderEvent 82 98 1 0 0 Shift_L 0 +InteractionEvent 82 98 1 0 0 Shift_L 0 +MouseMoveEvent 84 99 1 0 0 Shift_L 0 +RenderEvent 84 99 1 0 0 Shift_L 0 +InteractionEvent 84 99 1 0 0 Shift_L 0 +MouseMoveEvent 85 101 1 0 0 Shift_L 0 +RenderEvent 85 101 1 0 0 Shift_L 0 +InteractionEvent 85 101 1 0 0 Shift_L 0 +MouseMoveEvent 86 103 1 0 0 Shift_L 0 +RenderEvent 86 103 1 0 0 Shift_L 0 +InteractionEvent 86 103 1 0 0 Shift_L 0 +MouseMoveEvent 89 105 1 0 0 Shift_L 0 +RenderEvent 89 105 1 0 0 Shift_L 0 +InteractionEvent 89 105 1 0 0 Shift_L 0 +MouseMoveEvent 90 105 1 0 0 Shift_L 0 +RenderEvent 90 105 1 0 0 Shift_L 0 +InteractionEvent 90 105 1 0 0 Shift_L 0 +MouseMoveEvent 91 107 1 0 0 Shift_L 0 +RenderEvent 91 107 1 0 0 Shift_L 0 +InteractionEvent 91 107 1 0 0 Shift_L 0 +MouseMoveEvent 91 108 1 0 0 Shift_L 0 +RenderEvent 91 108 1 0 0 Shift_L 0 +InteractionEvent 91 108 1 0 0 Shift_L 0 +MouseMoveEvent 92 108 1 0 0 Shift_L 0 +RenderEvent 92 108 1 0 0 Shift_L 0 +InteractionEvent 92 108 1 0 0 Shift_L 0 +MouseMoveEvent 93 109 1 0 0 Shift_L 0 +RenderEvent 93 109 1 0 0 Shift_L 0 +InteractionEvent 93 109 1 0 0 Shift_L 0 +MouseMoveEvent 94 109 1 0 0 Shift_L 0 +RenderEvent 94 109 1 0 0 Shift_L 0 +InteractionEvent 94 109 1 0 0 Shift_L 0 +MouseMoveEvent 95 110 1 0 0 Shift_L 0 +RenderEvent 95 110 1 0 0 Shift_L 0 +InteractionEvent 95 110 1 0 0 Shift_L 0 +MouseMoveEvent 96 111 1 0 0 Shift_L 0 +RenderEvent 96 111 1 0 0 Shift_L 0 +InteractionEvent 96 111 1 0 0 Shift_L 0 +MouseMoveEvent 97 112 1 0 0 Shift_L 0 +RenderEvent 97 112 1 0 0 Shift_L 0 +InteractionEvent 97 112 1 0 0 Shift_L 0 +MouseMoveEvent 98 113 1 0 0 Shift_L 0 +RenderEvent 98 113 1 0 0 Shift_L 0 +InteractionEvent 98 113 1 0 0 Shift_L 0 +MouseMoveEvent 100 115 1 0 0 Shift_L 0 +RenderEvent 100 115 1 0 0 Shift_L 0 +InteractionEvent 100 115 1 0 0 Shift_L 0 +MouseMoveEvent 102 117 1 0 0 Shift_L 0 +RenderEvent 102 117 1 0 0 Shift_L 0 +InteractionEvent 102 117 1 0 0 Shift_L 0 +MouseMoveEvent 105 120 1 0 0 Shift_L 0 +RenderEvent 105 120 1 0 0 Shift_L 0 +InteractionEvent 105 120 1 0 0 Shift_L 0 +MouseMoveEvent 106 123 1 0 0 Shift_L 0 +RenderEvent 106 123 1 0 0 Shift_L 0 +InteractionEvent 106 123 1 0 0 Shift_L 0 +MouseMoveEvent 109 124 1 0 0 Shift_L 0 +RenderEvent 109 124 1 0 0 Shift_L 0 +InteractionEvent 109 124 1 0 0 Shift_L 0 +MouseMoveEvent 110 127 1 0 0 Shift_L 0 +RenderEvent 110 127 1 0 0 Shift_L 0 +InteractionEvent 110 127 1 0 0 Shift_L 0 +MouseMoveEvent 111 129 1 0 0 Shift_L 0 +RenderEvent 111 129 1 0 0 Shift_L 0 +InteractionEvent 111 129 1 0 0 Shift_L 0 +MouseMoveEvent 111 130 1 0 0 Shift_L 0 +RenderEvent 111 130 1 0 0 Shift_L 0 +InteractionEvent 111 130 1 0 0 Shift_L 0 +MouseMoveEvent 112 131 1 0 0 Shift_L 0 +RenderEvent 112 131 1 0 0 Shift_L 0 +InteractionEvent 112 131 1 0 0 Shift_L 0 +MouseMoveEvent 113 132 1 0 0 Shift_L 0 +RenderEvent 113 132 1 0 0 Shift_L 0 +InteractionEvent 113 132 1 0 0 Shift_L 0 +MouseMoveEvent 113 133 1 0 0 Shift_L 0 +RenderEvent 113 133 1 0 0 Shift_L 0 +InteractionEvent 113 133 1 0 0 Shift_L 0 +MouseMoveEvent 113 134 1 0 0 Shift_L 0 +RenderEvent 113 134 1 0 0 Shift_L 0 +InteractionEvent 113 134 1 0 0 Shift_L 0 +MouseMoveEvent 114 135 1 0 0 Shift_L 0 +RenderEvent 114 135 1 0 0 Shift_L 0 +InteractionEvent 114 135 1 0 0 Shift_L 0 +MouseMoveEvent 115 136 1 0 0 Shift_L 0 +RenderEvent 115 136 1 0 0 Shift_L 0 +InteractionEvent 115 136 1 0 0 Shift_L 0 +MouseMoveEvent 116 139 1 0 0 Shift_L 0 +RenderEvent 116 139 1 0 0 Shift_L 0 +InteractionEvent 116 139 1 0 0 Shift_L 0 +MouseMoveEvent 117 140 1 0 0 Shift_L 0 +RenderEvent 117 140 1 0 0 Shift_L 0 +InteractionEvent 117 140 1 0 0 Shift_L 0 +MouseMoveEvent 120 142 1 0 0 Shift_L 0 +RenderEvent 120 142 1 0 0 Shift_L 0 +InteractionEvent 120 142 1 0 0 Shift_L 0 +MouseMoveEvent 121 144 1 0 0 Shift_L 0 +RenderEvent 121 144 1 0 0 Shift_L 0 +InteractionEvent 121 144 1 0 0 Shift_L 0 +MouseMoveEvent 124 148 1 0 0 Shift_L 0 +RenderEvent 124 148 1 0 0 Shift_L 0 +InteractionEvent 124 148 1 0 0 Shift_L 0 +MouseMoveEvent 125 151 1 0 0 Shift_L 0 +RenderEvent 125 151 1 0 0 Shift_L 0 +InteractionEvent 125 151 1 0 0 Shift_L 0 +MouseMoveEvent 126 152 1 0 0 Shift_L 0 +RenderEvent 126 152 1 0 0 Shift_L 0 +InteractionEvent 126 152 1 0 0 Shift_L 0 +MouseMoveEvent 127 154 1 0 0 Shift_L 0 +RenderEvent 127 154 1 0 0 Shift_L 0 +InteractionEvent 127 154 1 0 0 Shift_L 0 +MouseMoveEvent 128 156 1 0 0 Shift_L 0 +RenderEvent 128 156 1 0 0 Shift_L 0 +InteractionEvent 128 156 1 0 0 Shift_L 0 +MouseMoveEvent 131 158 1 0 0 Shift_L 0 +RenderEvent 131 158 1 0 0 Shift_L 0 +InteractionEvent 131 158 1 0 0 Shift_L 0 +MouseMoveEvent 132 160 1 0 0 Shift_L 0 +RenderEvent 132 160 1 0 0 Shift_L 0 +InteractionEvent 132 160 1 0 0 Shift_L 0 +MouseMoveEvent 133 162 1 0 0 Shift_L 0 +RenderEvent 133 162 1 0 0 Shift_L 0 +InteractionEvent 133 162 1 0 0 Shift_L 0 +MouseMoveEvent 136 164 1 0 0 Shift_L 0 +RenderEvent 136 164 1 0 0 Shift_L 0 +InteractionEvent 136 164 1 0 0 Shift_L 0 +MouseMoveEvent 137 165 1 0 0 Shift_L 0 +RenderEvent 137 165 1 0 0 Shift_L 0 +InteractionEvent 137 165 1 0 0 Shift_L 0 +MouseMoveEvent 139 166 1 0 0 Shift_L 0 +RenderEvent 139 166 1 0 0 Shift_L 0 +InteractionEvent 139 166 1 0 0 Shift_L 0 +MouseMoveEvent 139 167 1 0 0 Shift_L 0 +RenderEvent 139 167 1 0 0 Shift_L 0 +InteractionEvent 139 167 1 0 0 Shift_L 0 +MouseMoveEvent 140 167 1 0 0 Shift_L 0 +RenderEvent 140 167 1 0 0 Shift_L 0 +InteractionEvent 140 167 1 0 0 Shift_L 0 +MouseMoveEvent 140 168 1 0 0 Shift_L 0 +RenderEvent 140 168 1 0 0 Shift_L 0 +InteractionEvent 140 168 1 0 0 Shift_L 0 +MouseMoveEvent 141 168 1 0 0 Shift_L 0 +RenderEvent 141 168 1 0 0 Shift_L 0 +InteractionEvent 141 168 1 0 0 Shift_L 0 +MouseMoveEvent 142 169 1 0 0 Shift_L 0 +RenderEvent 142 169 1 0 0 Shift_L 0 +InteractionEvent 142 169 1 0 0 Shift_L 0 +MouseMoveEvent 143 169 1 0 0 Shift_L 0 +RenderEvent 143 169 1 0 0 Shift_L 0 +InteractionEvent 143 169 1 0 0 Shift_L 0 +MouseMoveEvent 143 170 1 0 0 Shift_L 0 +RenderEvent 143 170 1 0 0 Shift_L 0 +InteractionEvent 143 170 1 0 0 Shift_L 0 +MouseMoveEvent 144 170 1 0 0 Shift_L 0 +RenderEvent 144 170 1 0 0 Shift_L 0 +InteractionEvent 144 170 1 0 0 Shift_L 0 +MouseMoveEvent 145 171 1 0 0 Shift_L 0 +RenderEvent 145 171 1 0 0 Shift_L 0 +InteractionEvent 145 171 1 0 0 Shift_L 0 +MouseMoveEvent 146 172 1 0 0 Shift_L 0 +RenderEvent 146 172 1 0 0 Shift_L 0 +InteractionEvent 146 172 1 0 0 Shift_L 0 +MouseMoveEvent 146 173 1 0 0 Shift_L 0 +RenderEvent 146 173 1 0 0 Shift_L 0 +InteractionEvent 146 173 1 0 0 Shift_L 0 +MouseMoveEvent 147 173 1 0 0 Shift_L 0 +RenderEvent 147 173 1 0 0 Shift_L 0 +InteractionEvent 147 173 1 0 0 Shift_L 0 +MouseMoveEvent 147 174 1 0 0 Shift_L 0 +RenderEvent 147 174 1 0 0 Shift_L 0 +InteractionEvent 147 174 1 0 0 Shift_L 0 +MouseMoveEvent 148 174 1 0 0 Shift_L 0 +RenderEvent 148 174 1 0 0 Shift_L 0 +InteractionEvent 148 174 1 0 0 Shift_L 0 +MouseMoveEvent 148 175 1 0 0 Shift_L 0 +RenderEvent 148 175 1 0 0 Shift_L 0 +InteractionEvent 148 175 1 0 0 Shift_L 0 +MouseMoveEvent 149 175 1 0 0 Shift_L 0 +RenderEvent 149 175 1 0 0 Shift_L 0 +InteractionEvent 149 175 1 0 0 Shift_L 0 +MouseMoveEvent 150 176 1 0 0 Shift_L 0 +RenderEvent 150 176 1 0 0 Shift_L 0 +InteractionEvent 150 176 1 0 0 Shift_L 0 +MouseMoveEvent 151 177 1 0 0 Shift_L 0 +RenderEvent 151 177 1 0 0 Shift_L 0 +InteractionEvent 151 177 1 0 0 Shift_L 0 +MouseMoveEvent 152 180 1 0 0 Shift_L 0 +RenderEvent 152 180 1 0 0 Shift_L 0 +InteractionEvent 152 180 1 0 0 Shift_L 0 +MouseMoveEvent 155 181 1 0 0 Shift_L 0 +RenderEvent 155 181 1 0 0 Shift_L 0 +InteractionEvent 155 181 1 0 0 Shift_L 0 +MouseMoveEvent 156 184 1 0 0 Shift_L 0 +RenderEvent 156 184 1 0 0 Shift_L 0 +InteractionEvent 156 184 1 0 0 Shift_L 0 +MouseMoveEvent 158 185 1 0 0 Shift_L 0 +RenderEvent 158 185 1 0 0 Shift_L 0 +InteractionEvent 158 185 1 0 0 Shift_L 0 +MouseMoveEvent 158 186 1 0 0 Shift_L 0 +RenderEvent 158 186 1 0 0 Shift_L 0 +InteractionEvent 158 186 1 0 0 Shift_L 0 +MouseMoveEvent 159 187 1 0 0 Shift_L 0 +RenderEvent 159 187 1 0 0 Shift_L 0 +InteractionEvent 159 187 1 0 0 Shift_L 0 +LeftButtonReleaseEvent 159 187 1 0 0 Shift_L 0 +EndInteractionEvent 159 187 1 0 0 Shift_L 0 +RenderEvent 159 187 1 0 0 Shift_L 0 +KeyReleaseEvent 159 187 1 0 1 Shift_L 0 diff --git a/vtkext/private/module/vtkF3DImguiActor.cxx b/vtkext/private/module/vtkF3DImguiActor.cxx index 6a3b1c1224..e93109a378 100644 --- a/vtkext/private/module/vtkF3DImguiActor.cxx +++ b/vtkext/private/module/vtkF3DImguiActor.cxx @@ -113,14 +113,6 @@ struct vtkF3DImguiActor::Internals void RenderDrawData(vtkOpenGLRenderWindow* renWin, ImDrawData* drawData) { - // Avoid rendering when minimized, scale coordinates for retina displays - float fbWidth = drawData->DisplaySize.x * drawData->FramebufferScale.x; - float fbHeight = drawData->DisplaySize.y * drawData->FramebufferScale.y; - if (fbWidth <= 0.f || fbHeight <= 0.f) - { - return; - } - vtkOpenGLState* state = renWin->GetState(); vtkOpenGLState::ScopedglScissor save_scissorbox(state); @@ -186,6 +178,7 @@ struct vtkF3DImguiActor::Internals continue; // Apply scissor/clipping rectangle (Y is inverted in OpenGL) + float fbHeight = drawData->DisplaySize.y * drawData->FramebufferScale.y; state->vtkglScissor(static_cast(clipMin.x), static_cast(fbHeight - clipMax.y), static_cast(clipMax.x - clipMin.x), static_cast(clipMax.y - clipMin.y)); diff --git a/vtkext/private/module/vtkF3DInteractorStyle.cxx b/vtkext/private/module/vtkF3DInteractorStyle.cxx index 80d3e67414..608365f7f3 100644 --- a/vtkext/private/module/vtkF3DInteractorStyle.cxx +++ b/vtkext/private/module/vtkF3DInteractorStyle.cxx @@ -19,21 +19,11 @@ void vtkF3DInteractorStyle::OnLeftButtonDown() { this->FindPokedRenderer( this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1]); - if (this->CurrentRenderer == nullptr) - { - return; - } + assert(this->CurrentRenderer != nullptr); if (this->Interactor->GetShiftKey()) { - if (this->Interactor->GetControlKey()) - { - this->StartDolly(); - } - else - { - this->StartPan(); - } + this->StartPan(); } else { @@ -53,10 +43,6 @@ void vtkF3DInteractorStyle::OnLeftButtonUp() { switch (this->State) { - case VTKIS_DOLLY: - this->EndDolly(); - break; - case VTKIS_PAN: this->EndPan(); break; @@ -76,10 +62,7 @@ void vtkF3DInteractorStyle::OnMiddleButtonDown() { this->FindPokedRenderer( this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1]); - if (this->CurrentRenderer == nullptr) - { - return; - } + assert(this->CurrentRenderer != nullptr); this->StartPan(); } @@ -100,10 +83,7 @@ void vtkF3DInteractorStyle::OnRightButtonDown() { this->FindPokedRenderer( this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1]); - if (this->CurrentRenderer == nullptr) - { - return; - } + assert(this->CurrentRenderer != nullptr); if (this->Interactor->GetShiftKey()) {