diff --git a/.vscode/settings.json b/.vscode/settings.json index 78136e6a..dae6cba4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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 - } -} \ No newline at end of file + "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 + } +} diff --git a/include/geode/io/mesh/internal/csv_input.hpp b/include/geode/io/mesh/internal/csv_input.hpp index 3d3c1eab..d6a8e560 100644 --- a/include/geode/io/mesh/internal/csv_input.hpp +++ b/include/geode/io/mesh/internal/csv_input.hpp @@ -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 \ No newline at end of file + [[nodiscard]] Percentage is_loadable() const final + { + return Percentage{ 1 }; + } + }; +} // namespace geode::internal \ No newline at end of file diff --git a/src/geode/io/mesh/csv_input.cpp b/src/geode/io/mesh/csv_input.cpp index 857f273b..58baed92 100644 --- a/src/geode/io/mesh/csv_input.cpp +++ b/src/geode/io/mesh/csv_input.cpp @@ -21,7 +21,7 @@ * */ -#pragma once +#include #include #include @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -57,7 +56,7 @@ namespace 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( '.' ) ) ) @@ -71,12 +70,12 @@ namespace 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(); } @@ -92,9 +91,9 @@ namespace 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; } @@ -117,13 +116,13 @@ namespace geode 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(); } diff --git a/tests/data/missing_key_word.json b/tests/data/missing_key_word.json index b76ed0e8..0d970e8b 100644 --- a/tests/data/missing_key_word.json +++ b/tests/data/missing_key_word.json @@ -1,7 +1,7 @@ { - "FirstRow": 1, - "HeaderRow": 0, - "XColumn": 1, - "YColumn": 2, - "ZColumn": 3 -} \ No newline at end of file + "firstRow": 1, + "headerRow": 0, + "xColumn": 1, + "yColumn": 2, + "zColumn": 3 +} diff --git a/tests/data/top_granitoid_vertices.json b/tests/data/top_granitoid_vertices.json index ff4c3a54..71d28d86 100644 --- a/tests/data/top_granitoid_vertices.json +++ b/tests/data/top_granitoid_vertices.json @@ -1,8 +1,8 @@ { - "FirstRow": 1, - "HeaderRow": 0, - "Separator": ",", - "XColumn": 0, - "YColumn": 1, - "ZColumn": 2 -} \ No newline at end of file + "firstRow": 1, + "headerRow": 0, + "separator": ",", + "xColumn": 0, + "yColumn": 1, + "zColumn": 2 +}