Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expansion of GoCAD interface #2586

Merged
merged 15 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
using ogs-mesh-counter instead of boost uuid
  • Loading branch information
rinkk authored and TomFischer committed Aug 12, 2019
commit e1d52987da564fd2c830163d828a34ef02adac41
12 changes: 3 additions & 9 deletions Applications/FileIO/GocadIO/GocadAsciiReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
}
Expand Down
5 changes: 0 additions & 5 deletions Applications/FileIO/GocadIO/GocadAsciiReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ class GocadAsciiReader final
/// 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);

Expand Down
6 changes: 3 additions & 3 deletions Applications/Utils/FileConverter/GocadTSurfaceReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down