summaryrefslogtreecommitdiffstats
path: root/src/plugins/sceneparsers/assimp
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/assimp
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/assimp')
-rw-r--r--src/plugins/sceneparsers/assimp/assimphelpers.cpp8
-rw-r--r--src/plugins/sceneparsers/assimp/assimphelpers_p.h6
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser.cpp26
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser_p.h15
4 files changed, 30 insertions, 25 deletions
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<QByteArray, QIODevice::OpenMode> 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<uint, QEffect *> m_effects;
QMap<uint, QAbstractTextureProvider *> m_embeddedTextures;
QMap<QString, QAbstractTextureProvider *> m_materialTextures;
- QMap<aiNode*, QEntity*> m_cameras;
+ QMap<aiNode*, Qt3D::QEntity*> m_cameras;
QHash<aiTextureType, QString> m_textureToParameterName;
// QMap<aiNode*, Light*> m_lights;
};
@@ -131,7 +134,7 @@ private:
static QStringList assimpSupportedFormatsList;
};
-} // namespace Qt3D
+} // namespace Qt3DRender
QT_END_NAMESPACE