Using QString now,
fileinfo works now
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <QVector>
|
||||
#include <QVector2D>
|
||||
#include <QVector3D>
|
||||
#include <QStringList>
|
||||
#include <QMatrix4x4>
|
||||
#include <QQuaternion>
|
||||
#include <QOpenGLFunctions>
|
||||
@@ -41,16 +42,16 @@ class FileInterface : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileInterface(const char* path, QObject *parent)
|
||||
explicit FileInterface(QString path, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_models(new QVector<Model*>)
|
||||
, m_textureNames(new QVector<std::string>)
|
||||
, m_textureNames(new QStringList)
|
||||
{
|
||||
//open file
|
||||
m_file.open(path, std::ios::in | std::ios::binary);
|
||||
m_file.open(path.toStdString().c_str(), std::ios::in | std::ios::binary);
|
||||
|
||||
if (!m_file.is_open())
|
||||
throw std::invalid_argument(std::string("ERROR: file not found: ") += path);
|
||||
throw std::invalid_argument(std::string("ERROR: file not found: ") += path.toStdString());
|
||||
|
||||
MainWindow* tmp = dynamic_cast<MainWindow*>(parent->parent()->parent());
|
||||
if(tmp != NULL)
|
||||
@@ -87,14 +88,14 @@ public:
|
||||
protected:
|
||||
QVector<Model*>* m_models;
|
||||
std::fstream m_file;
|
||||
QVector<std::string>* m_textureNames;
|
||||
QStringList* m_textureNames;
|
||||
BoundingBox m_sceneBbox;
|
||||
|
||||
virtual void import() = 0;
|
||||
|
||||
public:
|
||||
virtual QVector<Model*>* getModels() const { return m_models; };
|
||||
virtual QVector<std::string>* getTextureNames() const { return m_textureNames; };
|
||||
virtual QStringList* getTextureNames() const { return m_textureNames; };
|
||||
virtual BoundingBox getBoundingBox() const { return m_sceneBbox; };
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user