From af40840eedf35404ba4b39e890c158e2328ff6ec Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 31 Aug 2015 15:14:17 +0100 Subject: Move Render aspect into the Qt3DRender namespace Updated examples and tests accordingly. Change-Id: I8848a88472de2302aa072fa11f21ea934672b7e6 Reviewed-by: Paul Lemire --- src/plugins/sceneparsers/assimp/assimphelpers.cpp | 8 +++---- src/plugins/sceneparsers/assimp/assimphelpers_p.h | 6 +++--- src/plugins/sceneparsers/assimp/assimpparser.cpp | 26 ++++++++++++----------- src/plugins/sceneparsers/assimp/assimpparser_p.h | 15 +++++++------ 4 files changed, 30 insertions(+), 25 deletions(-) (limited to 'src/plugins/sceneparsers/assimp') diff --git a/src/plugins/sceneparsers/assimp/assimphelpers.cpp b/src/plugins/sceneparsers/assimp/assimphelpers.cpp index 345bb79bc..7d7c93266 100644 --- a/src/plugins/sceneparsers/assimp/assimphelpers.cpp +++ b/src/plugins/sceneparsers/assimp/assimphelpers.cpp @@ -44,10 +44,10 @@ QT_BEGIN_NAMESPACE -namespace Qt3D { +namespace Qt3DRender { namespace AssimpHelper { /*! - * \class Qt3D::AssimpHelper::AssimpIOStream + * \class Qt3DRender::AssimpHelper::AssimpIOStream * * \internal * @@ -222,7 +222,7 @@ void AssimpIOSystem::Close(Assimp::IOStream *pFile) delete pFile; } -} // AssimpHelper namespace -} // Qt3D namespace +} // namespace AssimpHelper +} // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/plugins/sceneparsers/assimp/assimphelpers_p.h b/src/plugins/sceneparsers/assimp/assimphelpers_p.h index 53f6d22ef..5ac1019e4 100644 --- a/src/plugins/sceneparsers/assimp/assimphelpers_p.h +++ b/src/plugins/sceneparsers/assimp/assimphelpers_p.h @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE -namespace Qt3D { +namespace Qt3DRender { namespace AssimpHelper { //CUSTOM FILE STREAM @@ -82,8 +82,8 @@ private: QMap m_openModeMaps; }; -} // AssimpHelper namespace -} // Qt3D namespace +} // namespace AssimpHelper +} // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp index 50feb4b83..63a4f0b32 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser.cpp +++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp @@ -61,10 +61,12 @@ QT_BEGIN_NAMESPACE -namespace Qt3D { +using namespace Qt3D; + +namespace Qt3DRender { /*! - \class Qt3D::AssimpParser + \class Qt3DRender::AssimpParser \since 5.5 \brief Provides a generic way of loading various 3D assets @@ -156,9 +158,9 @@ QString texturePath(const aiString &path) } /*! - * Returns the Qt3D::QParameter with named \a name if contained by the material + * Returns the Qt3DRender::QParameter with named \a name if contained by the material * \a material. If the material doesn't contain the named parameter, a new - * Qt3D::QParameter is created and inserted into the material. + * Qt3DRender::QParameter is created and inserted into the material. */ QParameter *findNamedParameter(const QString &name, QMaterial *material) { @@ -318,7 +320,7 @@ bool AssimpParser::isAssimpPath(const QString &path) */ void AssimpParser::setSource(const QUrl &source) { - const QString path = QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); QFileInfo file(path); m_sceneDir = file.absoluteDir(); if (!file.exists()) { @@ -334,7 +336,7 @@ void AssimpParser::setSource(const QUrl &source) */ bool AssimpParser::isExtensionSupported(const QUrl &source) const { - const QString path = QUrlHelper::urlToLocalFileOrQrc(source); + const QString path = Qt3D::QUrlHelper::urlToLocalFileOrQrc(source); return AssimpParser::isAssimpPath(path); } @@ -345,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. */ -QEntity *AssimpParser::scene(const QString &id) +Qt3D::QEntity *AssimpParser::scene(const QString &id) { // m_aiScene shouldn't be null. // If it is either, the file failed to be imported or @@ -370,7 +372,7 @@ 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. */ -QEntity *AssimpParser::node(const QString &id) +Qt3D::QEntity *AssimpParser::node(const QString &id) { if (m_scene == Q_NULLPTR || m_scene->m_aiScene == Q_NULLPTR) return Q_NULLPTR; @@ -382,7 +384,7 @@ QEntity *AssimpParser::node(const QString &id) /*! * Returns a Node from an Assimp aiNode \a node. */ -QEntity *AssimpParser::node(aiNode *node) +Qt3D::QEntity *AssimpParser::node(aiNode *node) { if (node == Q_NULLPTR) return Q_NULLPTR; @@ -413,7 +415,7 @@ QEntity *AssimpParser::node(aiNode *node) // Add Transformations const QMatrix4x4 qTransformMatrix = aiMatrix4x4ToQMatrix4x4(node->mTransformation); - QTransform *transform = new QTransform(new QMatrixTransform(qTransformMatrix)); + Qt3D::QTransform *transform = new Qt3D::QTransform(new QMatrixTransform(qTransformMatrix)); entityNode->addComponent(transform); // Add Camera @@ -722,7 +724,7 @@ void AssimpParser::loadCamera(uint cameraIndex) assimpCamera->mClipPlaneFar); camera->addComponent(lens); - QTransform *transform = new QTransform(); + Qt3D::QTransform *transform = new Qt3D::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)); @@ -920,7 +922,7 @@ AssimpParser::SceneImporter::~SceneImporter() delete m_importer; } -} // namespace Qt3D +} // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/plugins/sceneparsers/assimp/assimpparser_p.h b/src/plugins/sceneparsers/assimp/assimpparser_p.h index 250cb9ec3..89fbb5c89 100644 --- a/src/plugins/sceneparsers/assimp/assimpparser_p.h +++ b/src/plugins/sceneparsers/assimp/assimpparser_p.h @@ -54,11 +54,14 @@ QT_BEGIN_NAMESPACE class QFile; namespace Qt3D { +class QCamera; +} + +namespace Qt3DRender { class QMaterial; class QShaderProgram; class QEffect; -class QCamera; class QAbstractTextureProvider; class QMesh; class QGeometryRenderer; @@ -77,14 +80,14 @@ public: // SceneParserInterface interface void setSource(const QUrl& source) Q_DECL_OVERRIDE; bool isExtensionSupported(const QUrl &source) const Q_DECL_OVERRIDE; - QEntity *scene(const QString &id = QString()) Q_DECL_OVERRIDE; - QEntity *node(const QString &id) Q_DECL_OVERRIDE; + Qt3D::QEntity *scene(const QString &id = QString()) Q_DECL_OVERRIDE; + Qt3D::QEntity *node(const QString &id) Q_DECL_OVERRIDE; private: static bool isAssimpPath(const QString &path); static QStringList assimpSupportedFormats(); - QEntity *node(aiNode *node); + Qt3D::QEntity *node(aiNode *node); void readSceneFile(const QString &file); @@ -120,7 +123,7 @@ private: QMap m_effects; QMap m_embeddedTextures; QMap m_materialTextures; - QMap m_cameras; + QMap m_cameras; QHash m_textureToParameterName; // QMap m_lights; }; @@ -131,7 +134,7 @@ private: static QStringList assimpSupportedFormatsList; }; -} // namespace Qt3D +} // namespace Qt3DRender QT_END_NAMESPACE -- cgit v1.2.3