Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Nov 26, 2024
1 parent 81a959f commit 261d012
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 32 deletions.
1 change: 1 addition & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions testing/baselines/TestInteractionPanWithShift.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions testing/recordings/TestInteractionHDRIMove.log
Original file line number Diff line number Diff line change
Expand Up @@ -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
232 changes: 232 additions & 0 deletions testing/recordings/TestInteractionPanWithShift.log
Original file line number Diff line number Diff line change
@@ -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
9 changes: 1 addition & 8 deletions vtkext/private/module/vtkF3DImguiActor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<GLint>(clipMin.x), static_cast<GLint>(fbHeight - clipMax.y),
static_cast<GLsizei>(clipMax.x - clipMin.x), static_cast<GLsizei>(clipMax.y - clipMin.y));

Expand Down
28 changes: 4 additions & 24 deletions vtkext/private/module/vtkF3DInteractorStyle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -53,10 +43,6 @@ void vtkF3DInteractorStyle::OnLeftButtonUp()
{
switch (this->State)
{
case VTKIS_DOLLY:
this->EndDolly();
break;

case VTKIS_PAN:
this->EndPan();
break;
Expand All @@ -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();
}
Expand All @@ -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())
{
Expand Down

0 comments on commit 261d012

Please sign in to comment.