Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
70 changes: 36 additions & 34 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
{
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/build/opengeode-io/include",
"${workspaceFolder}/build/third_party/assimp/install/include",
"${workspaceFolder}/build/third_party/pugixml/install/include",
"${workspaceFolder}/build/third_party/zlib/install/include",
"${workspaceFolder:OpenGeode}/include",
"${workspaceFolder:OpenGeode}/build/opengeode/include",
"${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include"
],
"C_Cpp.default.browse.path": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/build/opengeode-io/include",
"${workspaceFolder}/build/third_party/assimp/install/include",
"${workspaceFolder}/build/third_party/pugixml/install/include",
"${workspaceFolder}/build/third_party/zlib/install/include",
"${workspaceFolder:OpenGeode}/include",
"${workspaceFolder:OpenGeode}/build/opengeode/include",
"${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include"
],
"files.watcherExclude": {
"${workspaceFolder}/build/**": true
}
}
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/build/opengeode-io/include",
"${workspaceFolder}/build/third_party/assimp/install/include",
"${workspaceFolder}/build/third_party/pugixml/install/include",
"${workspaceFolder}/build/third_party/json/install/include",
"${workspaceFolder}/build/third_party/zlib/install/include",
"${workspaceFolder:OpenGeode}/include",
"${workspaceFolder:OpenGeode}/build/opengeode/include",
"${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include"
],
"C_Cpp.default.browse.path": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/build/opengeode-io/include",
"${workspaceFolder}/build/third_party/assimp/install/include",
"${workspaceFolder}/build/third_party/pugixml/install/include",
"${workspaceFolder}/build/third_party/json/install/include",
"${workspaceFolder}/build/third_party/zlib/install/include",
"${workspaceFolder:OpenGeode}/include",
"${workspaceFolder:OpenGeode}/build/opengeode/include",
"${workspaceFolder:OpenGeode}/build/third_party/abseil/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/bitsery/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/gdal/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/pybind11/install/include",
"${workspaceFolder:OpenGeode}/build/third_party/asyncplusplus/install/include"
],
"files.watcherExclude": {
"${workspaceFolder}/build/**": true
}
}
50 changes: 24 additions & 26 deletions include/geode/io/mesh/internal/csv_input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,35 @@ namespace geode
ALIAS_3D( PointSet );
} // namespace geode

namespace geode
namespace geode::internal
{
namespace internal
class CSVInput final : public PointSetInput< 3 >
{
class CSVInput final : public PointSetInput< 3 >
public:
explicit CSVInput( std::string_view filename )
: PointSetInput< 3 >( filename )
{
public:
explicit CSVInput( std::string_view filename )
: PointSetInput< 3 >( filename )
{
}
}

static std::string_view extension()
{
static constexpr auto EXT = "csv";
return EXT;
}
static std::string_view extension()
{
static constexpr auto EXT = "csv";
return EXT;
}

std::unique_ptr< PointSet3D > read( const MeshImpl& impl ) final;
[[nodiscard]] std::unique_ptr< PointSet3D > read(
const MeshImpl& impl ) final;

AdditionalFiles additional_files() const final;
[[nodiscard]] AdditionalFiles additional_files() const final;

index_t object_priority() const final
{
return 0;
}
[[nodiscard]] index_t object_priority() const final
{
return 0;
}

Percentage is_loadable() const final
{
return Percentage{ 1 };
}
};
} // namespace internal
} // namespace geode
[[nodiscard]] Percentage is_loadable() const final
{
return Percentage{ 1 };
}
};
} // namespace geode::internal
27 changes: 13 additions & 14 deletions src/geode/io/mesh/csv_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

#pragma once
#include <geode/io/mesh/internal/csv_input.hpp>

#include <fstream>
#include <optional>
Expand All @@ -47,7 +47,6 @@
#include <geode/basic/variable_attribute.hpp>

#include <geode/io/mesh/csv_input_helpers.hpp>
#include <geode/io/mesh/internal/csv_input.hpp>

#include <geode/mesh/builder/point_set_builder.hpp>
#include <geode/mesh/core/point_set.hpp>
Expand All @@ -57,7 +56,7 @@
class CSVInputImpl
{
public:
CSVInputImpl( std::string_view filename )
explicit CSVInputImpl( std::string_view filename )
: filename_{ filename },
json_filename_{ geode::to_string( filename.substr(
0, filename.find_last_of( '.' ) ) )
Expand All @@ -71,12 +70,12 @@
geode::CsvInputHelpers helpers{ filename_ };
nlohmann::json json;
json_file_ >> json;
helpers.set_first_row( json["FirstRow"] );
helpers.set_header_row( json["HeaderRow"] );
helpers.set_separator( json["Separator"].get< std::string >()[0] );
helpers.set_x_column( json["XColumn"] );
helpers.set_y_column( json["YColumn"] );
helpers.set_z_column( json["ZColumn"] );
helpers.set_first_row( json["firstRow"] );
helpers.set_header_row( json["headerRow"] );
helpers.set_separator( json["separator"].get< std::string >()[0] );
helpers.set_x_column( json["xColumn"] );
helpers.set_y_column( json["yColumn"] );
helpers.set_z_column( json["zColumn"] );
return helpers.create_point_set();
}

Expand All @@ -92,9 +91,9 @@
bool contains_all_info{ true };
nlohmann::json json;
json_file_ >> json;
if( !json.contains( "FirstRow" ) || !json.contains( "HeaderRow" )
|| !json.contains( "Separator" ) || !json.contains( "XColumn" )
|| !json.contains( "YColumn" ) || !json.contains( "ZColumn" ) )
if( !json.contains( "firstRow" ) || !json.contains( "headerRow" )
|| !json.contains( "separator" ) || !json.contains( "xColumn" )
|| !json.contains( "yColumn" ) || !json.contains( "zColumn" ) )
{
contains_all_info = false;
}
Expand All @@ -110,20 +109,20 @@
};
} // namespace

namespace geode

Check warning on line 112 in src/geode/io/mesh/csv_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/mesh/csv_input.cpp:112:1 [modernize-concat-nested-namespaces]

nested namespaces can be concatenated
{
namespace internal
{
std::unique_ptr< PointSet3D > CSVInput::read( const MeshImpl& impl )
{
geode_unused( impl );
CSVInputImpl reader{ this->filename() };
CSVInputImpl reader{ filename() };
return reader.point_set();
}

AdditionalFiles CSVInput::additional_files() const
{
CSVInputImpl reader{ this->filename() };
CSVInputImpl reader{ filename() };
return reader.additional_files();
}

Expand Down
12 changes: 6 additions & 6 deletions tests/data/missing_key_word.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FirstRow": 1,
"HeaderRow": 0,
"XColumn": 1,
"YColumn": 2,
"ZColumn": 3
}
"firstRow": 1,
"headerRow": 0,
"xColumn": 1,
"yColumn": 2,
"zColumn": 3
}
14 changes: 7 additions & 7 deletions tests/data/top_granitoid_vertices.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"FirstRow": 1,
"HeaderRow": 0,
"Separator": ",",
"XColumn": 0,
"YColumn": 1,
"ZColumn": 2
}
"firstRow": 1,
"headerRow": 0,
"separator": ",",
"xColumn": 0,
"yColumn": 1,
"zColumn": 2
}
Loading