summaryrefslogtreecommitdiffstats
path: root/src/plugins/sceneparsers/gltf/gltfparser.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2015-08-31 15:14:17 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-10-13 07:15:15 +0000
commitaf40840eedf35404ba4b39e890c158e2328ff6ec (patch)
treece4ac1f925c34b56704c99bd332e0436e68dbecc /src/plugins/sceneparsers/gltf/gltfparser.cpp
parent0269afd106da5d4d999585b3bdb1332a2c01af12 (diff)
Move Render aspect into the Qt3DRender namespace
Updated examples and tests accordingly. Change-Id: I8848a88472de2302aa072fa11f21ea934672b7e6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins/sceneparsers/gltf/gltfparser.cpp')
-rw-r--r--src/plugins/sceneparsers/gltf/gltfparser.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp
index 762760a77..a32dd7f45 100644
--- a/src/plugins/sceneparsers/gltf/gltfparser.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp
@@ -75,7 +75,9 @@
QT_BEGIN_NAMESPACE
-namespace Qt3D {
+using namespace Qt3D;
+
+namespace Qt3DRender {
Q_LOGGING_CATEGORY(GLTFParserLog, "Qt3D.GLTFParser")
@@ -183,7 +185,7 @@ bool GLTFParser::setJSON(const QJsonDocument &json )
*/
void GLTFParser::setSource(const QUrl &source)
{
- const QString path = QUrlHelper::urlToLocalFileOrQrc(source);
+ const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source);
QFileInfo finfo(path);
if (!finfo.exists()) {
qCWarning(GLTFParserLog) << "missing file:" << path;
@@ -211,11 +213,11 @@ void GLTFParser::setSource(const QUrl &source)
*/
bool GLTFParser::isExtensionSupported(const QUrl &source) const
{
- const QString path = QUrlHelper::urlToLocalFileOrQrc(source);
+ const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source);
return GLTFParser::isGLTFPath(path);
}
-QEntity* GLTFParser::node(const QString &id)
+Qt3D::QEntity* GLTFParser::node(const QString &id)
{
QJsonObject nodes = m_json.object().value(KEY_NODES).toObject();
if (!nodes.contains(id)) {
@@ -282,7 +284,7 @@ QEntity* GLTFParser::node(const QString &id)
}
// ADD MATRIX TRANSFORM COMPONENT TO ENTITY
- QTransform *trans = new QTransform();
+ Qt3D::QTransform *trans = new Qt3D::QTransform();
trans->addTransform(new QMatrixTransform(m));
result->addComponent(trans);
}
@@ -300,7 +302,7 @@ QEntity* GLTFParser::node(const QString &id)
return result;
}
-QEntity* GLTFParser::scene(const QString &id)
+Qt3D::QEntity* GLTFParser::scene(const QString &id)
{
parse();
@@ -457,7 +459,7 @@ QParameter *GLTFParser::parameterFromTechnique(QTechnique *technique, const QStr
return Q_NULLPTR;
}
-QEntity* GLTFParser::defaultScene()
+Qt3D::QEntity* GLTFParser::defaultScene()
{
if (m_defaultScene.isEmpty()) {
qCWarning(GLTFParserLog) << Q_FUNC_INFO << "no default scene";
@@ -776,8 +778,8 @@ void GLTFParser::processJSONProgram(const QString &id, const QJsonObject &jsonOb
return;
}
- prog->setFragmentShaderCode(Qt3D::QShaderProgram::loadSource(QUrl::fromLocalFile(m_shaderPaths[fragName])));
- prog->setVertexShaderCode(Qt3D::QShaderProgram::loadSource(QUrl::fromLocalFile(m_shaderPaths[vertName])));
+ prog->setFragmentShaderCode(QShaderProgram::loadSource(QUrl::fromLocalFile(m_shaderPaths[fragName])));
+ prog->setVertexShaderCode(QShaderProgram::loadSource(QUrl::fromLocalFile(m_shaderPaths[vertName])));
m_programs[id] = prog;
}
@@ -1407,6 +1409,6 @@ QRenderState* GLTFParser::buildState(const QString& functionName, const QJsonVal
return Q_NULLPTR;
}
-} // namespace Qt3D
+} // namespace Qt3DRender
QT_END_NAMESPACE