Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt3dstudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
public-demos
qt3dstudio
Commits
3a85396a
Commit
3a85396a
authored
Mar 27, 2019
by
Tomi Korpipää
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update application style for kria cluster
Also added FPS counter and possibility to use either RT1 or RT2.
parent
c3c6dc94
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
149 additions
and
38 deletions
+149
-38
kria-cluster-3d-demo/kria-cluster-3d-demo.pro
kria-cluster-3d-demo/kria-cluster-3d-demo.pro
+2
-1
kria-cluster-3d-demo/kria3dclusterdemo.qrc
kria-cluster-3d-demo/kria3dclusterdemo.qrc
+1
-0
kria-cluster-3d-demo/main.cpp
kria-cluster-3d-demo/main.cpp
+26
-21
kria-cluster-3d-demo/qml/FpsDisplay.qml
kria-cluster-3d-demo/qml/FpsDisplay.qml
+35
-0
kria-cluster-3d-demo/qml/Navigation.qml
kria-cluster-3d-demo/qml/Navigation.qml
+3
-6
kria-cluster-3d-demo/qml/main.qml
kria-cluster-3d-demo/qml/main.qml
+82
-10
No files found.
kria-cluster-3d-demo/kria-cluster-3d-demo.pro
View file @
3a85396a
...
@@ -2,7 +2,8 @@ TEMPLATE = app
...
@@ -2,7 +2,8 @@ TEMPLATE = app
QT
+=
qml
quick
3
dstudioruntime2
QT
+=
qml
quick
3
dstudioruntime2
target
.
path
=
$$
[
QT_INSTALL_EXAMPLES
]
/
studio3d
/
$$
TARGET
#
target
.
path
=
$$
[
QT_INSTALL_EXAMPLES
]
/
studio3d
/
$$
TARGET
target
.
path
=
/
opt
/
$$
TARGET
INSTALLS
+=
target
INSTALLS
+=
target
SOURCES
+=
main
.
cpp
SOURCES
+=
main
.
cpp
...
...
kria-cluster-3d-demo/kria3dclusterdemo.qrc
View file @
3a85396a
...
@@ -39,5 +39,6 @@
...
@@ -39,5 +39,6 @@
<file>presentation/GaugeCenter/gaugecenter.import</file>
<file>presentation/GaugeCenter/gaugecenter.import</file>
<file>presentation/Gauges/Gauges.import</file>
<file>presentation/Gauges/Gauges.import</file>
<file>presentation/Needle/needle.import</file>
<file>presentation/Needle/needle.import</file>
<file alias="FpsDisplay.qml">qml/FpsDisplay.qml</file>
</qresource>
</qresource>
</RCC>
</RCC>
kria-cluster-3d-demo/main.cpp
View file @
3a85396a
...
@@ -47,42 +47,47 @@
...
@@ -47,42 +47,47 @@
** $QT_END_LICENSE$
** $QT_END_LICENSE$
**
**
****************************************************************************/
****************************************************************************/
#include <QGuiApplication>
#include <QtGui/QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtCore/QDir>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlEngine>
#include <QtGui/QFontDatabase>
#include <QtGui/QFontDatabase>
#include <q3dsruntimeglobal.h>
#include <q3dsruntimeglobal.h>
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
qputenv
(
"QML_DISABLE_DISK_CACHE"
,
"true"
);
// qputenv("Q3DS_NO_DRAGONWINGS", "1");
qputenv
(
"Q3DS_DRAGON"
,
"1"
);
qputenv
(
"QT_QPA_EGLFS_HIDECURSOR"
,
"1"
);
// qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1");
qputenv
(
"QT_QPA_EGLFS_WIDTH"
,
"1920"
);
qputenv
(
"QT_QPA_EGLFS_HEIGHT"
,
"1080"
);
qputenv
(
"QT_QPA_EGLFS_PHYSICAL_WIDTH"
,
"293"
);
qputenv
(
"QT_QPA_EGLFS_PHYSICAL_HEIGHT"
,
"110"
);
// qputenv("QSG_RENDER_LOOP", "basic");
qputenv
(
"QSG_RENDER_LOOP"
,
"threaded"
);
// Debugging
// qputenv("QT_QPA_EGLFS_DEBUG", "1");
// qputenv("QSG_INFO", "1");
// qputenv("QT_LOGGING_RULES", "qt.qpa.*=true");
// Disable all extra logging
qputenv
(
"QT_LOGGING_RULES"
,
"*=false"
);
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
QGuiApplication
app
(
argc
,
argv
);
QGuiApplication
app
(
argc
,
argv
);
QSurfaceFormat
::
setDefaultFormat
(
Q3DS
::
surfaceFormat
());
QSurfaceFormat
::
setDefaultFormat
(
Q3DS
::
surfaceFormat
());
QQuickView
viewer
;
QFontDatabase
::
addApplicationFont
(
"qrc:/qml/fonts/TitilliumWeb-SemiBold.ttf"
);
QFontDatabase
::
addApplicationFont
(
"qrc:/qml/fonts/TitilliumWeb-SemiBold.ttf"
);
QFont
defaultFont
;
QFont
defaultFont
;
defaultFont
.
setFamily
(
"Titillium Web"
);
defaultFont
.
setFamily
(
"Titillium Web"
);
QGuiApplication
::
setFont
(
defaultFont
);
QGuiApplication
::
setFont
(
defaultFont
);
viewer
.
setSource
(
QUrl
(
"qrc:/main.qml"
));
QQmlApplicationEngine
engine
;
engine
.
load
(
QUrl
(
QStringLiteral
(
"qrc:/main.qml"
)));
viewer
.
setTitle
(
QStringLiteral
(
"Qt 3D Studio Kria 3D Cluster Demo"
));
if
(
engine
.
rootObjects
().
isEmpty
())
viewer
.
setResizeMode
(
QQuickView
::
SizeRootObjectToView
);
return
-
1
;
viewer
.
setWidth
(
1920
);
viewer
.
setHeight
(
720
);
viewer
.
setColor
(
QColor
(
"black"
));
#if (defined Q_OS_ANDROID)
viewer
.
showFullScreen
();
#else
viewer
.
show
();
#endif
return
app
.
exec
();
return
app
.
exec
();
}
}
kria-cluster-3d-demo/qml/FpsDisplay.qml
0 → 100644
View file @
3a85396a
import
QtQuick
2.11
Rectangle
{
id
:
fpsDisplayControl
property
real
fps
:
0.0
property
alias
textcolor
:
fpsText
.
color
property
alias
fpslabel
:
fpsLabelText
.
text
color
:
"
black
"
Text
{
id
:
fpsText
text
:
fps
.
toFixed
(
1
)
font.family
:
"
Helvetica
"
font.pixelSize
:
fpsDisplayControl
.
width
/
2
font.weight
:
Font
.
Light
color
:
"
white
"
width
:
parent
.
width
verticalAlignment
:
Text
.
AlignVCenter
horizontalAlignment
:
Text
.
AlignHCenter
}
Text
{
id
:
fpsLabelText
text
:
"
FPS
"
font.family
:
"
Helvetica
"
font.pixelSize
:
fpsDisplayControl
.
width
/
5
font.weight
:
Font
.
Light
color
:
"
white
"
width
:
parent
.
width
anchors.top
:
fpsText
.
bottom
verticalAlignment
:
Text
.
AlignVCenter
horizontalAlignment
:
Text
.
AlignHCenter
}
}
kria-cluster-3d-demo/qml/Navigation.qml
View file @
3a85396a
...
@@ -51,15 +51,12 @@
...
@@ -51,15 +51,12 @@
import
QtQuick
2.0
import
QtQuick
2.0
Item
{
Item
{
width
:
2560
height
:
960
Image
{
Image
{
id
:
fakeMap
id
:
fakeMap
source
:
"
qrc:/icons/Map.png
"
source
:
"
qrc:/icons/Map.png
"
y
:
-
580
y
:
-
parent
.
width
/
0.227
//-
580
width
:
2560
width
:
parent
.
width
//
2560
height
:
1540
height
:
parent
.
width
*
0.6
//
1540
}
}
PropertyAnimation
{
PropertyAnimation
{
...
...
kria-cluster-3d-demo/qml/main.qml
View file @
3a85396a
...
@@ -48,14 +48,20 @@
...
@@ -48,14 +48,20 @@
**
**
****************************************************************************/
****************************************************************************/
import
QtQuick
2.9
import
QtQuick
2.12
import
QtStudio3D
2.0
import
QtQuick
.
Window
2.12
import
QtStudio3D
2.3
//import QtStudio3D 1.1
import
QtQuick
.
Controls
2.1
import
QtQuick
.
Controls
2.1
Item
{
Window
{
id
:
mainview
id
:
mainview
width
:
1920
focus
:
true
height
:
1080
visible
:
true
color
:
"
#000000
"
title
:
"
Qt 3D Studio Kria 3D Cluster Demo
"
visibility
:
Window
.
FullScreen
property
bool
startupAnimation
:
true
property
bool
startupAnimation
:
true
property
bool
allowSelection
:
true
property
bool
allowSelection
:
true
...
@@ -80,16 +86,36 @@ Item {
...
@@ -80,16 +86,36 @@ Item {
property
string
chimesInfo
:
"
Off
"
property
string
chimesInfo
:
"
Off
"
property
string
chimesWarning
:
"
On
"
property
string
chimesWarning
:
"
On
"
// fps
property
real
avgFrames
:
0.0
property
int
avgCount
:
0
property
int
frames
:
0
property
int
framesUpdated
:
0
readonly
property
int
framesBetweenUpdates
:
5
// Use a 5 frame average for the FPS counter
readonly
property
int
secondsBetweenUpdates
:
60
// Use a 1 minute average for the average FPS counter
// RT1
// onFrameSwapped: {
// frames++;
// avgFrames++;
// }
Studio3D
{
Studio3D
{
id
:
studio3D
id
:
studio3D
width
:
parent
.
width
width
:
parent
.
width
height
:
parent
.
height
height
:
parent
.
height
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
ViewerSettings
{
// RT2
scaleMode
:
ViewerSettings
.
ScaleModeFit
onFrameUpdate
:
{
frames
++
;
avgFrames
++
;
}
}
// ViewerSettings {
// scaleMode: ViewerSettings.ScaleModeFit
// }
Presentation
{
Presentation
{
id
:
cluster
id
:
cluster
source
:
"
qrc:/presentation/mainPresentation.uia
"
source
:
"
qrc:/presentation/mainPresentation.uia
"
...
@@ -154,8 +180,8 @@ Item {
...
@@ -154,8 +180,8 @@ Item {
visible
:
active
visible
:
active
source
:
""
source
:
""
asynchronous
:
true
asynchronous
:
true
width
:
2560
width
:
mainview
.
width
//
2560
height
:
960
height
:
mainview
.
width
*
0.375
//
960
}
}
}
}
]
]
...
@@ -171,7 +197,7 @@ Item {
...
@@ -171,7 +197,7 @@ Item {
OverlayContainer
{
OverlayContainer
{
id
:
indicatorPane
id
:
indicatorPane
scale
:
mainview
.
width
/
2560
scale
:
mainview
.
width
/
2560
anchors.centerIn
:
mainview
anchors.centerIn
:
studio3D
visible
:
false
visible
:
false
}
}
...
@@ -357,4 +383,50 @@ Item {
...
@@ -357,4 +383,50 @@ Item {
mouse
.
accepted
=
false
;
mouse
.
accepted
=
false
;
}
}
}
}
//
// FpsDisplay
//
FpsDisplay
{
id
:
fpsDisplay
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.margins
:
10
width
:
40
height
:
40
textcolor
:
"
red
"
fpslabel
:
"
FPS
"
}
FpsDisplay
{
id
:
avgFpsDisplay
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.margins
:
10
width
:
40
height
:
40
textcolor
:
"
green
"
fpslabel
:
"
1 min AVG
"
}
Timer
{
interval
:
1000
repeat
:
true
running
:
!
fpsDisplay
.
hidden
onTriggered
:
{
if
(
++
framesUpdated
==
framesBetweenUpdates
)
{
fpsDisplay
.
fps
=
frames
/
framesBetweenUpdates
;
frames
=
0
;
framesUpdated
=
0
;
}
if
(
++
avgCount
==
secondsBetweenUpdates
)
{
avgFpsDisplay
.
fps
=
avgFrames
/
secondsBetweenUpdates
;
avgFrames
=
0.0
;
avgCount
=
0
;
}
}
onRunningChanged
:
{
avgFrames
=
0
;
frames
=
0
;
framesUpdated
=
0
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment