COGS
Computer Graphics Structures library
Importer.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef COGS_IMPORTER_H
7 #define COGS_IMPORTER_H
8 #include <vector>
9 #include <string>
10 #include <memory>
11 #include <COGS/API.h>
12 
13 
14 
15 namespace cogs // forward declarations
16 {
17  class Armature;
18  class Skeleton;
19  struct SkeletonAction;
20  struct Mesh;
21  class PointCloud;
22  class Scan;
23 }
24 
25 
26 
27 namespace cogs
28 {
29  // #TODO Update tested file formats.
45  class COGS_API Importer
46  {
47  public:
48 
49  explicit Importer();
50  explicit Importer(const std::string &filename);
51  Importer(const Importer &other) = delete;
52  Importer(const Importer &&other) = delete;
53  Importer &operator=(const Importer &other) = delete;
54  Importer &operator=(const Importer &&other) = delete;
55  ~Importer();
56 
58  bool LoadFile(const std::string &filename);
60  void CloseFile();
61 
63  [[nodiscard]] size_t GetPointCloudCount() const;
70  bool GetPointCloud(cogs::PointCloud &out_cloud, size_t id = 0) const;
71 
73  [[nodiscard]] size_t GetScanCount() const;
80  bool GetScan(cogs::Scan &out_scan, size_t id = 0) const;
81 
83  [[nodiscard]] size_t GetMeshCount() const;
90  bool GetMesh(cogs::Mesh &out_meshmodel, size_t id = 0) const;
92  std::vector<cogs::Mesh> GetAllMeshes() const;
93 
95  [[nodiscard]] std::vector<std::string> GetMeshNames() const;
102  bool GetMeshByName(const std::string &name, cogs::Mesh &out_meshmodel) const;
103 
105  [[nodiscard]] uint32_t GetSkeletonCount() const;
112  bool GetSkeleton(cogs::Skeleton &out_skeleton, size_t id = 0) const;
113 
115  [[nodiscard]] std::vector<std::string> GetSkeletonNames() const;
122  bool GetSkeletonByName(const std::string &name, cogs::Skeleton &out_skeleton) const;
123 
130  bool GetArmature(cogs::Armature &out_armature) const;
131 
137  bool GetAllSkeletonActions(std::vector<cogs::SkeletonAction> &out_actions) const;
144  bool GetAllSkeletonActions(const std::string &skeleton_name, std::vector<cogs::SkeletonAction> &out_actions) const;
152  bool GetSkeletonActionByName(const std::string &skeleton_name, const std::string &action_name, cogs::SkeletonAction &out_action) const;
153 
154  private:
155  struct Impl;
156  Impl *m = nullptr;
157  };
158 
159 }
160 #endif /* !COGS_IMPORTER_H */
A Mesh is structure containing a point-cloud a triangulation and a material. Not all of these are req...
Definition: Mesh.h:21
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
Management class for a set of data points in a 3D space.
Definition: PointCloud.h:32
3D Graph structure, usually representing topology of a 3D model.
Definition: Skeleton.h:22
Universal file importer for COGS structures.
Definition: Importer.h:45
Set of 3D data points which are additionally organized over 2D grid.
Definition: Scan.h:22