summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2020-09-24 11:20:49 +0300
committerAntti Määttä <antti.maatta@qt.io>2020-10-15 12:11:23 +0300
commit36ae96eb01fe5c506c958ef008b58bd382a83517 (patch)
treed1ed15766cead3fd397cb5dcdb51da80f2f7c9b7
parent8d07d80716ce9040832e93aa039f374d6729a16a (diff)
Split SDynamicObject from Graph objects to own class
Then add SDynamicGraphObject, which uses it. Change-Id: I6a3cb29391bbf3c351d6a03baf0682b6fb1e1758 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
index 40f47962..3b9ab7fc 100644
--- a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
+++ b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
@@ -1032,19 +1032,20 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
TIdxToPropertyMap m_PropertyMap;
SDynamicObjectTranslator(qt3dsdm::Qt3DSDMInstanceHandle inInstance, qt3ds::NVAllocatorCallback &,
- SDynamicObject &inObject)
+ SDynamicGraphObject &inObject)
: SGraphObjectTranslator(inInstance, inObject)
{
}
void PushTranslation(STranslation &inContext) override
{
- SDynamicObject &theItem = static_cast<SDynamicObject &>(GetGraphObject());
+ SDynamicGraphObject &theItem = static_cast<SDynamicGraphObject &>(GetGraphObject());
+ SDynamicObject &dynObj = *theItem.m_dynamicObject;
IDynamicObjectSystem &theSystem = inContext.m_Context.GetDynamicObjectSystem();
using namespace qt3ds::render::dynamic;
using qt3ds::foundation::NVConstDataRef;
- NVConstDataRef<SPropertyDefinition> theProperties =
- theSystem.GetProperties(theItem.m_ClassName);
+ NVConstDataRef<SPropertyDefinition> theProperties
+ = theSystem.GetProperties(dynObj.m_ClassName);
if (m_PropertyMap.size() == 0) {
for (QT3DSU32 idx = 0, end = theProperties.size(); idx < end; ++idx) {
const SPropertyDefinition &theDefinition(theProperties[idx]);
@@ -1075,7 +1076,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Long:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSI32) {
- theItem.SetPropertyValue(theDefinition,
+ dynObj.SetPropertyValue(theDefinition,
qt3dsdm::get<qt3ds::QT3DSI32>(theValue));
} else {
QT3DS_ASSERT(false);
@@ -1084,7 +1085,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Bool:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSRenderBool) {
- theItem.SetPropertyValue(theDefinition, qt3dsdm::get<bool>(theValue));
+ dynObj.SetPropertyValue(theDefinition, qt3dsdm::get<bool>(theValue));
} else {
QT3DS_ASSERT(false);
}
@@ -1092,7 +1093,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Float:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSF32) {
- theItem.SetPropertyValue(theDefinition, qt3dsdm::get<float>(theValue));
+ dynObj.SetPropertyValue(theDefinition, qt3dsdm::get<float>(theValue));
} else {
QT3DS_ASSERT(false);
}
@@ -1100,7 +1101,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Float2:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSVec2) {
- theItem.SetPropertyValue(
+ dynObj.SetPropertyValue(
theDefinition, ToRenderType(qt3dsdm::get<qt3dsdm::SFloat2>(theValue)));
} else {
QT3DS_ASSERT(false);
@@ -1109,7 +1110,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Float3:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSVec3) {
- theItem.SetPropertyValue(
+ dynObj.SetPropertyValue(
theDefinition, ToRenderType(qt3dsdm::get<qt3dsdm::SFloat3>(theValue)));
} else {
QT3DS_ASSERT(false);
@@ -1118,7 +1119,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
case qt3dsdm::DataModelDataType::Float4:
if (theDefinition.m_DataType
== qt3ds::render::NVRenderShaderDataTypes::QT3DSVec4) {
- theItem.SetPropertyValue(
+ dynObj.SetPropertyValue(
theDefinition, ToRenderType(qt3dsdm::get<qt3dsdm::SFloat4>(theValue)));
} else {
QT3DS_ASSERT(false);
@@ -1131,7 +1132,7 @@ struct SDynamicObjectTranslator : public SGraphObjectTranslator
eastl::string theStr;
qt3ds::render::ConvertWideUTF(theData->GetData(), 0, theStr);
eastl::string theWorkspace;
- theItem.SetPropertyValue(
+ dynObj.SetPropertyValue(
theDefinition, theStr.c_str(),
inContext.m_Doc.GetCore()->getProjectFile()
.getProjectPath().toLocal8Bit().constData(),