summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2019-03-21 13:38:12 +0200
committerJanne Kangas <janne.kangas@qt.io>2019-05-09 04:15:14 +0000
commit9859c764ea019fbe0e78a563c556afdc6cde7666 (patch)
treee876a8e804848d198d0fa339a0863de53c9d1ca2
parentf699744899fa6d149b21ab4412a2588854ae8dbc (diff)
Remove circular build dependencywip/qtify
Duplicate enum defined in studio3d module on runtime side to avoid including the entire class from studio3d. Task-id: QT3DS-3396 Change-Id: I193b34614a8bbf991f717f8302061298b56e451e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Runtime/Source/engine/Qt3DSRuntimeView.cpp6
-rw-r--r--src/Runtime/Source/engine/Qt3DSRuntimeView.h4
-rw-r--r--src/Runtime/Source/runtime/Qt3DSApplication.h8
-rw-r--r--src/Runtime/Source/runtime/Qt3DSIScriptBridge.h5
-rw-r--r--src/Runtime/Source/runtime/Qt3DSQmlEngine.cpp10
-rw-r--r--src/Runtime/Source/runtime/q3dsqmlscript.cpp2
-rw-r--r--src/Runtime/Source/runtime/q3dsqmlscript.h5
-rw-r--r--src/Runtime/Source/viewer/Qt3DSViewerApp.cpp4
-rw-r--r--src/Runtime/Source/viewer/Qt3DSViewerApp.h6
-rw-r--r--src/Runtime/commoninclude.pri1
-rw-r--r--src/Viewer/qmlviewer/Qt3DSRenderer.cpp5
-rw-r--r--src/Viewer/studio3d/q3dsdatainput.h8
-rw-r--r--src/Viewer/studio3d/q3dspresentation.cpp3
13 files changed, 38 insertions, 29 deletions
diff --git a/src/Runtime/Source/engine/Qt3DSRuntimeView.cpp b/src/Runtime/Source/engine/Qt3DSRuntimeView.cpp
index 9863031d..5e6506b3 100644
--- a/src/Runtime/Source/engine/Qt3DSRuntimeView.cpp
+++ b/src/Runtime/Source/engine/Qt3DSRuntimeView.cpp
@@ -204,7 +204,7 @@ public:
void GoToTime(const char *elementPath, const float time) override;
void SetGlobalAnimationTime(qint64 inMilliSecs) override;
void SetDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole property) override;
+ int property) override;
void setPresentationId(const QString &id) override
{
@@ -582,12 +582,12 @@ void CRuntimeView::SetGlobalAnimationTime(qint64 inMilliSecs)
void CRuntimeView::SetDataInputValue(
const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole property = Q3DSDataInput::ValueRole::Value)
+ int property = 0)
{
if (m_Application) {
Q3DStudio::CQmlEngine &theBridgeEngine
= static_cast<Q3DStudio::CQmlEngine &>(m_RuntimeFactoryCore->GetScriptEngineQml());
- theBridgeEngine.SetDataInputValue(name, value, property);
+ theBridgeEngine.SetDataInputValue(name, value, (qt3ds::runtime::DataInputValueRole)property);
}
}
diff --git a/src/Runtime/Source/engine/Qt3DSRuntimeView.h b/src/Runtime/Source/engine/Qt3DSRuntimeView.h
index 776fbea2..0bd63010 100644
--- a/src/Runtime/Source/engine/Qt3DSRuntimeView.h
+++ b/src/Runtime/Source/engine/Qt3DSRuntimeView.h
@@ -38,7 +38,7 @@
#include "render/Qt3DSRenderBaseTypes.h"
#include "EASTL/string.h"
#include "foundation/Qt3DSRefCounted.h"
-#include "q3dsdatainput.h"
+#include "Qt3DSApplication.h"
#include "Qt3DSWindowSystem.h"
#include "Qt3DSTimer.h"
#include "Qt3DSPresentation.h"
@@ -185,7 +185,7 @@ public:
virtual void GoToTime(const char *elementPath, const float time) = 0;
virtual void SetGlobalAnimationTime(qint64 inMilliSecs) = 0;
virtual void SetDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole property) = 0;
+ int property) = 0;
virtual QList<QString> dataInputs() const = 0;
virtual float dataInputMax(const QString &name) const = 0;
virtual float dataInputMin(const QString &name) const = 0;
diff --git a/src/Runtime/Source/runtime/Qt3DSApplication.h b/src/Runtime/Source/runtime/Qt3DSApplication.h
index cdec96a1..b74191f2 100644
--- a/src/Runtime/Source/runtime/Qt3DSApplication.h
+++ b/src/Runtime/Source/runtime/Qt3DSApplication.h
@@ -37,7 +37,6 @@
#include "Qt3DSKernelTypes.h"
#include "Qt3DSMetadata.h"
#include "QtQml/qjsengine.h"
-#include "q3dsdatainput.h"
namespace Q3DStudio {
class IRuntimeFactory;
@@ -104,6 +103,13 @@ enum DataInputType {
DataInputTypeVariant
};
+// Duplicated from Q3DSDataInput class on viewer side
+enum class DataInputValueRole {
+ Value = 0,
+ Min = 1,
+ Max = 2
+};
+
struct DataInputDef
{
QVector<DataInputControlledAttribute> controlledAttributes;
diff --git a/src/Runtime/Source/runtime/Qt3DSIScriptBridge.h b/src/Runtime/Source/runtime/Qt3DSIScriptBridge.h
index 2aa59339..8f8925d8 100644
--- a/src/Runtime/Source/runtime/Qt3DSIScriptBridge.h
+++ b/src/Runtime/Source/runtime/Qt3DSIScriptBridge.h
@@ -33,7 +33,7 @@
#include "EASTL/vector.h"
#include "EASTL/string.h"
#include "foundation/Qt3DSRefCounted.h"
-#include "q3dsdatainput.h"
+#include "Qt3DSApplication.h"
#include <QtCore/qvariant.h>
@@ -157,7 +157,8 @@ public: // Elements
virtual void FireEvent(const char *element, const char *evtName) = 0;
virtual void SetDataInputValue(
const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole property = Q3DSDataInput::ValueRole::Value) = 0;
+ qt3ds::runtime::DataInputValueRole property
+ = qt3ds::runtime::DataInputValueRole::Value) = 0;
virtual void createElement(const QString &parentElementPath, const QString &slideName,
const QHash<QString, QVariant> &properties,
qt3ds::render::IQt3DSRenderer *renderer) = 0;
diff --git a/src/Runtime/Source/runtime/Qt3DSQmlEngine.cpp b/src/Runtime/Source/runtime/Qt3DSQmlEngine.cpp
index 86f68bdd..2251a2b8 100644
--- a/src/Runtime/Source/runtime/Qt3DSQmlEngine.cpp
+++ b/src/Runtime/Source/runtime/Qt3DSQmlEngine.cpp
@@ -416,7 +416,7 @@ public:
bool GetAttribute(const char *element, const char *attName, char *value) override;
void FireEvent(const char *element, const char *evtName) override;
void SetDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole) override;
+ qt3ds::runtime::DataInputValueRole valueRole) override;
void createElement(const QString &parentElementPath, const QString &slideName,
const QHash<QString, QVariant> &properties,
qt3ds::render::IQt3DSRenderer *renderer) override;
@@ -632,13 +632,13 @@ void CQmlEngineImpl::FireEvent(const char *element, const char *evtName)
void CQmlEngineImpl::SetDataInputValue(
const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole = Q3DSDataInput::ValueRole::Value)
+ qt3ds::runtime::DataInputValueRole valueRole = qt3ds::runtime::DataInputValueRole::Value)
{
qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
if (diMap.contains(name)) {
qt3ds::runtime::DataInputDef &diDef = diMap[name];
switch (valueRole) {
- case Q3DSDataInput::ValueRole::Value: { // switch (valueRole)
+ case qt3ds::runtime::DataInputValueRole::Value: { // switch (valueRole)
diDef.value = value;
const QVector<qt3ds::runtime::DataInputControlledAttribute> &ctrlAtt
= diDef.controlledAttributes;
@@ -816,11 +816,11 @@ void CQmlEngineImpl::SetDataInputValue(
}
break;
}
- case Q3DSDataInput::ValueRole::Max: { // switch (valueRole)
+ case qt3ds::runtime::DataInputValueRole::Max: { // switch (valueRole)
diDef.max = value.toFloat();
break;
}
- case Q3DSDataInput::ValueRole::Min: { // switch (valueRole)
+ case qt3ds::runtime::DataInputValueRole::Min: { // switch (valueRole)
diDef.min = value.toFloat();
break;
}
diff --git a/src/Runtime/Source/runtime/q3dsqmlscript.cpp b/src/Runtime/Source/runtime/q3dsqmlscript.cpp
index 91963804..94133a67 100644
--- a/src/Runtime/Source/runtime/q3dsqmlscript.cpp
+++ b/src/Runtime/Source/runtime/q3dsqmlscript.cpp
@@ -383,7 +383,7 @@ QString Q3DSQmlScript::getParent(const QString &handle)
}
void Q3DSQmlScript::setDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole)
+ qt3ds::runtime::DataInputValueRole valueRole)
{
m_api.SetDataInputValue(name, value, valueRole);
}
diff --git a/src/Runtime/Source/runtime/q3dsqmlscript.h b/src/Runtime/Source/runtime/q3dsqmlscript.h
index b05fad03..cf41db54 100644
--- a/src/Runtime/Source/runtime/q3dsqmlscript.h
+++ b/src/Runtime/Source/runtime/q3dsqmlscript.h
@@ -41,7 +41,7 @@
#include "Qt3DSKernelTypes.h"
#include "Qt3DSEvent.h"
#include "q3dsqmlbehavior.h"
-#include "q3dsdatainput.h"
+#include "Qt3DSApplication.h"
namespace Q3DStudio {
class CQmlEngine;
@@ -75,7 +75,8 @@ public:
QVector3D matrixToEuler(const QMatrix4x4 &matrix);
QString getParent(const QString &handle);
void setDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole = Q3DSDataInput::ValueRole::Value);
+ qt3ds::runtime::DataInputValueRole valueRole
+ = qt3ds::runtime::DataInputValueRole::Value);
struct EventData {
QJSValue function;
diff --git a/src/Runtime/Source/viewer/Qt3DSViewerApp.cpp b/src/Runtime/Source/viewer/Qt3DSViewerApp.cpp
index 4dd5dbd9..8bf7eb80 100644
--- a/src/Runtime/Source/viewer/Qt3DSViewerApp.cpp
+++ b/src/Runtime/Source/viewer/Qt3DSViewerApp.cpp
@@ -754,12 +754,12 @@ void Q3DSViewerApp::SetGlobalAnimationTime(qint64 inMilliSecs)
}
void Q3DSViewerApp::SetDataInputValue(
- const QString &name, const QVariant &value, Q3DSDataInput::ValueRole valueRole)
+ const QString &name, const QVariant &value, qt3ds::runtime::DataInputValueRole valueRole)
{
if (!m_Impl.m_view)
return;
- m_Impl.m_view->SetDataInputValue(name, value, valueRole);
+ m_Impl.m_view->SetDataInputValue(name, value, int(valueRole));
}
void Q3DSViewerApp::setPresentationId(const QString &id)
diff --git a/src/Runtime/Source/viewer/Qt3DSViewerApp.h b/src/Runtime/Source/viewer/Qt3DSViewerApp.h
index 66a40e76..d2d9b93e 100644
--- a/src/Runtime/Source/viewer/Qt3DSViewerApp.h
+++ b/src/Runtime/Source/viewer/Qt3DSViewerApp.h
@@ -37,9 +37,8 @@
#include <vector>
#include <QObject>
#include <QtCore/qelapsedtimer.h>
-
+#include "Qt3DSApplication.h"
#include "Qt3DSInputDefs.h"
-#include "q3dsdatainput.h"
#include <QtGui/qsurfaceformat.h>
namespace Q3DStudio {
@@ -352,7 +351,8 @@ public:
void SetGlobalAnimationTime(qint64 inMilliSecs);
void SetDataInputValue(const QString &name, const QVariant &value,
- Q3DSDataInput::ValueRole valueRole = Q3DSDataInput::ValueRole::Value);
+ qt3ds::runtime::DataInputValueRole valueRole
+ = qt3ds::runtime::DataInputValueRole::Value);
QList<QString> dataInputs() const;
diff --git a/src/Runtime/commoninclude.pri b/src/Runtime/commoninclude.pri
index 71fc6d08..18e242e9 100644
--- a/src/Runtime/commoninclude.pri
+++ b/src/Runtime/commoninclude.pri
@@ -39,7 +39,6 @@ INCLUDEPATH += \
$$PWD/Source/runtimerender \
$$PWD/Source/runtimerender/graphobjects \
$$PWD/Source/runtimerender/resourcemanager \
- $$PWD/../Viewer/studio3d
# TODO: Investigate whether these can be moved to commonplatform
win32-msvc {
diff --git a/src/Viewer/qmlviewer/Qt3DSRenderer.cpp b/src/Viewer/qmlviewer/Qt3DSRenderer.cpp
index d07b07ec..73e2f0f8 100644
--- a/src/Viewer/qmlviewer/Qt3DSRenderer.cpp
+++ b/src/Viewer/qmlviewer/Qt3DSRenderer.cpp
@@ -325,8 +325,9 @@ void Q3DSRenderer::processCommands()
m_runtime->HandleKeyInput(Q3DStudio::EKeyCode(cmd.m_intValues[0]), false);
break;
case CommandType_SetDataInputValue:
- m_runtime->SetDataInputValue(cmd.m_stringValue, cmd.m_variantValue,
- static_cast<Q3DSDataInput::ValueRole>(cmd.m_intValues[0]));
+ m_runtime->SetDataInputValue(
+ cmd.m_stringValue, cmd.m_variantValue,
+ static_cast<qt3ds::runtime::DataInputValueRole>(cmd.m_intValues[0]));
break;
case CommandType_CreateElement: {
m_runtime->createElement(cmd.m_elementPath, cmd.m_stringValue,
diff --git a/src/Viewer/studio3d/q3dsdatainput.h b/src/Viewer/studio3d/q3dsdatainput.h
index 2368126e..fc5933fa 100644
--- a/src/Viewer/studio3d/q3dsdatainput.h
+++ b/src/Viewer/studio3d/q3dsdatainput.h
@@ -30,7 +30,7 @@
#ifndef Q3DSDATAINPUT_H
#define Q3DSDATAINPUT_H
-#include "qstudio3dglobal.h"
+#include <QtStudio3D/qstudio3dglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
@@ -58,9 +58,9 @@ public:
virtual ~Q3DSDataInput();
enum class ValueRole {
- Value,
- Min,
- Max
+ Value = 0,
+ Min = 1,
+ Max = 2
};
QString name() const;
diff --git a/src/Viewer/studio3d/q3dspresentation.cpp b/src/Viewer/studio3d/q3dspresentation.cpp
index e1ef5e1e..6884e0ee 100644
--- a/src/Viewer/studio3d/q3dspresentation.cpp
+++ b/src/Viewer/studio3d/q3dspresentation.cpp
@@ -267,7 +267,8 @@ void Q3DSPresentation::setDataInputValue(const QString &name, const QVariant &va
Q3DSDataInput::ValueRole valueRole)
{
if (d_ptr->m_viewerApp) {
- d_ptr->m_viewerApp->SetDataInputValue(name, value, valueRole);
+ d_ptr->m_viewerApp->SetDataInputValue(name, value,
+ (qt3ds::runtime::DataInputValueRole)valueRole);
} else if (d_ptr->m_commandQueue) {
d_ptr->m_commandQueue->queueCommand(QString(), CommandType_SetDataInputValue,
name, value, static_cast<int>(valueRole));