You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wavefrontobj.h 798B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef WAVEFRONTOBJ_H
  2. #define WAVEFRONTOBJ_H
  3. #include <QObject>
  4. #include <QIODevice>
  5. #include "utils/vector3d.h"
  6. struct WaveFrontObjFaceVertex
  7. {
  8. int vertexPosition;
  9. int textureCoordPosition;
  10. };
  11. class WaveFrontObj : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit WaveFrontObj(QObject *parent = 0);
  16. QList<QList<WaveFrontObjFaceVertex> > getFaces() const;
  17. QList<Vector3D> getVertexes() const;
  18. signals:
  19. public slots:
  20. bool openFile(const QString& filename);
  21. bool load(QIODevice& device);
  22. void addFace(QList<WaveFrontObjFaceVertex> face);
  23. void addVertex(const Vector3D& vertex);
  24. void setError(const QString& error);
  25. private:
  26. QString _error;
  27. QList<Vector3D> _vertexes;
  28. QList<QList<WaveFrontObjFaceVertex> > _faces;
  29. };
  30. #endif // WAVEFRONTOBJ_H