Skip to content

Commit bee62cb

Browse files
gregoire-dlcbentejac
authored andcommitted
[mesh] Material: Change getAllTextures() signature
- Use `std::vector` instead of `StaticVector` - Use in/out vector
1 parent 7119a76 commit bee62cb

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/aliceVision/mesh/Material.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,14 @@ const StaticVector<std::string>& Material::getTextures(TextureType type) const
9393
}
9494
}
9595

96-
StaticVector<std::string> Material::getAllTextures() const
96+
void Material::getAllTexturePaths(std::vector<std::string>& texturePaths) const
9797
{
98-
StaticVector<std::string> textures;
99-
textures.resize(_bumpTextures.size() + _diffuseTextures.size() + _displacementTextures.size() + _normalTextures.size());
98+
texturePaths.resize(_bumpTextures.size() + _diffuseTextures.size() + _displacementTextures.size() + _normalTextures.size());
10099

101-
auto last = std::copy(_bumpTextures.begin(), _bumpTextures.end(), textures.begin());
100+
auto last = std::copy(_bumpTextures.begin(), _bumpTextures.end(), texturePaths.begin());
102101
last = std::copy(_diffuseTextures.begin(), _diffuseTextures.end(), last);
103102
last = std::copy(_displacementTextures.begin(), _displacementTextures.end(), last);
104103
std::copy(_normalTextures.begin(), _normalTextures.end(), last);
105-
106-
return textures;
107104
}
108105

109106
bool Material::hasTextures(TextureType type) const

src/aliceVision/mesh/Material.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class Material
5454
/// Get textures by type
5555
const StaticVector<std::string>& getTextures(TextureType type) const;
5656

57-
/// Get all textures used in the material
58-
StaticVector<std::string> getAllTextures() const;
57+
/// Get all texture paths used in the material
58+
void getAllTexturePaths(std::vector<std::string>& texturePaths) const;
5959

6060
/// Check if material has textures of a given type
6161
bool hasTextures(TextureType type) const;

0 commit comments

Comments
 (0)