Skip to content

Commit 60ff28e

Browse files
authored
Merge pull request #30 from nikolaseu/chore-use-pointcloud-lib
Use pointcloud lib for scanner
2 parents 6c950b9 + 4d4a803 commit 60ff28e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1077
-1621
lines changed

.travis.yml

+25-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@ language: cpp
22
compiler: clang++
33
os: osx
44
osx_image: xcode9.4
5-
65
before_install:
7-
# https://github.com/travis-ci/travis-ci/issues/6688
8-
#- /usr/bin/yes | pip2 uninstall numpy # seems not necessary anymore for xcode9.4 images
9-
# https://github.com/travis-ci/travis-ci/issues/8826
10-
- brew cask uninstall oclint # still necessary for xcode9.3, xcode9.4 images
11-
- brew update && brew bundle
12-
6+
- brew cask uninstall oclint # still necessary for xcode9.3, xcode9.4 images https://github.com/travis-ci/travis-ci/issues/8826
7+
- brew update && brew bundle
138
script:
14-
- cd build
15-
- $(brew --prefix qt)/bin/qmake ../NEUVision.pro
16-
- make
9+
- cd $TRAVIS_BUILD_DIR/build
10+
- "$(brew --prefix qt)/bin/qmake ../NEUVision.pro"
11+
- make
12+
before_deploy:
13+
- cd $TRAVIS_BUILD_DIR/bin/release5
14+
- "$(brew --prefix qt)/bin/macdeployqt Z3DScanner.app -libpath=. -qmldir=../../Z3DScanner/qml"
15+
- "$(brew --prefix qt)/bin/macdeployqt Z3DCloudViewer.app -libpath=. -qmldir=../../Z3DCloudViewer/qml"
16+
- "$(brew --prefix qt)/bin/macdeployqt Z3DCameraViewer.app -libpath=."
17+
- "$(brew --prefix qt)/bin/macdeployqt Z3DCameraCalibration.app -libpath=."
18+
- "$(brew --prefix qt)/bin/macdeployqt Z3DMultiCameraCalibration.app -libpath=."
19+
#deploy:
20+
# provider: releases
21+
# api_key:
22+
# secure: "18Pmq79NxWaZlwcI4SBJAAXdkhp6sb4h5GSlUhtxhx5D/FCiyYYfKYBBYM/F5O/hklrIOVuGz8TzQ2iKgRxUPlXli804EO0CWWT/FpsniBVhoRNme47EsXpD+pPeQ9YlGwW5bAWUiB9gIxYzLOo/jx/6kEjNujY+CLbfqh5YOs/tpH+dDdGRSR/tAGM5uxPlf16kxgFOeiKlhFTRR5ESGMsL/zo//stoa1Yc1GdlVtguSoyiuSyyWd3zqQrpsCWorusDH6wGyKRiatMhCnKFYDuE4jguSTO0+659YT1ZbiNWQ1IQxFRfDslzVh1FjtZ7CjvNk7nGH747wdW7EOOzJjPhdSh0KU5qWkSk6dNC9f0hikriHrLAePAjL1fGRaF9K5l4xf7cWpoN2oWclra5RlbAJ0Pe7zmQInqdCHho2uxgNmpouqefm0sBlOIheIxNTdIClcOTr4eYfplj58LXV61CZE0TAS1hn0ImrisaPmcejj7vyJp0EhFQ9PMZTIgDEvQv/MFB65a0quNW7chL6/EnvZ8WkeVB1mj7MKK4I7WSpNhb+A6kI/o3MkEPTM6k0gFNYoMIWY9FG80S+0XcMM+xMBsdUNNlGoTNcgC2DOZdr/Tmjf8NeOC9rnfCV/Q7InVvbP7KTe9AMq2nlse9y8hXR+BuU1+7wjnZI7hzPMA="
23+
# file_glob: true
24+
# file: $TRAVIS_BUILD_DIR/bin/release5/*.app
25+
# skip_cleanup: true
26+
# on:
27+
# repo: nikolaseu/neuvision
28+
# #all_branches: true
29+
# tags: true
30+
# draft: true
31+
# prerelease: true

NEUVision.pro

-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ Z3DCameraViewer.depends = lib
1717
SUBDIRS += Z3DScanner
1818
Z3DScanner.depends = lib
1919

20-
!win32:{
2120
SUBDIRS += Z3DCloudViewer
2221
Z3DCloudViewer.depends = lib
23-
}
2422

2523
message('Projects that will be built:' $$SUBDIRS)
2624

