3D Repo Bouncer  1.4
repo_model_export_web.h
1 
22 #pragma once
23 
24 #include <string>
25 
26 #include "repo_model_export_abstract.h"
27 #include "../../../lib/repo_property_tree.h"
28 #include "../../../lib/datastructure/repo_structs.h"
29 #include "../../../core/model/collection/repo_scene.h"
30 
31 namespace repo{
32  namespace manipulator{
33  namespace modelconvertor{
34  enum class WebExportType { GLTF, SRC };
35 
37  {
38  public:
44 
48  virtual ~WebModelExport();
49 
55  virtual bool exportToFile(
56  const std::string &filePath);
57 
64 
69  virtual std::unordered_map<std::string, std::vector<uint8_t>> getJSONFilesAsBuffer() const;
70 
75  std::unordered_map<std::string, std::vector<uint8_t>> getX3DFilesAsBuffer() const
76  {
77  return x3dBufs;
78  }
79 
83  static std::string getSupportedFormats();
84 
90  bool isOk() const
91  {
92  return convertSuccess;
93  }
94 
95  protected:
96  bool convertSuccess;
98  std::unordered_map<std::string, repo::lib::PropertyTree> trees;
99  std::unordered_map<std::string, std::vector<uint8_t>> x3dBufs;
100  std::unordered_map<std::string, repo::lib::PropertyTree> jsonTrees;
101 
102  private:
103  std::string sanitizeFileName(
104  const std::string &name) const;
105  };
106  } //namespace modelconvertor
107  } //namespace manipulator
108 } //namespace repo
virtual std::unordered_map< std::string, std::vector< uint8_t > > getJSONFilesAsBuffer() const
Definition: repo_model_export_web.cpp:115
Definition: repo_connection_pool_mongo.h:32
Definition: repo_scene.h:44
Definition: repo_model_export_web.h:36
std::unordered_map< std::string, std::vector< uint8_t > > getX3DFilesAsBuffer() const
Definition: repo_model_export_web.h:75
Definition: repo_model_export_abstract.h:31
static std::string getSupportedFormats()
Definition: repo_model_export_web.cpp:133
virtual ~WebModelExport()
Definition: repo_model_export_web.cpp:53
virtual repo_web_buffers_t getAllFilesExportedAsBuffer() const =0
virtual bool exportToFile(const std::string &filePath)
Definition: repo_model_export_web.cpp:57
bool isOk() const
Definition: repo_model_export_web.h:90
WebModelExport(const repo::core::model::RepoScene *scene)
Definition: repo_model_export_web.cpp:30
Definition: repo_structs.h:25
GraphType
Definition: repo_scene.h:75