-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d03955f
Showing
16 changed files
with
557 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# C++ objects and libs | ||
*.slo | ||
*.lo | ||
*.o | ||
*.a | ||
*.la | ||
*.lai | ||
*.so | ||
*.so.* | ||
*.dll | ||
*.dylib | ||
|
||
# Qt-es | ||
object_script.*.Release | ||
object_script.*.Debug | ||
*_plugin_import.cpp | ||
/.qmake.cache | ||
/.qmake.stash | ||
*.pro.user | ||
*.pro.user.* | ||
*.qbs.user | ||
*.qbs.user.* | ||
*.moc | ||
moc_*.cpp | ||
moc_*.h | ||
qrc_*.cpp | ||
ui_*.h | ||
*.qmlc | ||
*.jsc | ||
Makefile* | ||
*build-* | ||
*.qm | ||
*.prl | ||
|
||
# Qt unit tests | ||
target_wrapper.* | ||
|
||
# QtCreator | ||
*.autosave | ||
|
||
# QtCreator Qml | ||
*.qmlproject.user | ||
*.qmlproject.user.* | ||
|
||
# QtCreator CMake | ||
CMakeLists.txt.user* | ||
|
||
# QtCreator 4.8< compilation database | ||
compile_commands.json | ||
|
||
# QtCreator local machine specific files for imported projects | ||
*creator.user* | ||
|
||
*_qmlcache.qrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(rgbd_viewer LANGUAGES CXX) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Quick3D) | ||
|
||
qt_add_executable(rgbd_viewer | ||
src/main.cpp | ||
) | ||
|
||
set_target_properties(rgbd_viewer PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
MACOSX_BUNDLE TRUE | ||
) | ||
|
||
target_link_libraries(rgbd_viewer PUBLIC | ||
Qt::Core | ||
Qt::Gui | ||
Qt::Quick | ||
Qt::Quick3D | ||
) | ||
|
||
target_include_directories(rgbd_viewer PRIVATE src) | ||
|
||
qt_add_qml_module(rgbd_viewer | ||
URI TexturedSurfaceGeometry | ||
VERSION 1.0 | ||
QML_FILES | ||
src/qml/Main.qml | ||
src/qml/Viewer.qml | ||
src/qml/ImageDialog.qml | ||
src/qml/CustomButton.qml | ||
src/qml/CustomDialog.qml | ||
SOURCES | ||
src/surfacegeometry.cpp src/surfacegeometry.h | ||
IMPORTS | ||
QtQuick3D | ||
) | ||
|
||
file(COPY img icons DESTINATION ${CMAKE_BINARY_DIR}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
#include <QtQuick3D/qquick3d.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QGuiApplication app(argc, argv); | ||
|
||
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat()); | ||
|
||
QQmlApplicationEngine engine; | ||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, | ||
&app, []() { QCoreApplication::exit(-1); }, | ||
Qt::QueuedConnection); | ||
engine.loadFromModule("TexturedSurfaceGeometry", "Main"); | ||
|
||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
|
||
RoundButton { | ||
id: button | ||
|
||
icon.color: button.hovered ? "black" : "lightgray" | ||
icon.width: button.pressed ? 36 : 32 | ||
icon.height: button.pressed ? 36 : 32 | ||
|
||
background: Rectangle { | ||
color: "transparent" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
|
||
Dialog { | ||
modal: true | ||
closePolicy: Popup.CloseOnEscape | ||
x: (parent.width - width) / 2 | ||
y: (parent.height - height) / 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import QtQuick.Dialogs | ||
|
||
FileDialog { | ||
nameFilters: ["Image Files (*.jpg *.jpeg *.png)"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
import QtQuick.Dialogs | ||
import QtQuick3D | ||
|
||
ApplicationWindow { | ||
id: window | ||
width: 1280 | ||
height: 720 | ||
visible: true | ||
title: "RGBD Viewer" | ||
|
||
ImageDialog { | ||
id: textureImagePathDialog | ||
onAccepted: { | ||
viewer.textureImagePath = selectedFile | ||
texturePath.text = selectedFile | ||
} | ||
} | ||
|
||
ImageDialog { | ||
id: depthImagePathDialog | ||
onAccepted: { | ||
viewer.depthImagePath = selectedFile | ||
depthPath.text = selectedFile | ||
} | ||
} | ||
|
||
Viewer { | ||
id: viewer | ||
textureImagePath: "file:img/texture.jpg" | ||
depthImagePath: "file:img/depth.jpg" | ||
} | ||
|
||
CustomButton { | ||
id: settingsButton | ||
|
||
anchors.horizontalCenter: parent.right | ||
anchors.verticalCenter: parent.bottom | ||
anchors.horizontalCenterOffset: -40 | ||
anchors.verticalCenterOffset: -40 | ||
|
||
icon.source: "file:icons/gear.png" | ||
|
||
onClicked: settingsDialog.open() | ||
} | ||
|
||
CustomButton { | ||
id: helpButton | ||
|
||
anchors.horizontalCenter: parent.right | ||
anchors.verticalCenter: parent.bottom | ||
anchors.horizontalCenterOffset: -40 | ||
anchors.verticalCenterOffset: -90 | ||
|
||
icon.source: "file:icons/questionmark.png" | ||
|
||
onClicked: helpDialog.open() | ||
} | ||
|
||
CustomDialog { | ||
id: settingsDialog | ||
title: "Settings" | ||
standardButtons: Dialog.Close | ||
width: 400 | ||
|
||
GridLayout { | ||
id: mainLayout | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
columns: 3 | ||
uniformCellWidths: false | ||
|
||
Label { | ||
text: "Texture Image" | ||
} | ||
|
||
TextField { | ||
id: texturePath | ||
placeholderText: "Texture File Path" | ||
Layout.fillWidth: true | ||
readOnly: true | ||
} | ||
|
||
Button { | ||
text: "Browse..." | ||
onPressed: textureImagePathDialog.open() | ||
} | ||
|
||
Label { | ||
text: "Depth Image" | ||
} | ||
|
||
TextField { | ||
id: depthPath | ||
placeholderText: "Depth File Path" | ||
Layout.fillWidth: true | ||
readOnly: true | ||
} | ||
|
||
Button { | ||
text: "Browse..." | ||
onPressed: depthImagePathDialog.open() | ||
} | ||
} | ||
} | ||
|
||
CustomDialog { | ||
id: helpDialog | ||
title: "Help" | ||
standardButtons: Dialog.Ok | ||
|
||
Text { | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
|
||
text: [ | ||
"• Use [Left Mouse Button] to rotate the model in 3D space\n", | ||
"• Use [Mouse Wheel] to zoom in and out on the model\n", | ||
"• Use [SHIFT] + [Mouse Wheel] to change the depth map scale\n", | ||
"• The model will start rotating automatically after 5s of inactivity" | ||
].join("") | ||
} | ||
} | ||
} |
Oops, something went wrong.