Overte C++ Documentation
ModelPackager.h
1 //
2 // ModelPackager.h
3 //
4 //
5 // Created by Clement on 3/9/15.
6 // Copyright 2015 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_ModelPackager_h
13 #define hifi_ModelPackager_h
14 
15 #include <memory>
16 
17 #include <QFileInfo>
18 #include <QMultiHash>
19 
20 #include "ui/ModelsBrowser.h"
21 
22 namespace hfm {
23  class Model;
24 };
25 
26 class ModelPackager : public QObject {
27 public:
28  static bool package();
29 
30 private:
31  bool selectModel();
32 
33  bool loadModel();
34  bool editProperties();
35  bool zipModel();
36 
37  void populateBasicMapping(QVariantHash& mapping, QString filename, const hfm::Model& hfmModel);
38 
39  void listTextures();
40  bool copyTextures(const QString& oldDir, const QDir& newDir);
41 
42  QFileInfo _modelFile;
43  QFileInfo _fbxInfo;
44  QString _texDir;
45  QString _scriptDir;
46 
47  QMultiHash<QString, QVariant> _mapping;
48  std::shared_ptr<hfm::Model> _hfmModel;
49  QStringList _textures;
50  QStringList _scripts;
51 };
52 
53 
54 
55 
56 #endif // hifi_ModelPackager_h
A generic 3D model displaying geometry loaded from a URL.
Definition: Model.h:84
The runtime model format.
Definition: HFM.h:302