From e1d52987da564fd2c830163d828a34ef02adac41 Mon Sep 17 00:00:00 2001 From: rinkk <karsten.rink@ufz.de> Date: Fri, 2 Aug 2019 11:45:55 +0200 Subject: [PATCH] using ogs-mesh-counter instead of boost uuid --- Applications/FileIO/GocadIO/GocadAsciiReader.cpp | 12 +++--------- Applications/FileIO/GocadIO/GocadAsciiReader.h | 5 ----- .../Utils/FileConverter/GocadTSurfaceReader.cpp | 6 +++--- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Applications/FileIO/GocadIO/GocadAsciiReader.cpp b/Applications/FileIO/GocadIO/GocadAsciiReader.cpp index 55eebbc2475..e98d0404027 100644 --- a/Applications/FileIO/GocadIO/GocadAsciiReader.cpp +++ b/Applications/FileIO/GocadIO/GocadAsciiReader.cpp @@ -13,10 +13,6 @@ #include <fstream> -#include <boost/uuid/uuid.hpp> -#include <boost/uuid/uuid_generators.hpp> -#include <boost/uuid/uuid_io.hpp> - #include "Applications/FileIO/GocadIO/CoordinateSystem.h" #include "BaseLib/FileTools.h" #include "BaseLib/StringTools.h" @@ -44,18 +40,16 @@ GocadAsciiReader::GocadAsciiReader(GocadDataType const t) /// another dataset with the same name exists. void checkMeshNames(std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes) { - boost::uuids::random_generator generator; std::size_t const n_meshes = meshes.size(); for (std::size_t i=0; i<n_meshes; ++i) { - std::string name = meshes[i]->getName(); + std::string const& name = meshes[i]->getName(); for (std::size_t j=i+1; j<n_meshes; ++j) { if (meshes[j]->getName() == name) { - boost::uuids::uuid mesh_id = generator(); - std::string id_str = boost::lexical_cast<std::string>(mesh_id); - meshes[i]->setName(name + "--" + id_str); + std::string const id_str = std::to_string(meshes[j]->getID()); + meshes[i]->setName(name + "--importID-" + id_str); break; } } diff --git a/Applications/FileIO/GocadIO/GocadAsciiReader.h b/Applications/FileIO/GocadIO/GocadAsciiReader.h index be2de9ecea6..a4958668ded 100644 --- a/Applications/FileIO/GocadIO/GocadAsciiReader.h +++ b/Applications/FileIO/GocadIO/GocadAsciiReader.h @@ -45,11 +45,6 @@ public: /// Constructor taking a specific data type (will only export that type) explicit GocadAsciiReader(GocadDataType const t); - GocadAsciiReader(GocadAsciiReader&& src) = delete; - GocadAsciiReader(GocadAsciiReader const& src) = delete; - GocadAsciiReader& operator=(GocadAsciiReader&& rhs) = delete; - GocadAsciiReader& operator=(GocadAsciiReader const& rhs) = delete; - /// Reads the specified file and writes data into internal mesh vector bool readFile(std::string const& file_name, std::vector<std::unique_ptr<MeshLib::Mesh>>& meshes); diff --git a/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp b/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp index bb09d45f7e3..9f857412733 100644 --- a/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp +++ b/Applications/Utils/FileConverter/GocadTSurfaceReader.cpp @@ -71,11 +71,11 @@ int main(int argc, char* argv[]) std::string const file_name (input_arg.getValue()); - FileIO::Gocad::GOCAD_DATA_TYPE t (FileIO::Gocad::GOCAD_DATA_TYPE::ALL); + FileIO::Gocad::GocadDataType t(FileIO::Gocad::GocadDataType::ALL); if (export_lines_arg.isSet()) - t = FileIO::Gocad::GOCAD_DATA_TYPE::PLINE; + t = FileIO::Gocad::GocadDataType::PLINE; if (export_surfaces_arg.isSet()) - t = FileIO::Gocad::GOCAD_DATA_TYPE::TSURF; + t = FileIO::Gocad::GocadDataType::TSURF; FileIO::Gocad::GocadAsciiReader gcts(t); std::vector<std::unique_ptr<MeshLib::Mesh>> meshes; if (!gcts.readFile(file_name, meshes)) -- GitLab