From ad83ecca41c815cec8a254ca8804c1d005865b93 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 5 Sep 2015 15:55:50 +0200 Subject: [PATCH] LP-29 added EarthView.qml and CubeView.qml --- ground/gcs/src/share/qml/CubeView.qml | 20 ++++++++++++ ground/gcs/src/share/qml/EarthView.qml | 42 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 ground/gcs/src/share/qml/CubeView.qml create mode 100644 ground/gcs/src/share/qml/EarthView.qml diff --git a/ground/gcs/src/share/qml/CubeView.qml b/ground/gcs/src/share/qml/CubeView.qml new file mode 100644 index 000000000..d2d81fd3d --- /dev/null +++ b/ground/gcs/src/share/qml/CubeView.qml @@ -0,0 +1,20 @@ +import QtQuick 2.4 +import osgQtQuick 1.0 + +Item { + OSGViewport { + anchors.fill: parent + focus: true + sceneData: cubeNode + camera: camera + + OSGCubeNode { + id: cubeNode + } + + OSGCamera { + id: camera + fieldOfView: 90 + } + } +} diff --git a/ground/gcs/src/share/qml/EarthView.qml b/ground/gcs/src/share/qml/EarthView.qml new file mode 100644 index 000000000..271bcd07d --- /dev/null +++ b/ground/gcs/src/share/qml/EarthView.qml @@ -0,0 +1,42 @@ +import QtQuick 2.4 +import osgQtQuick 1.0 +import PfdQmlEnums 1.0 + +Item { + OSGViewport { + anchors.fill: parent + focus: true + sceneData: skyNode + camera: camera + + OSGSkyNode { + id: skyNode + sceneData: terrainNode + dateTime: getDateTime() + minimumAmbientLight: qmlWidget.minimumAmbientLight + + function getDateTime() { + switch(qmlWidget.timeMode) { + case Pfd.Local: + return new Date(); + case Pfd.PredefinedTime: + return qmlWidget.dateTime; + } + } + + } + + OSGFileNode { + id: terrainNode + source: qmlWidget.terrainFile + async: false + } + + OSGCamera { + id: camera + fieldOfView: 90 + manipulatorMode: OSGCamera.Earth + } + + } +}