diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2015-10-12 20:45:19 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-10-13 13:19:50 +0000 |
commit | 7c971e0e7791ab38d7d3d8ebc25468c44cbe49c5 (patch) | |
tree | 53197a9e5eb7501d6f5b497f70c25dad9c265a6f /src/plugins | |
parent | 0bfd20ad3b8eb3edec8d6317af9eb5504f8c0871 (diff) |
Move Qt3DCore into Qt3DCore namespace
Update other aspects, tests and examples accordingly.
Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sceneparsers/assimp/assimpparser.cpp | 16 | ||||
-rw-r--r-- | src/plugins/sceneparsers/assimp/assimpparser_p.h | 10 | ||||
-rw-r--r-- | src/plugins/sceneparsers/gltf/gltfparser.cpp | 14 | ||||
-rw-r--r-- | src/plugins/sceneparsers/gltf/gltfparser_p.h | 12 |
4 files changed, 26 insertions, 26 deletions
diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp index 63a4f0b32..4036fd7d3 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser.cpp +++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE -using namespace Qt3D; +using namespace Qt3DCore; namespace Qt3DRender { @@ -320,7 +320,7 @@ bool AssimpParser::isAssimpPath(const QString &path) */ void AssimpParser::setSource(const QUrl &source) { - const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(source); QFileInfo file(path); m_sceneDir = file.absoluteDir(); if (!file.exists()) { @@ -336,7 +336,7 @@ void AssimpParser::setSource(const QUrl &source) */ bool AssimpParser::isExtensionSupported(const QUrl &source) const { - const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(source); return AssimpParser::isAssimpPath(path); } @@ -347,7 +347,7 @@ bool AssimpParser::isExtensionSupported(const QUrl &source) const * * Returns \c Q_NULLPTR if \a id was specified but no node matching it was found. */ -Qt3D::QEntity *AssimpParser::scene(const QString &id) +Qt3DCore::QEntity *AssimpParser::scene(const QString &id) { // m_aiScene shouldn't be null. // If it is either, the file failed to be imported or @@ -372,7 +372,7 @@ Qt3D::QEntity *AssimpParser::scene(const QString &id) * Returns a Node from the scene identified by \a id. * Returns \c Q_NULLPTR if the node was not found. */ -Qt3D::QEntity *AssimpParser::node(const QString &id) +Qt3DCore::QEntity *AssimpParser::node(const QString &id) { if (m_scene == Q_NULLPTR || m_scene->m_aiScene == Q_NULLPTR) return Q_NULLPTR; @@ -384,7 +384,7 @@ Qt3D::QEntity *AssimpParser::node(const QString &id) /*! * Returns a Node from an Assimp aiNode \a node. */ -Qt3D::QEntity *AssimpParser::node(aiNode *node) +Qt3DCore::QEntity *AssimpParser::node(aiNode *node) { if (node == Q_NULLPTR) return Q_NULLPTR; @@ -415,7 +415,7 @@ Qt3D::QEntity *AssimpParser::node(aiNode *node) // Add Transformations const QMatrix4x4 qTransformMatrix = aiMatrix4x4ToQMatrix4x4(node->mTransformation); - Qt3D::QTransform *transform = new Qt3D::QTransform(new QMatrixTransform(qTransformMatrix)); + Qt3DCore::QTransform *transform = new Qt3DCore::QTransform(new QMatrixTransform(qTransformMatrix)); entityNode->addComponent(transform); // Add Camera @@ -724,7 +724,7 @@ void AssimpParser::loadCamera(uint cameraIndex) assimpCamera->mClipPlaneFar); camera->addComponent(lens); - Qt3D::QTransform *transform = new Qt3D::QTransform(); + Qt3DCore::QTransform *transform = new Qt3DCore::QTransform(); QLookAtTransform *lookAt = new QLookAtTransform(); lookAt->setPosition(QVector3D(assimpCamera->mPosition.x, assimpCamera->mPosition.y, assimpCamera->mPosition.z)); lookAt->setViewCenter(QVector3D(assimpCamera->mLookAt.x, assimpCamera->mLookAt.y, assimpCamera->mLookAt.z)); diff --git a/src/plugins/sceneparsers/assimp/assimpparser_p.h b/src/plugins/sceneparsers/assimp/assimpparser_p.h index 82611310b..00304b262 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser_p.h +++ b/src/plugins/sceneparsers/assimp/assimpparser_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE class QFile; -namespace Qt3D { +namespace Qt3DCore { class QCamera; } @@ -91,14 +91,14 @@ public: // SceneParserInterface interface void setSource(const QUrl& source) Q_DECL_OVERRIDE; bool isExtensionSupported(const QUrl &source) const Q_DECL_OVERRIDE; - Qt3D::QEntity *scene(const QString &id = QString()) Q_DECL_OVERRIDE; - Qt3D::QEntity *node(const QString &id) Q_DECL_OVERRIDE; + Qt3DCore::QEntity *scene(const QString &id = QString()) Q_DECL_OVERRIDE; + Qt3DCore::QEntity *node(const QString &id) Q_DECL_OVERRIDE; private: static bool isAssimpPath(const QString &path); static QStringList assimpSupportedFormats(); - Qt3D::QEntity *node(aiNode *node); + Qt3DCore::QEntity *node(aiNode *node); void readSceneFile(const QString &file); @@ -134,7 +134,7 @@ private: QMap<uint, QEffect *> m_effects; QMap<uint, QAbstractTextureProvider *> m_embeddedTextures; QMap<QString, QAbstractTextureProvider *> m_materialTextures; - QMap<aiNode*, Qt3D::QEntity*> m_cameras; + QMap<aiNode*, Qt3DCore::QEntity*> m_cameras; QHash<aiTextureType, QString> m_textureToParameterName; // QMap<aiNode*, Light*> m_lights; }; diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp index a32dd7f45..61f040ca4 100644 --- a/src/plugins/sceneparsers/gltf/gltfparser.cpp +++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE -using namespace Qt3D; +using namespace Qt3DCore; namespace Qt3DRender { @@ -185,7 +185,7 @@ bool GLTFParser::setJSON(const QJsonDocument &json ) */ void GLTFParser::setSource(const QUrl &source) { - const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(source); QFileInfo finfo(path); if (!finfo.exists()) { qCWarning(GLTFParserLog) << "missing file:" << path; @@ -213,11 +213,11 @@ void GLTFParser::setSource(const QUrl &source) */ bool GLTFParser::isExtensionSupported(const QUrl &source) const { - const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3DCore::QUrlHelper::urlToLocalFileOrQrc(source); return GLTFParser::isGLTFPath(path); } -Qt3D::QEntity* GLTFParser::node(const QString &id) +Qt3DCore::QEntity* GLTFParser::node(const QString &id) { QJsonObject nodes = m_json.object().value(KEY_NODES).toObject(); if (!nodes.contains(id)) { @@ -284,7 +284,7 @@ Qt3D::QEntity* GLTFParser::node(const QString &id) } // ADD MATRIX TRANSFORM COMPONENT TO ENTITY - Qt3D::QTransform *trans = new Qt3D::QTransform(); + Qt3DCore::QTransform *trans = new Qt3DCore::QTransform(); trans->addTransform(new QMatrixTransform(m)); result->addComponent(trans); } @@ -302,7 +302,7 @@ Qt3D::QEntity* GLTFParser::node(const QString &id) return result; } -Qt3D::QEntity* GLTFParser::scene(const QString &id) +Qt3DCore::QEntity* GLTFParser::scene(const QString &id) { parse(); @@ -459,7 +459,7 @@ QParameter *GLTFParser::parameterFromTechnique(QTechnique *technique, const QStr return Q_NULLPTR; } -Qt3D::QEntity* GLTFParser::defaultScene() +Qt3DCore::QEntity* GLTFParser::defaultScene() { if (m_defaultScene.isEmpty()) { qCWarning(GLTFParserLog) << Q_FUNC_INFO << "no default scene"; diff --git a/src/plugins/sceneparsers/gltf/gltfparser_p.h b/src/plugins/sceneparsers/gltf/gltfparser_p.h index 15698171d..448fc900e 100644 --- a/src/plugins/sceneparsers/gltf/gltfparser_p.h +++ b/src/plugins/sceneparsers/gltf/gltfparser_p.h @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class QFile; -namespace Qt3D { +namespace Qt3DCore { class QCamera; class QCameraLens; class QEntity; @@ -95,8 +95,8 @@ public: // SceneParserInterface interface void setSource(const QUrl &source) Q_DECL_FINAL; bool isExtensionSupported(const QUrl &source) const Q_DECL_FINAL; - Qt3D::QEntity *node(const QString &id) Q_DECL_FINAL; - Qt3D::QEntity *scene(const QString &id = QString()) Q_DECL_FINAL; + Qt3DCore::QEntity *node(const QString &id) Q_DECL_FINAL; + Qt3DCore::QEntity *scene(const QString &id = QString()) Q_DECL_FINAL; private: class BufferData @@ -142,9 +142,9 @@ private: static QString standardAttributeNameFromSemantic(const QString &semantic); static QParameter *parameterFromTechnique(QTechnique *technique, const QString ¶meterName); - Qt3D::QEntity *defaultScene(); + Qt3DCore::QEntity *defaultScene(); QMaterial *material(const QString &id); - Qt3D::QCameraLens *camera(const QString &id) const; + Qt3DCore::QCameraLens *camera(const QString &id) const; void parse(); void cleanup(); @@ -165,7 +165,7 @@ private: QFile* resolveLocalData(QString path) const; QVariant parameterValueFromJSON(int type, const QJsonValue &value) const; - static Qt3D::QAbstractAttribute::DataType accessorTypeFromJSON(int componentType); + static Qt3DCore::QAbstractAttribute::DataType accessorTypeFromJSON(int componentType); static uint accessorDataSizeFromJson(const QString &type); static QRenderState *buildStateEnable(int state); |