The spica renderer
meshio.h
1 #ifdef _MSC_VER
2 #pragma once
3 #endif
4 
5 #ifndef _SPICA_MESHIO_H_
6 #define _SPICA_MESHIO_H_
7 
8 #include <string>
9 #include <vector>
10 #include <memory>
11 
12 #include "core/common.h"
13 #include "core/uncopyable.h"
14 #include "core/transform.h"
15 
16 namespace spica {
17 
21 class SPICA_EXPORTS ShapeGroup {
22 public:
23  ShapeGroup();
24  explicit ShapeGroup(
25  const std::vector<std::shared_ptr<Shape>>& shapes,
26  const std::shared_ptr<Texture<Spectrum>>& mapKd = nullptr,
27  const std::shared_ptr<Texture<double>> & bumpMap = nullptr);
28 
29  ~ShapeGroup();
30 
31  ShapeGroup(const ShapeGroup& sg);
32  ShapeGroup(ShapeGroup&& sg);
33 
34  ShapeGroup& operator=(const ShapeGroup& sg);
35  ShapeGroup& operator=(ShapeGroup&& sg);
36 
37  inline const std::vector<std::shared_ptr<Shape>>& shapes() const {
38  return shapes_;
39  }
40 
41  inline const std::shared_ptr<Texture<Spectrum>>& mapKd() const {
42  return mapKd_;
43  }
44 
45  inline const std::shared_ptr<Texture<double>>& bumpMap() const {
46  return bumpMap_;
47  }
48 
49 private:
50  std::vector<std::shared_ptr<Shape>> shapes_;
51  std::shared_ptr<Texture<Spectrum>> mapKd_ = nullptr;
52  std::shared_ptr<Texture<double>> bumpMap_ = nullptr;
53 };
54 
55 namespace meshio {
56 
57 SPICA_EXPORTS std::vector<ShapeGroup> loadOBJ(const std::string& filename,
58  const Transform& o2w = Transform());
59 
60 SPICA_EXPORTS std::vector<ShapeGroup> loadPLY(const std::string& filename,
61  const Transform& o2w = Transform());
62 
63 } // namespace meshio
64 
65 } // namespace spica
66 
67 #endif // _SPICA_MESHIO_H_
The transformation operator class.
Definition: transform.h:17
Shape with materials.
Definition: meshio.h:21