Skip to content
Snippets Groups Projects
Commit e1d52987 authored by Karsten Rink's avatar Karsten Rink Committed by Tom Fischer
Browse files

using ogs-mesh-counter instead of boost uuid

parent 8bf1634b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
......@@ -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);
......
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment