Skip to content

Commit 8de9c55

Browse files
committed
[qml] Viewer2D: Add ShapeViewer loader
1 parent 4ca4802 commit 8de9c55

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

meshroom/ui/qml/Viewer/Viewer2D.qml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,32 @@ FocusScope {
832832
}
833833
}
834834

835+
// ShapeViewer: display shapes and texts from current node shape attributes and json files
836+
// Note: use a Loader
837+
ExifOrientedViewer {
838+
anchors.centerIn: parent
839+
width: imgContainer.width
840+
height: imgContainer.height
841+
xOrigin: imgContainer.width * 0.5
842+
yOrigin: imgContainer.height * 0.5
843+
orientationTag: imgContainer.orientationTag
844+
active: _reconstruction ? (_reconstruction.selectedNode ? _reconstruction.selectedNode.hasDisplayableShape : false) : false
845+
846+
onActiveChanged: {
847+
if (active) {
848+
setSource("../Shapes/Viewer/ShapeViewer.qml", {
849+
"containerWidth": Qt.binding(function() { return imgContainer.width }),
850+
"containerHeight": Qt.binding(function() { return imgContainer.height }),
851+
"containerScale": Qt.binding(function() { return imgContainer.scale })
852+
})
853+
} else {
854+
// forcing the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
855+
setSource("", {})
856+
857+
}
858+
}
859+
}
860+
835861
// FisheyeCircleViewer: display fisheye circle
836862
// Note: use a Loader to evaluate if a PanoramaInit node exist and displayFisheyeCircle checked at runtime
837863
ExifOrientedViewer {

0 commit comments

Comments
 (0)