Use vector instead of list

This commit is contained in:
Jan Möbius
2023-02-27 16:16:09 +01:00
parent 347c5ca12e
commit ed04dbb942
2 changed files with 3 additions and 5 deletions

View File

@@ -137,8 +137,8 @@ bool _PLYReader_::read(std::istream& _in, BaseImporter& _bi, Options& _opt) {
// Add TextureFiles // Add TextureFiles
int texture_index = 0; int texture_index = 0;
for(auto texture_file = texture_files_.begin(); texture_file != texture_files_.end(); texture_file++) { for(auto const & texture_file : texture_files_) {
_bi.add_texture_information(texture_index++, *texture_file); _bi.add_texture_information(texture_index++, texture_file);
} }
// filter relevant options for reading // filter relevant options for reading
@@ -1351,10 +1351,8 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
if (keyword == "comment") { if (keyword == "comment") {
std::getline(_is, line); std::getline(_is, line);
std::cerr << "Comment detected : " << line << std::endl;
// TextureFile // TextureFile
if (line.rfind(" TextureFile ", 0) == 0) { if (line.rfind(" TextureFile ", 0) == 0) {
std::cerr << "Comment is Texture File: " << line.substr(13) << std::endl;
texture_files_.push_back(line.substr(13)); texture_files_.push_back(line.substr(13));
} }
} else if (keyword == "element") { } else if (keyword == "element") {

View File

@@ -201,7 +201,7 @@ private:
mutable std::vector< ElementInfo > elements_; mutable std::vector< ElementInfo > elements_;
mutable std::list< std::string > texture_files_; mutable std::vector< std::string > texture_files_;
template<typename T> template<typename T>
inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType /*_binary*/) const inline void read(_PLYReader_::ValueType _type, std::istream& _in, T& _value, OpenMesh::GenProg::TrueType /*_binary*/) const