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

Add SfM Statistics #873

Merged
merged 13 commits into from
May 30, 2020
57 changes: 57 additions & 0 deletions meshroom/ui/qml/Charts/InteractiveChartView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import MaterialIcons 2.2
import QtPositioning 5.8
import QtLocation 5.9

import QtCharts 2.13

import Controls 1.0
import Utils 1.0


ChartView {
id: root
antialiasing: true

Rectangle {
id: plotZone
x: root.plotArea.x
y: root.plotArea.y
width: root.plotArea.width
height: root.plotArea.height
color: "transparent"

MouseArea {
anchors.fill: parent

property double degreeToScale: 1.0 / 120.0 // default mouse scroll is 15 degree
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
// onWheel: {
// console.warn("root.plotArea before: " + root.plotArea)
// var zoomFactor = wheel.angleDelta.y > 0 ? 1.0 / (1.0 + wheel.angleDelta.y * degreeToScale) : (1.0 + Math.abs(wheel.angleDelta.y) * degreeToScale)

// // var mouse_screen = Qt.point(wheel.x, wheel.y)
// var mouse_screen = mapToItem(root, wheel.x, wheel.y)
// var mouse_normalized = Qt.point(mouse_screen.x / plotZone.width, mouse_screen.y / plotZone.height)
// var mouse_plot = Qt.point(mouse_normalized.x * plotZone.width, mouse_normalized.y * plotZone.height)

// // var p = mapToValue(mouse_screen, root.series(0))
// // var pMin = mapToValue(mouse_screen, Qt.point(root.axisX().min, root.axisY().min))
// // var pMax = mapToValue(mouse_screen, Qt.point(root.axisX().max, root.axisY().max))
// // console.warn("p: " + p)

// // Qt.rect()
// var r = Qt.rect(mouse_plot.x, mouse_plot.y, plotZone.width * zoomFactor, plotZone.height * zoomFactor)
// //var r = Qt.rect(pMin.x, pMin.y, (pMax.x-pMin.x) / 2, (pMax.y-pMin.y) / 2)
// root.zoomIn(r)
// }
onClicked: {
root.zoomReset();
}
}
}


}
1 change: 1 addition & 0 deletions meshroom/ui/qml/Charts/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ module Charts

ChartViewLegend 1.0 ChartViewLegend.qml
ChartViewCheckBox 1.0 ChartViewCheckBox.qml
InteractiveChartView 1.0 InteractiveChartView.qml
27 changes: 24 additions & 3 deletions meshroom/ui/qml/Controls/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Page {
property alias headerBar: headerLayout.data
property alias footerContent: footerLayout.data
property alias icon: iconPlaceHolder.data
property alias loading: loadingIndicator.running
property alias loadingText: loadingLabal.text

clip: true

Expand Down Expand Up @@ -46,18 +48,37 @@ Page {
width: childrenRect.width
height: childrenRect.height
Layout.alignment: Qt.AlignVCenter
visible: icon != ""
visible: icon !== ""
}

// Title
Label {
text: root.title
Layout.fillWidth: true
elide: Text.ElideRight
topPadding: m.vPadding
bottomPadding: m.vPadding
}
//
Item {
width: 10
}
// Feature loading status
BusyIndicator {
id: loadingIndicator
padding: 0
implicitWidth: 12
implicitHeight: 12
running: false
}
Label {
id: loadingLabal
text: ""
font.italic: true
}
Item {
Layout.fillWidth: true
}

// Header menu
Row { id: headerLayout }
}
}
Expand Down
7 changes: 4 additions & 3 deletions meshroom/ui/qml/GraphEditor/StatViewer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Utils 1.0
import Charts 1.0
import MaterialIcons 2.2


Item {
id: root

Expand Down Expand Up @@ -364,7 +365,7 @@ Item {
}
}

