summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-03-16 04:13:32 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-03-16 11:06:14 +0000
commit137265904638da501a175f1332ec880d77bfd214 (patch)
tree91dcac9b73bdd9c0130f28365b1b0dbee7a40312 /src/plugins
parent5dc05523555c35d3ea043ed2405dcdf9e6b62ba4 (diff)
[.*SceneParser] Minor clean-up
Change-Id: I171a3e44383f2f5160b24113de6d92725ed19fe9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser.cpp12
-rw-r--r--src/plugins/sceneparsers/assimp/assimpparser_p.h22
2 files changed, 13 insertions, 21 deletions
diff --git a/src/plugins/sceneparsers/assimp/assimpparser.cpp b/src/plugins/sceneparsers/assimp/assimpparser.cpp
index 054c3ab79..5cbdc7b46 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser.cpp
+++ b/src/plugins/sceneparsers/assimp/assimpparser.cpp
@@ -249,12 +249,12 @@ AssimpParser::~AssimpParser()
* Return true if the provided \a path has a suffix supported
* by the Assimp Assets importer.
*/
-bool AssimpParser::isAssimpPath(const QString& path)
+bool AssimpParser::isAssimpPath(const QString &path)
{
QFileInfo fileInfo(path);
if (!fileInfo.exists() ||
- !AssimpParser::assimpSupportedFormats().contains(fileInfo.suffix().toLower()))
+ !AssimpParser::assimpSupportedFormatsList.contains(fileInfo.suffix().toLower()))
return false;
return true;
}
@@ -290,7 +290,7 @@ void AssimpParser::setSource(const QUrl &source)
* Returns true if the extension of \a path is supported by
* the assimp parser.
*/
-bool AssimpParser::isExtensionSupported(const QUrl &source)
+bool AssimpParser::isExtensionSupported(const QUrl &source) const
{
const QString path = QUrlHelper::urlToLocalFileOrQrc(source);
return AssimpParser::isAssimpPath(path);
@@ -303,7 +303,7 @@ bool AssimpParser::isExtensionSupported(const QUrl &source)
*
* Returns Q_NULLPTR if \a id was specified but not node matching it can be found.
*/
-QEntity *AssimpParser::scene(QString id)
+QEntity *AssimpParser::scene(const QString &id)
{
// m_aiScene shouldn't be null.
// If it is either, the file failed to be imported or
@@ -328,7 +328,7 @@ QEntity *AssimpParser::scene(QString id)
* Returns a Node from the scene identified by \a id.
* Returns Q_NULLPTR if no node can be found.
*/
-QEntity *AssimpParser::node(QString id)
+QEntity *AssimpParser::node(const QString &id)
{
if (m_scene == Q_NULLPTR || m_scene->m_aiScene == Q_NULLPTR)
return Q_NULLPTR;
@@ -914,7 +914,7 @@ AssimpParser::SceneImporter::~SceneImporter()
delete m_importer;
}
-} // Qt3D
+} // namespace Qt3D
QT_END_NAMESPACE
diff --git a/src/plugins/sceneparsers/assimp/assimpparser_p.h b/src/plugins/sceneparsers/assimp/assimpparser_p.h
index 31bfb7bc1..d24472522 100644
--- a/src/plugins/sceneparsers/assimp/assimpparser_p.h
+++ b/src/plugins/sceneparsers/assimp/assimpparser_p.h
@@ -71,25 +71,19 @@ class AssimpParser : public AbstractSceneParser
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt3DRenderer.AssimParser")
+
public:
AssimpParser();
~AssimpParser();
- static bool isAssimpPath(const QString& path);
-
// SceneParserInterface interface
void setSource(const QUrl& source) Q_DECL_OVERRIDE;
- bool isExtensionSupported(const QUrl &source) Q_DECL_OVERRIDE;
- QEntity *scene(QString id = QString()) Q_DECL_OVERRIDE;
- QEntity *node(QString id) Q_DECL_OVERRIDE;
-
- QEntity *defaultScene();
- QMeshDataPtr mesh(QString id);
- QMaterial *material(QString id);
- QCamera *camera(QString id);
-
-private :
+ 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;
+private:
+ static bool isAssimpPath(const QString &path);
static QStringList assimpSupportedFormats();
static QMatrix4x4 aiMatrix4x4ToQMatrix4x4(const aiMatrix4x4 &matrix);
@@ -138,11 +132,9 @@ private :
bool m_sceneParsed;
AssimpParser::SceneImporter *m_scene;
static QStringList assimpSupportedFormatsList;
-
-
};
-}
+} // namespace Qt3D
QT_END_NAMESPACE