Z3DCloudViewer/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
int main(int argc, char *argv[])
3131
{
3232
QSurfaceFormat glFormat;
33-
glFormat.setVersion(3, 3);
33+
glFormat.setVersion(3, 2);
3434
glFormat.setProfile(QSurfaceFormat::CoreProfile);
3535
QSurfaceFormat::setDefaultFormat(glFormat);
3636

Z3DCloudViewer/qml/BackgroundEntity.qml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import QtQuick 2.1 as QQ2
1+
import QtQuick 2.10 as QQ2
22
import Qt3D.Core 2.0
33
import Qt3D.Render 2.0
44
import Qt3D.Extras 2.0

Z3DCloudViewer/qml/main.qml

+113-84
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,21 @@ import Qt3D.Extras 2.0
33
import Qt3D.Input 2.0
44
import Qt3D.Render 2.0
55

6-
import QtQuick 2.4
7-
import QtQuick.Controls 1.4 as QQControls1 // I want native platform looking menu :(
8-
import QtQuick.Controls 2.4 // .. but flat/simpler sliders and buttons
6+
import QtQuick 2.10
7+
import QtQuick.Controls 2.3
98
import QtQuick.Dialogs 1.3
10-
import QtQuick.Layouts 1.1
9+
import QtQuick.Layouts 1.3
1110
import QtQuick.Scene3D 2.0
1211

1312
import Z3D.PointCloud 1.0
1413

15-
QQControls1.ApplicationWindow {
14+
ApplicationWindow {
1615
id: window
1716
title: qsTr("Point cloud viewer")
1817
width: 1200
1918
height: 800
2019
visible: true
2120

22-
menuBar: QQControls1.MenuBar {
23-
id: menuBar
24-
25-
QQControls1.Menu {
26-
id: fileMenu
27-
title: qsTr("File")
28-
29-
QQControls1.MenuItem {
30-
text: qsTr("Open file ...")
31-
onTriggered: fileDialog.open()
32-
}
33-
}
34-
}
35-
3621
FileDialog {
3722
id: fileDialog
3823
title: qsTr("Open a point cloud")
@@ -48,13 +33,12 @@ QQControls1.ApplicationWindow {
4833
//filename: "/Users/nikolaseu/Downloads/something.ply"
4934
}
5035

51-
RowLayout {
36+
Item {
5237
anchors.fill: parent
5338

5439
Scene3D {
5540
id: scene3d
56-
Layout.fillWidth: true
57-
Layout.fillHeight: true
41+
anchors.fill: parent
5842

5943
aspects: ["input", "logic"]
6044
cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
@@ -116,87 +100,132 @@ QQControls1.ApplicationWindow {
116100
}
117101
}
118102

119-
ColumnLayout {
120-
Layout.fillHeight: true
121-
Layout.minimumWidth: 200
122-
Layout.maximumWidth: 200
123-
Layout.margins: 16
103+
RowLayout {
104+
anchors.right: parent.right
105+
anchors.top: parent.top
106+
anchors.margins: 4
107+
opacity: mouseArea.containsMouse ? 1 : 0.3
108+
visible: pointCloudReader.pointCloud
124109

125-
Text {
126-
text: qsTr("Point size")
110+
Behavior on opacity {
111+
OpacityAnimator {
112+
duration: 100
113+
}
127114
}
128115

129-
Slider {
130-
id: pointSizeSlider
131-
Layout.fillWidth: true
132-
value: 2
133-
from: 1
134-
to: 4
116+
Button {
117+
text: "Open file..."
118+
onClicked: fileDialog.open()
135119
}
136120

137-
Text {
138-
text: qsTr("Ambient component")
121+
Button {
122+
text: "Settings"
123+
onClicked: drawer.open()
139124
}
140125

141-
Slider {
142-
id: ambientSlider
143-
Layout.fillWidth: true
144-
value: 0.5
145-
from: 0
146-
to: 1
126+
MouseArea {
127+
id: mouseArea
128+
anchors.fill: parent
129+
hoverEnabled: true
130+
acceptedButtons: Qt.NoButton
147131
}
132+
}
148133

149-
Text {
150-
text: qsTr("Diffuse component")
151-
}
134+
Drawer {
135+
id: drawer
136+
parent: parent
137+
width: 320
138+
height: window.height
139+
edge: Qt.RightEdge
140+
dragMargin: 0 // disable drag-opening
141+
142+
ColumnLayout {
143+
anchors.fill: parent
144+
anchors.margins: 16
145+
146+
Text {
147+
Layout.fillWidth: true
148+
font.pointSize: 14
149+
font.bold: true
150+
text: qsTr("3D viewer settings")
151+
}
152152

153-
Slider {
154-
id: diffuseSlider
155-
Layout.fillWidth: true
156-
value: 0.7
157-
from: 0
158-
to: 1
159-
}
153+
Item {
154+
height: 16
155+
}
160156

161-
Text {
162-
text: qsTr("Specular component")
163-
}
157+
Text {
158+
text: qsTr("Point size")
159+
}
164160

165-
Slider {
166-
id: specularSlider
167-
Layout.fillWidth: true
168-
value: 0.1
169-
from: 0
170-
to: 1
171-
}
161+
Slider {
162+
id: pointSizeSlider
163+
Layout.fillWidth: true
164+
value: 2
165+
from: 1
166+
to: 4
167+
}
172168

173-
Text {
174-
text: qsTr("Specular power")
175-
}
169+
Text {
170+
text: qsTr("Ambient component")
171+
}
176172

177-
Slider {
178-
id: shininessSlider
179-
Layout.fillWidth: true
180-
value: 25
181-
from: 0
182-
to: 200
183-
}
173+
Slider {
174+
id: ambientSlider
175+
Layout.fillWidth: true
176+
value: 0.5
177+
from: 0
178+
to: 1
179+
}
180+
181+
Text {
182+
text: qsTr("Diffuse component")
183+
}
184+
185+
Slider {
186+
id: diffuseSlider
187+
Layout.fillWidth: true
188+
value: 0.7
189+
from: 0
190+
to: 1
191+
}
192+
193+
Text {
194+
text: qsTr("Specular component")
195+
}
196+
197+
Slider {
198+
id: specularSlider
199+
Layout.fillWidth: true
200+
value: 0.1
201+
from: 0
202+
to: 1
203+
}
204+
205+
Text {
206+
text: qsTr("Specular power")
207+
}
208+
209+
Slider {
210+
id: shininessSlider
211+
Layout.fillWidth: true
212+
value: 25
213+
from: 0
214+
to: 200
215+
}
184216

185-
Item {
186-
Layout.fillHeight: true
217+
Item {
218+
Layout.fillHeight: true
219+
}
187220
}
188221
}
189222
}
190223

191-
Rectangle {
192-
anchors.fill: parent
224+
Button {
225+
anchors.centerIn: parent
193226
visible: !pointCloudReader.pointCloud
194-
195-
Button {
196-
anchors.centerIn: parent
197-
text: qsTr("Load a point cloud from file ...")
198-
padding: 10
199-
onClicked: fileDialog.open()
200-
}
227+
padding: 20
228+
text: qsTr("Open a point cloud ...")
229+
onClicked: fileDialog.open()
201230
}
202231
}

Z3DScanner/Z3DScanner.pro

+7-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
11
include(../NEUVision.pri)
22

3-
QT += core gui opengl multimedia widgets quick qml concurrent
3+
QT += core gui widgets quick qml concurrent 3dinput 3dquick 3drender 3dquickrender
44
#CONFIG += console
55
DESTDIR = $$Z3D_BUILD_DIR
66
TARGET = Z3DScanner
77
VERSION = $$Z3D_VERSION
88
TEMPLATE = app
99

10-
win32:LIBS += opengl32.lib # to use "real" OpenGL on windows
11-
1210
# Define this to limit QtConcurrent thread pool size
1311
#DEFINES += Z3D_THREAD_COUNT_LIMIT=1
1412

1513
###############################################################################
1614
# Project
1715
SOURCES += \
1816
src/main.cpp \
19-
src/ui/mainwindow.cpp \
20-
src/zscannerinitialconfigwizard.cpp \
21-
src/zpointcloudwidget.cpp \
22-
src/zpointclouddata.cpp
17+
src/zscannerqml.cpp \
2318

2419
HEADERS += \
25-
src/ui/mainwindow.h \
26-
src/zscannerinitialconfigwizard.h \
27-
src/zpointcloudwidget.h \
28-
src/zpointclouddata.h
29-
30-
FORMS += \
31-
src/ui/mainwindow.ui \
32-
src/zscannerinitialconfigwizard.ui
20+
src/zscannerqml.h \
3321

3422
RESOURCES += \
3523
resources.qrc
@@ -68,6 +56,10 @@ include($$PWD/../lib/zcalibratedcamera/zcalibratedcamera.pri)
6856
# Structured Light
6957
include($$PWD/../lib/zstructuredlight/zstructuredlight.pri)
7058

59+
###############################################################################
60+
# Point cloud
61+
include($$PWD/../lib/zpointcloud/zpointcloud.pri)
62+
7163
###############################################################################
7264
# Camera calibrator
7365
include($$PWD/../lib/zcameracalibrator/zcameracalibrator.pri)

0 commit comments

Comments
 (0)