Add basic tranlation functionality to the viewer

Had to separate zoom and translate matrices to stop the zoom being
applied to itelf. This also required adding separate get/set functions
for each matrix and a GetcombinedMatrix() funtion.

Added those functions ot other files where needed ut may be wrong. Need
to look at export.cpp

Also changed the mouse move and press events to make translation work.
This commit is contained in:
Thomas Wilshaw
2020-06-16 11:53:34 +01:00
parent f107c9bba1
commit 2174100342
4 changed files with 62 additions and 11 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ ViewerWidget::ViewerWidget(QWidget *parent) :
connect(display_widget_, &ViewerDisplayWidget::CursorColor, this, &ViewerWidget::CursorColor);
connect(display_widget_, &ViewerDisplayWidget::ColorProcessorChanged, this, &ViewerWidget::ColorProcessorChanged);
connect(display_widget_, &ViewerDisplayWidget::ColorManagerChanged, this, &ViewerWidget::ColorManagerChanged);
connect(sizer_, &ViewerSizer::RequestMatrix, display_widget_, &ViewerDisplayWidget::SetMatrix);
connect(sizer_, &ViewerSizer::RequestMatrix, display_widget_, &ViewerDisplayWidget::SetMatrixZoom);
sizer_->SetWidget(display_widget_);
// Create waveform view when audio is connected and video isn't
@@ -322,9 +322,9 @@ void ViewerWidget::SetOverrideSize(int width, int height)
void ViewerWidget::SetMatrix(const QMatrix4x4 &mat)
{
display_widget_->SetMatrix(mat);
display_widget_->SetMatrixZoom(mat);
foreach (ViewerWindow* vw, windows_) {
vw->display_widget()->SetMatrix(mat);
vw->display_widget()->SetMatrixZoom(mat);
}
}