forked from swayfreeda/ImageBasedModellingEduV1.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaterial_lib.h
executable file
·43 lines (35 loc) · 1.02 KB
/
material_lib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (C) 2015, Nils Moehrle
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#ifndef TEX_MATERIALLIB_HEADER
#define TEX_MATERIALLIB_HEADER
#include <vector>
struct Material {
std::string diffuse_map;
};
/**
* Class representing a material lib of and obj model.
*/
class MaterialLib {
private:
std::vector<Material> materials;
std::vector<std::string> material_names;
public:
MaterialLib();
void add_material(std::string const & name, Material material);
std::size_t size();
/** Saves the material lib to an .mtl file and all textures of its
* materials with the given prefix.
*/
void save_to_files(std::string const & prefix) const;
};
inline std::size_t
MaterialLib::size() {
return materials.size();
}
#endif /* TEX_MATERIALLIB_HEADER */