diff --git a/meshroom/ui/qml/Viewer/MayaCameraController.qml b/meshroom/ui/qml/Viewer/MayaCameraController.qml deleted file mode 100644 index b5a5ea39..00000000 --- a/meshroom/ui/qml/Viewer/MayaCameraController.qml +++ /dev/null @@ -1,128 +0,0 @@ -import QtQuick 2.7 -import Qt3D.Core 2.1 -import Qt3D.Render 2.1 -import Qt3D.Input 2.1 -//import Qt3D.Extras 2.0 -import Qt3D.Logic 2.0 -import QtQml 2.2 - -Entity { - - id: root - property Camera camera - property real translateSpeed: 100.0 - property real tiltSpeed: 500.0 - property real panSpeed: 500.0 - property bool moving: false - - signal mousePressed(var mouse) - signal mouseReleased(var mouse) - signal mouseWheeled(var wheel) - - KeyboardDevice { id: keyboardSourceDevice } - MouseDevice { id: mouseSourceDevice; sensitivity: 0.1 } - - MouseHandler { - - sourceDevice: mouseSourceDevice - onPressed: mousePressed(mouse) - onReleased: mouseReleased(mouse) - onWheel: { - var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.05; - var tz = (wheel.angleDelta.y / 120) * d; - root.camera.translate(Qt.vector3d(0, 0, tz), Camera.DontTranslateViewCenter) - } - } - - LogicalDevice { - id: cameraControlDevice - actions: [ - Action { - id: actionLMB - inputs: [ - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.LeftButton] - } - ] - }, - Action { - id: actionRMB - inputs: [ - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.RightButton] - } - ] - }, - Action { - id: actionMMB - inputs: [ - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.MiddleButton] - } - ] - }, - Action { - id: actionAlt - onActiveChanged: root.moving = active - inputs: [ - ActionInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Alt] - } - ] - } - ] - axes: [ - Axis { - id: axisMX - inputs: [ - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.X - } - ] - }, - Axis { - id: axisMY - inputs: [ - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.Y - } - ] - } - ] - } - - components: [ - FrameAction { - onTriggered: { - if(!actionAlt.active) - return; - if(actionLMB.active) { // rotate - var rx = -axisMX.value; - var ry = -axisMY.value; - root.camera.panAboutViewCenter(root.panSpeed * rx * dt, Qt.vector3d(0,1,0)) - root.camera.tiltAboutViewCenter(root.tiltSpeed * ry * dt) - return; - } - if(actionMMB.active) { // translate - var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03; - var tx = axisMX.value * root.translateSpeed * d; - var ty = axisMY.value * root.translateSpeed * d; - root.camera.translate(Qt.vector3d(-tx, -ty, 0).times(dt)) - return; - } - if(actionRMB.active) { // zoom - var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.05; - var tz = axisMX.value * root.translateSpeed * d; - root.camera.translate(Qt.vector3d(0, 0, tz).times(dt), Camera.DontTranslateViewCenter) - return; - } - } - } - ] -} diff --git a/meshroom/ui/qml/Viewer/qmldir b/meshroom/ui/qml/Viewer/qmldir index f0788027..f715f431 100644 --- a/meshroom/ui/qml/Viewer/qmldir +++ b/meshroom/ui/qml/Viewer/qmldir @@ -2,9 +2,3 @@ module Viewer Viewer2D 1.0 Viewer2D.qml ImageMetadataView 1.0 ImageMetadataView.qml -Viewer3D 1.0 Viewer3D.qml -DefaultCameraController 1.0 DefaultCameraController.qml -MayaCameraController 1.0 MayaCameraController.qml -Locator3D 1.0 Locator3D.qml -Grid3D 1.0 Grid3D.qml - diff --git a/meshroom/ui/qml/Viewer/AlembicLoader.qml b/meshroom/ui/qml/Viewer3D/AlembicLoader.qml similarity index 100% rename from meshroom/ui/qml/Viewer/AlembicLoader.qml rename to meshroom/ui/qml/Viewer3D/AlembicLoader.qml diff --git a/meshroom/ui/qml/Viewer/DefaultCameraController.qml b/meshroom/ui/qml/Viewer3D/DefaultCameraController.qml similarity index 100% rename from meshroom/ui/qml/Viewer/DefaultCameraController.qml rename to meshroom/ui/qml/Viewer3D/DefaultCameraController.qml diff --git a/meshroom/ui/qml/Viewer/DepthMapLoader.qml b/meshroom/ui/qml/Viewer3D/DepthMapLoader.qml similarity index 100% rename from meshroom/ui/qml/Viewer/DepthMapLoader.qml rename to meshroom/ui/qml/Viewer3D/DepthMapLoader.qml diff --git a/meshroom/ui/qml/Viewer/Grid3D.qml b/meshroom/ui/qml/Viewer3D/Grid3D.qml similarity index 100% rename from meshroom/ui/qml/Viewer/Grid3D.qml rename to meshroom/ui/qml/Viewer3D/Grid3D.qml diff --git a/meshroom/ui/qml/Viewer/Locator3D.qml b/meshroom/ui/qml/Viewer3D/Locator3D.qml similarity index 100% rename from meshroom/ui/qml/Viewer/Locator3D.qml rename to meshroom/ui/qml/Viewer3D/Locator3D.qml diff --git a/meshroom/ui/qml/Viewer/MaterialSwitcher.qml b/meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml similarity index 100% rename from meshroom/ui/qml/Viewer/MaterialSwitcher.qml rename to meshroom/ui/qml/Viewer3D/MaterialSwitcher.qml diff --git a/meshroom/ui/qml/Viewer/Materials/WireframeEffect.qml b/meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml similarity index 100% rename from meshroom/ui/qml/Viewer/Materials/WireframeEffect.qml rename to meshroom/ui/qml/Viewer3D/Materials/WireframeEffect.qml diff --git a/meshroom/ui/qml/Viewer/Materials/WireframeMaterial.qml b/meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml similarity index 100% rename from meshroom/ui/qml/Viewer/Materials/WireframeMaterial.qml rename to meshroom/ui/qml/Viewer3D/Materials/WireframeMaterial.qml diff --git a/meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.frag b/meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.frag similarity index 100% rename from meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.frag rename to meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.frag diff --git a/meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.geom b/meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.geom similarity index 100% rename from meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.geom rename to meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.geom diff --git a/meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.vert b/meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.vert similarity index 100% rename from meshroom/ui/qml/Viewer/Materials/shaders/robustwireframe.vert rename to meshroom/ui/qml/Viewer3D/Materials/shaders/robustwireframe.vert diff --git a/meshroom/ui/qml/Viewer/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml similarity index 100% rename from meshroom/ui/qml/Viewer/Viewer3D.qml rename to meshroom/ui/qml/Viewer3D/Viewer3D.qml diff --git a/meshroom/ui/qml/Viewer3D/qmldir b/meshroom/ui/qml/Viewer3D/qmldir new file mode 100644 index 00000000..81a62925 --- /dev/null +++ b/meshroom/ui/qml/Viewer3D/qmldir @@ -0,0 +1,6 @@ +module Viewer3D + +Viewer3D 1.0 Viewer3D.qml +DefaultCameraController 1.0 DefaultCameraController.qml +Locator3D 1.0 Locator3D.qml +Grid3D 1.0 Grid3D.qml diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index b19e50f0..1d3e3bc4 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -4,6 +4,7 @@ import QtQuick.Controls 1.4 as Controls1 // For SplitView import QtQuick.Layouts 1.3 import Qt.labs.platform 1.0 as Platform import Viewer 1.0 +import Viewer3D 1.0 import MaterialIcons 2.2 import Utils 1.0