ChartView {
InteractiveChartView {
id: cpuChart

Layout.fillWidth: true
Expand Down Expand Up @@ -419,7 +420,7 @@ Item {

ColumnLayout {

ChartView {
InteractiveChartView {
id: ramChart
margins.top: 0
margins.bottom: 0
Expand Down Expand Up @@ -487,7 +488,7 @@ Item {
ColumnLayout {


ChartView {
InteractiveChartView {
id: gpuChart

Layout.fillWidth: true
Expand Down
58 changes: 50 additions & 8 deletions meshroom/ui/qml/Viewer/FeaturesInfoOverlay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ FloatingPane {
property var featureExtractionNode: null

ColumnLayout {

// Header
RowLayout {
// FeatureExtraction node name
Label {
text: featureExtractionNode.label
text: featureExtractionNode ? featureExtractionNode.label : ""
Layout.fillWidth: true
}
// Settings menu
Expand All @@ -47,6 +46,7 @@ FloatingPane {
flat: true
Layout.fillWidth: true
model: root.featuresViewer.displayModes
currentIndex: root.featuresViewer.displayMode
onActivated: root.featuresViewer.displayMode = currentIndex
}
}
Expand All @@ -73,38 +73,80 @@ FloatingPane {
id: featureType

property var viewer: root.featuresViewer.itemAt(index)

spacing: 4

// Visibility toogle
// Features visibility toogle
MaterialToolButton {
text: featureType.viewer.visible ? MaterialIcons.visibility : MaterialIcons.visibility_off
onClicked: featureType.viewer.visible = !featureType.viewer.visible
id: featuresVisibilityButton
checkable: true
checked: true
text: MaterialIcons.center_focus_strong
onClicked: {
console.warn("featuresVisibilityButton.checked: " + featuresVisibilityButton.checked)
featureType.viewer.displayfeatures = featuresVisibilityButton.checked;
}
font.pointSize: 10
opacity: featureType.viewer.visible ? 1.0 : 0.6
}

// Tracks visibility toogle
MaterialToolButton {
id: tracksVisibilityButton
checkable: true
checked: true
text: MaterialIcons.timeline
onClicked: {
console.warn("tracksVisibilityButton.checked: " + tracksVisibilityButton.checked)
featureType.viewer.displayTracks = tracksVisibilityButton.checked;
}
font.pointSize: 10
}

// Landmarks visibility toogle
MaterialToolButton {
id: landmarksVisibilityButton
checkable: true
checked: true
text: MaterialIcons.fiber_manual_record
onClicked: {
console.warn("landmarksVisibilityButton.checked: " + landmarksVisibilityButton.checked)
featureType.viewer.displayLandmarks = landmarksVisibilityButton.checked;
}
font.pointSize: 10
}

// ColorChart picker
ColorChart {
implicitWidth: 12
implicitHeight: implicitWidth
colors: root.featuresViewer.colors
currentIndex: featureType.viewer.colorIndex
// offset featuresViewer color set when changing the color of one feature type
onColorPicked: root.featuresViewer.colorOffset = colorIndex - index
onColorPicked: featureType.viewer.colorOffset = colorIndex - index
}
// Feature type name
Label {
text: featureType.viewer.describerType + (featureType.viewer.loading ? "" : ": " + featureType.viewer.features.length)
text: {
if(featureType.viewer.loadingFeatures)
return featureType.viewer.describerType;
return featureType.viewer.describerType + ": " +
featureType.viewer.features.length + " / " +
(featureType.viewer.haveValidTracks ? featureType.viewer.nbTracks : " - ") + " / " +
(featureType.viewer.haveValidLandmarks ? featureType.viewer.nbLandmarks : " - ");
}
}
// Feature loading status
Loader {
active: featureType.viewer.loading
active: featureType.viewer.loadingFeatures
sourceComponent: BusyIndicator {
padding: 0
implicitWidth: 12
implicitHeight: 12
running: true
}
}

}
}
}
Expand Down
20 changes: 13 additions & 7 deletions meshroom/ui/qml/Viewer/FeaturesViewer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,35 @@ Repeater {

/// ViewID to display the features of
property int viewId
/// SfMData to display the data of SfM
property var sfmData
/// Folder containing the features files
property string folder
property string featureFolder
/// Folder containing the matches files
property var tracks
/// The list of describer types to load
property alias describerTypes: root.model
/// List of available display modes
readonly property var displayModes: ['Points', 'Squares', 'Oriented Squares']
/// Current display mode index
property int displayMode: 0
property int displayMode: 2
/// The list of colors used for displaying several describers
property var colors: [Colors.blue, Colors.red, Colors.yellow, Colors.green, Colors.orange, Colors.cyan, Colors.pink, Colors.lime]
/// Offset the color list
property int colorOffset: 0
property var colors: [Colors.blue, Colors.green, Colors.yellow, Colors.orange, Colors.cyan, Colors.pink, Colors.lime] //, Colors.red

model: root.describerTypes

// instantiate one FeaturesViewer by describer type
delegate: AliceVision.FeaturesViewer {
readonly property int colorIndex: (index+root.colorOffset)%root.colors.length
readonly property int colorIndex: (index + colorOffset) % root.colors.length
property int colorOffset: 0
describerType: modelData
folder: root.folder
featureFolder: root.featureFolder
mtracks: root.tracks
viewId: root.viewId
color: root.colors[colorIndex]
landmarkColor: Colors.red
displayMode: root.displayMode
msfmData: root.sfmData
}

}
1 change: 1 addition & 0 deletions meshroom/ui/qml/Viewer/ImageMetadataView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FloatingPane {

clip: true
padding: 4
anchors.rightMargin: 0

/**
* Convert GPS metadata to degree coordinates.
Expand Down
7 changes: 7 additions & 0 deletions meshroom/ui/qml/Viewer/MSfMData.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import QtQuick 2.11
import AliceVision 1.0 as AliceVision

// Data from the SfM
AliceVision.MSfMData {
id: root
}
6 changes: 6 additions & 0 deletions meshroom/ui/qml/Viewer/MTracks.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import QtQuick 2.11
import AliceVision 1.0 as AliceVision

AliceVision.MTracks {
id: root
}
Loading