Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Viewer] Viewer: Fix various issues with the 2D Viewer #2278

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion meshroom/ui/qml/Viewer/PanoramaViewer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ AliceVision.PanoramaViewer {
'canBeHovered': true,
'useSequence': false
})
imageLoaded = Qt.binding(function() { return repeater.itemAt(index).item.status === Image.Ready ? true : false })
imageLoaded = Qt.binding(function() { return repeater.itemAt(index).item.imageStatus === Image.Ready ? true : false })
}

}
Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/Viewer/SequencePlayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ FloatingPane {
interval: 1000 / m.fps

onTriggered: {
if (viewer.status !== Image.Ready) {
if (viewer.imageStatus !== Image.Ready) {
// Wait for current image to be displayed before switching to next image
return;
}
Expand Down
35 changes: 19 additions & 16 deletions meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ FocusScope {
if (!imgContainer.image)
return ""
var res = ""
if (imgContainer.image.status === Image.Loading) {
if (imgContainer.image.imageStatus === Image.Loading) {
res += " Image"
}
if (mfeaturesLoader.status === Loader.Ready) {
Expand Down Expand Up @@ -372,7 +372,7 @@ FocusScope {

colorRGBA: {
if (!floatImageViewerLoader.item ||
floatImageViewerLoader.item.status !== Image.Ready) {
floatImageViewerLoader.item.imageStatus !== Image.Ready) {
return null
}
if (floatImageViewerLoader.item.containsMouse === false) {
Expand Down Expand Up @@ -681,7 +681,7 @@ FocusScope {
width: imgContainer.width
height: imgContainer.height

visible: activeNode.isComputed && json !== undefined && imgContainer.image.status === Image.Ready
visible: activeNode.isComputed && json !== undefined && imgContainer.image.imageStatus === Image.Ready
source: Filepath.stringToUrl(activeNode.attribute("outputData").value)
viewpoint: _reconstruction.selectedViewpoint
zoom: imgContainer.scale
Expand Down Expand Up @@ -750,7 +750,7 @@ FocusScope {
Layout.fillWidth: true
Layout.fillHeight: false
Layout.preferredHeight: childrenRect.height
visible: floatImageViewerLoader.item.imageStatus === Image.Error
visible: floatImageViewerLoader.item !== null && floatImageViewerLoader.item.imageStatus === Image.Error
Layout.alignment: Qt.AlignHCenter

RowLayout {
Expand All @@ -759,16 +759,19 @@ FocusScope {
Label {
font.pointSize: 8
text: {
switch (floatImageViewerLoader.item.status) {
case 2: // AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING
return "Outdated Loading"
case 3: // AliceVision.FloatImageViewer.EStatus.MISSING_FILE
return "Missing File"
case 4: // AliceVision.FloatImageViewer.EStatus.ERROR
return "Error"
default:
return ""
if (floatImageViewerLoader.item !== null) {
switch (floatImageViewerLoader.item.status) {
case 2: // AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING
return "Outdated Loading"
case 3: // AliceVision.FloatImageViewer.EStatus.MISSING_FILE
return "Missing File"
case 4: // AliceVision.FloatImageViewer.EStatus.ERROR
return "Error"
default:
return ""
}
}
return ""
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Expand Down Expand Up @@ -1041,7 +1044,7 @@ FocusScope {

// zoom label
MLabel {
text: ((imgContainer.image && (imgContainer.image.status === Image.Ready)) ? imgContainer.scale.toFixed(2) : "1.00") + "x"
text: ((imgContainer.image && (imgContainer.image.imageStatus === Image.Ready)) ? imgContainer.scale.toFixed(2) : "1.00") + "x"
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
Expand Down Expand Up @@ -1140,7 +1143,7 @@ FocusScope {
}

ToolTip.text: activeNode ? "Panorama Viewer " + activeNode.label : "Panorama Viewer"
text: MaterialIcons.panorama_sphere
text: MaterialIcons.panorama_photosphere
font.pointSize: 16
padding: 0
Layout.minimumWidth: 0
Expand Down Expand Up @@ -1386,7 +1389,7 @@ FocusScope {
Component.onCompleted: {
running = Qt.binding(function() {
return (root.usePanoramaViewer === true && imgContainer.image && imgContainer.image.allImagesLoaded === false)
|| (imgContainer.image && imgContainer.image.status === Image.Loading)
|| (imgContainer.image && imgContainer.image.imageStatus === Image.Loading)
})
}
// disable the visibility when unused to avoid stealing the mouseEvent to the image color picker
Expand Down