mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 20:31:56 +02:00
[Lens Distortion Viewer] Remove control points on distortion viewer
Removing control points from the distortion viewer. Now we only display the principal point.
This commit is contained in:
parent
fdbc5fa974
commit
dc7ee20b02
3 changed files with 7 additions and 92 deletions
|
@ -37,7 +37,6 @@ AliceVision.FloatImageViewer {
|
||||||
root.updateSubdivisions(1);
|
root.updateSubdivisions(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.defaultControlPoints();
|
|
||||||
root.surface.setIdView(idView);
|
root.surface.setIdView(idView);
|
||||||
updateSfmPath();
|
updateSfmPath();
|
||||||
}
|
}
|
||||||
|
@ -51,7 +50,7 @@ AliceVision.FloatImageViewer {
|
||||||
|
|
||||||
property int gridOpacity : 100;
|
property int gridOpacity : 100;
|
||||||
|
|
||||||
property bool isCtrlPointsDisplayed : true;
|
property bool isPrincipalPointsDisplayed : false;
|
||||||
property int subdivisions: 4;
|
property int subdivisions: 4;
|
||||||
property int pointsNumber: (subdivisions + 1) * (subdivisions + 1);
|
property int pointsNumber: (subdivisions + 1) * (subdivisions + 1);
|
||||||
|
|
||||||
|
@ -76,20 +75,16 @@ AliceVision.FloatImageViewer {
|
||||||
|
|
||||||
//Putting states back where they were
|
//Putting states back where they were
|
||||||
if(isDistoViewer){
|
if(isDistoViewer){
|
||||||
//root.displayGrid(isGridDisplayed);
|
|
||||||
repeater.displayControlPoints(isCtrlPointsDisplayed)
|
|
||||||
root.updateSubdivisions(subdivisions)
|
root.updateSubdivisions(subdivisions)
|
||||||
}
|
}
|
||||||
//Forcing disabling of parameters
|
//Forcing disabling of parameters
|
||||||
else{
|
else{
|
||||||
root.displayGrid(isDistoViewer)
|
|
||||||
repeater.displayControlPoints(isDistoViewer)
|
|
||||||
root.updateSubdivisions(1)
|
root.updateSubdivisions(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onIsPanoViewerChanged: {
|
onIsPanoViewerChanged: {
|
||||||
//root.surface.setPanoViewerEnabled(isPanoViewer)
|
|
||||||
surface.viewerType = AliceVision.Surface.EViewerType.PANORAMA;
|
surface.viewerType = AliceVision.Surface.EViewerType.PANORAMA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,10 +93,6 @@ AliceVision.FloatImageViewer {
|
||||||
root.updateSubdivisions(subdivisions)
|
root.updateSubdivisions(subdivisions)
|
||||||
}
|
}
|
||||||
|
|
||||||
onIsCtrlPointsDisplayedChanged: {
|
|
||||||
repeater.displayControlPoints(isCtrlPointsDisplayed)
|
|
||||||
}
|
|
||||||
|
|
||||||
onGridOpacityChanged: {
|
onGridOpacityChanged: {
|
||||||
root.surface.gridColor = Qt.rgba(root.surface.gridColor.r, root.surface.gridColor.g, root.surface.gridColor.b, gridOpacity/100);
|
root.surface.gridColor = Qt.rgba(root.surface.gridColor.r, root.surface.gridColor.g, root.surface.gridColor.b, gridOpacity/100);
|
||||||
}
|
}
|
||||||
|
@ -161,7 +152,7 @@ AliceVision.FloatImageViewer {
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
color: "red"
|
color: "red"
|
||||||
visible: isDistoViewer && isCtrlPointsDisplayed
|
visible: isDistoViewer && isPrincipalPointsDisplayed
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
@ -172,80 +163,4 @@ AliceVision.FloatImageViewer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Controls Points
|
|
||||||
*/
|
|
||||||
Item {
|
|
||||||
id: points
|
|
||||||
width: root.width
|
|
||||||
height: root.height
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: root
|
|
||||||
onVerticesChanged : {
|
|
||||||
if (reinit){
|
|
||||||
points.recalculateCP();
|
|
||||||
points.generateControlPoints();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateControlPoints() {
|
|
||||||
if(repeater.model === pointsNumber){
|
|
||||||
repeater.model = 0;
|
|
||||||
}
|
|
||||||
repeater.model = pointsNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
function recalculateCP() {
|
|
||||||
if (repeater.model === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
var width = repeater.itemAt(0).width;
|
|
||||||
var height = repeater.itemAt(0).height;
|
|
||||||
|
|
||||||
for (let i = 0; i < repeater.model; i++) {
|
|
||||||
repeater.itemAt(i).x = root.surface.getVertex(i).x - (width / 2);
|
|
||||||
repeater.itemAt(i).y = root.surface.getVertex(i).y - (height / 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: point
|
|
||||||
Rectangle {
|
|
||||||
id: rect
|
|
||||||
width: root.sourceSize.width/100; height: width
|
|
||||||
radius: width/2
|
|
||||||
x: root.surface.getVertex(model.index).x - (width / 2)
|
|
||||||
y: root.surface.getVertex(model.index).y - (height / 2)
|
|
||||||
color: Colors.yellow
|
|
||||||
visible: isDistoViewer && isCtrlPointsDisplayed
|
|
||||||
MouseArea {
|
|
||||||
id: mouseAreaCP
|
|
||||||
anchors.fill : parent;
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
|
|
||||||
drag.target: rect
|
|
||||||
drag.smoothed: false
|
|
||||||
drag.axis: Drag.XAndYAxis
|
|
||||||
onReleased: {
|
|
||||||
root.setVertex(index, rect.x + (width / 2), rect.y + (height / 2))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: repeater
|
|
||||||
model: pointsNumber
|
|
||||||
delegate: point
|
|
||||||
function displayControlPoints(state) {
|
|
||||||
for (let i = 0; i < model; i++) {
|
|
||||||
if (repeater.itemAt(i) !== null)
|
|
||||||
repeater.itemAt(i).visible = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ FloatingPane {
|
||||||
|
|
||||||
property variant colorRGBA: null
|
property variant colorRGBA: null
|
||||||
property bool displayGrid: displayGridButton.checked
|
property bool displayGrid: displayGridButton.checked
|
||||||
property bool displayPoints: displayCtrlPointsButton.checked
|
property bool displayPrincipalPoint: displayPrincipalPointButton.checked
|
||||||
|
|
||||||
property var colors: [Colors.lightgrey, Colors.grey, Colors.red, Colors.green, Colors.blue, Colors.yellow]
|
property var colors: [Colors.lightgrey, Colors.grey, Colors.red, Colors.green, Colors.blue, Colors.yellow]
|
||||||
readonly property int colorIndex: (colorOffset) % root.colors.length
|
readonly property int colorIndex: (colorOffset) % root.colors.length
|
||||||
|
@ -38,8 +38,8 @@ FloatingPane {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
MaterialToolButton {
|
MaterialToolButton {
|
||||||
id: displayCtrlPointsButton
|
id: displayPrincipalPointButton
|
||||||
ToolTip.text: "Display Control Points"
|
ToolTip.text: "Display Principal Point"
|
||||||
text: MaterialIcons.control_point
|
text: MaterialIcons.control_point
|
||||||
font.pointSize: 13
|
font.pointSize: 13
|
||||||
padding: 5
|
padding: 5
|
||||||
|
|
|
@ -273,7 +273,7 @@ FocusScope {
|
||||||
'gamma': Qt.binding(function() { return hdrImageToolbar.gammaValue; }),
|
'gamma': Qt.binding(function() { return hdrImageToolbar.gammaValue; }),
|
||||||
'gain': Qt.binding(function() { return hdrImageToolbar.gainValue; }),
|
'gain': Qt.binding(function() { return hdrImageToolbar.gainValue; }),
|
||||||
'channelModeString': Qt.binding(function() { return hdrImageToolbar.channelModeValue; }),
|
'channelModeString': Qt.binding(function() { return hdrImageToolbar.channelModeValue; }),
|
||||||
'isCtrlPointsDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayPoints;}),
|
'isPrincipalPointsDisplayed' : Qt.binding(function(){ return lensDistortionImageToolbar.displayPrincipalPoint;}),
|
||||||
'surface.displayGrid' : Qt.binding(function(){ return lensDistortionImageToolbar.visible && lensDistortionImageToolbar.displayGrid;}),
|
'surface.displayGrid' : Qt.binding(function(){ return lensDistortionImageToolbar.visible && lensDistortionImageToolbar.displayGrid;}),
|
||||||
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
'gridOpacity' : Qt.binding(function(){ return lensDistortionImageToolbar.opacityValue;}),
|
||||||
'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
'surface.gridColor' : Qt.binding(function(){ return lensDistortionImageToolbar.color;}),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue