diff --git a/apps/makescene/makescene.cc b/apps/makescene/makescene.cc index 30af68908..3664f52b4 100644 --- a/apps/makescene/makescene.cc +++ b/apps/makescene/makescene.cc @@ -33,7 +33,7 @@ #include "util/system.h" #include "util/timer.h" #include "util/arguments.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/file_system.h" #include "util/tokenizer.h" #include "mve/bundle.h" @@ -353,10 +353,10 @@ import_bundle_nvm_or_colmap (AppSettings const& conf, bool load_nvm = true) if (cam_infos.size() != cameras.size()) { if (load_nvm) - std::cerr << "Error: NVM info inconsistent with bundle!" + std::cerr << "Error: NVM info inconsistent with bundle!" << std::endl; else - std::cerr << "Error: Colmap info inconsistent with bundle!" + std::cerr << "Error: Colmap info inconsistent with bundle!" << std::endl; return; } @@ -860,19 +860,19 @@ is_colmap_sfm_bundle_format (AppSettings const& conf) std::string cameras_txt_filename = join_path(model_path, "cameras.txt"); std::string cameras_bin_filename = join_path(model_path, "cameras.bin"); - if (!util::fs::file_exists(cameras_txt_filename.c_str()) && + if (!util::fs::file_exists(cameras_txt_filename.c_str()) && !util::fs::file_exists(cameras_bin_filename.c_str())) return false; std::string images_txt_filename = join_path(model_path, "images.txt"); std::string images_bin_filename = join_path(model_path, "images.bin"); - if (!util::fs::file_exists(images_txt_filename.c_str()) && + if (!util::fs::file_exists(images_txt_filename.c_str()) && !util::fs::file_exists(images_bin_filename.c_str())) return false; std::string points_3D_txt_filename = join_path(model_path, "points3D.txt"); std::string points_3D_bin_filename = join_path(model_path, "points3D.bin"); - if (!util::fs::file_exists(points_3D_txt_filename.c_str()) && + if (!util::fs::file_exists(points_3D_txt_filename.c_str()) && !util::fs::file_exists(points_3D_bin_filename.c_str())) return false; @@ -917,7 +917,7 @@ import_bundle (AppSettings const& conf) /** * Try to detect Colmap bundle format. - * In this case the input folder contains files with extension ".txt" or + * In this case the input folder contains files with extension ".txt" or * ".bin". */ if (is_colmap_sfm_bundle_format(conf)) diff --git a/apps/meshalign/meshalign.cc b/apps/meshalign/meshalign.cc index 3c60526eb..12aa910e7 100644 --- a/apps/meshalign/meshalign.cc +++ b/apps/meshalign/meshalign.cc @@ -15,7 +15,7 @@ #include "util/system.h" #include "util/file_system.h" #include "util/arguments.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/mesh.h" #include "mve/mesh_io.h" #include "mve/mesh_tools.h" diff --git a/apps/meshalign/meshlab_alignment.cc b/apps/meshalign/meshlab_alignment.cc index fc32663a2..0fce409be 100644 --- a/apps/meshalign/meshlab_alignment.cc +++ b/apps/meshalign/meshlab_alignment.cc @@ -13,7 +13,7 @@ #include #include "util/exception.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/file_system.h" #include "util/tokenizer.h" #include "mve/mesh_io.h" diff --git a/apps/meshalign/stanford_alignment.cc b/apps/meshalign/stanford_alignment.cc index 8e776fecb..9a84b4f88 100644 --- a/apps/meshalign/stanford_alignment.cc +++ b/apps/meshalign/stanford_alignment.cc @@ -13,7 +13,7 @@ #include #include "util/file_system.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/exception.h" #include "util/tokenizer.h" #include "mve/mesh.h" diff --git a/apps/meshconvert/meshconvert.cc b/apps/meshconvert/meshconvert.cc index 563c9abbd..1e40dc358 100644 --- a/apps/meshconvert/meshconvert.cc +++ b/apps/meshconvert/meshconvert.cc @@ -13,7 +13,7 @@ #include "util/system.h" #include "util/arguments.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/mesh_io.h" #include "mve/mesh_io_ply.h" diff --git a/apps/umve/jobqueue.cc b/apps/umve/jobqueue.cc index e66b6a0aa..799aaa435 100644 --- a/apps/umve/jobqueue.cc +++ b/apps/umve/jobqueue.cc @@ -11,7 +11,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "jobqueue.h" JobQueue* diff --git a/apps/umve/scene_addins/camera_sequence.cc b/apps/umve/scene_addins/camera_sequence.cc index e4a85496d..f168523e6 100644 --- a/apps/umve/scene_addins/camera_sequence.cc +++ b/apps/umve/scene_addins/camera_sequence.cc @@ -14,7 +14,7 @@ #include "util/exception.h" #include "util/tokenizer.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "scene_addins/camera_sequence.h" diff --git a/apps/umve/scene_addins/mesh_list.cc b/apps/umve/scene_addins/mesh_list.cc index afc635b76..58d820e0b 100644 --- a/apps/umve/scene_addins/mesh_list.cc +++ b/apps/umve/scene_addins/mesh_list.cc @@ -19,7 +19,7 @@ #include #include "util/file_system.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/mesh.h" #include "mve/mesh_io.h" #include "mve/mesh_tools.h" diff --git a/apps/umve/sceneoverview.cc b/apps/umve/sceneoverview.cc index 0828e00a0..1b9b99b34 100644 --- a/apps/umve/sceneoverview.cc +++ b/apps/umve/sceneoverview.cc @@ -9,7 +9,7 @@ #include -#include "util/strings.h" +#include "util/string_utils.h" #include "guihelpers.h" #include "scenemanager.h" diff --git a/apps/umve/viewinspect/tonemapping.cc b/apps/umve/viewinspect/tonemapping.cc index 3620e3c3f..ea9954130 100644 --- a/apps/umve/viewinspect/tonemapping.cc +++ b/apps/umve/viewinspect/tonemapping.cc @@ -17,7 +17,7 @@ #include #include "util/timer.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/image.h" #include "mve/image_tools.h" diff --git a/libs/dmrecon/dmrecon.cc b/libs/dmrecon/dmrecon.cc index 67a065e65..e9558a7a2 100644 --- a/libs/dmrecon/dmrecon.cc +++ b/libs/dmrecon/dmrecon.cc @@ -20,7 +20,7 @@ #include "mve/image.h" #include "mve/image_tools.h" #include "util/file_system.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "dmrecon/settings.h" #include "dmrecon/dmrecon.h" #include "dmrecon/global_view_selection.h" diff --git a/libs/dmrecon/patch_optimization.cc b/libs/dmrecon/patch_optimization.cc index 329eb98ae..e1862276b 100644 --- a/libs/dmrecon/patch_optimization.cc +++ b/libs/dmrecon/patch_optimization.cc @@ -7,7 +7,7 @@ * of the BSD 3-Clause license. See the LICENSE.txt file for details. */ -#include "util/strings.h" +#include "util/string_utils.h" #include "math/algo.h" #include "math/defines.h" #include "math/matrix.h" diff --git a/libs/fssr/iso_octree.cc b/libs/fssr/iso_octree.cc index c054caa98..7f6c80f29 100644 --- a/libs/fssr/iso_octree.cc +++ b/libs/fssr/iso_octree.cc @@ -18,7 +18,7 @@ #include #include "util/timer.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "fssr/basis_function.h" #include "fssr/sample.h" #include "fssr/iso_octree.h" diff --git a/libs/mve/bundle_io.cc b/libs/mve/bundle_io.cc index 7f56d459e..c3fcd9bf4 100644 --- a/libs/mve/bundle_io.cc +++ b/libs/mve/bundle_io.cc @@ -17,7 +17,7 @@ #include "util/system.h" #include "util/file_system.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/exception.h" #include "math/matrix.h" #include "math/vector.h" @@ -562,7 +562,7 @@ create_camera_info_from_params(CameraInfo& camera_info, camera_info.ppoint[0] = params[2] / width; camera_info.ppoint[1] = params[3] / height; } - else + else { std::string msg = "Unsupported camera model with radial distortion " "detected! If possible, re-run the SfM reconstruction with the " @@ -700,7 +700,7 @@ load_colmap_images_txt(std::string const& images_filename, CameraInfo model = camera_colmap_id_to_model.at(camera_colmap_id); initialize_bundle_cam(model, quat, trans, &bundle_cam); determine_depth_map_path(depth_path, image_name, &depth_map_name); - initialize_cam_info(model, image_path, image_name, depth_path, + initialize_cam_info(model, image_path, image_name, depth_path, depth_map_name, &colmap_cam_info); std::string point_2d_line; @@ -712,7 +712,7 @@ load_colmap_images_txt(std::string const& images_filename, ref.view_id = view_id; point_2d_line_ss >> ref.pos[0] >> ref.pos[1]; point_2d_line_ss >> feature_3d_colmap_id; - // A POINT2D that does not correspond to a POINT3D has a POINT3D_ID + // A POINT2D that does not correspond to a POINT3D has a POINT3D_ID // of -1 if (feature_3d_colmap_id == -1) ref.feature_id = -1; @@ -722,7 +722,7 @@ load_colmap_images_txt(std::string const& images_filename, } bundle_cams.push_back(bundle_cam); colmap_cams_info.push_back(colmap_cam_info); - } + } if (camera_info != nullptr) std::swap(*camera_info, colmap_cams_info); in_images.close(); @@ -772,9 +772,9 @@ load_colmap_points_3D_txt(std::string const& points3D_filename, int feature_2d_idx; // starts at 0 point_3d_line_ss >> view_colmap_id >> feature_2d_idx; int view_id = view_colmap_id - 1; - // Make sure that each point only has a single observation per + // Make sure that each point only has a single observation per // image, since MVE does not support multiple observations. - if (std::find(view_ids.begin(), view_ids.end(), view_id) != + if (std::find(view_ids.begin(), view_ids.end(), view_id) != view_ids.end()) continue; view_ids.push_back(view_id); @@ -911,19 +911,19 @@ load_colmap_images_bin(std::string const& images_filename, CameraInfo model = camera_colmap_id_to_model.at(camera_colmap_id); initialize_bundle_cam(model, quat, trans, &bundle_cam); determine_depth_map_path(depth_path, image_name, &depth_map_name); - initialize_cam_info(model, image_path, image_name, depth_path, + initialize_cam_info(model, image_path, image_name, depth_path, depth_map_name, &colmap_cam_info); const std::size_t num_points_2D = read_binary_little_endian( &in_images); - for (std::size_t point_2d_idx = 0; point_2d_idx < num_points_2D; - ++point_2d_idx) + for (std::size_t point_2d_idx = 0; point_2d_idx < num_points_2D; + ++point_2d_idx) { Bundle::Feature2D ref; ref.view_id = view_id; ref.pos[0] = (float)read_binary_little_endian(&in_images); ref.pos[1] = (float)read_binary_little_endian(&in_images); - // A POINT2D that does not correspond to a POINT3D has a POINT3D_ID + // A POINT2D that does not correspond to a POINT3D has a POINT3D_ID // of -1 feature_3d_colmap_id = (uint32_t)read_binary_little_endian< point3D_t>(&in_images); @@ -955,7 +955,7 @@ load_colmap_points_3D_bin(std::string const& points3D_filename, Bundle::Features& features = bundle->get_features(); features.reserve(num_features); std::size_t num_views = bundle->get_cameras().size(); - for (std::size_t feature_3d_idx = 0; feature_3d_idx < num_features; + for (std::size_t feature_3d_idx = 0; feature_3d_idx < num_features; ++feature_3d_idx) { Bundle::Feature3D feature_3d; @@ -987,9 +987,9 @@ load_colmap_points_3D_bin(std::string const& points3D_filename, view_colmap_id = read_binary_little_endian(&in_points3D); int view_id = view_colmap_id - 1; feature_2d_idx = read_binary_little_endian(&in_points3D); - // Make sure that each point only has a single observation per + // Make sure that each point only has a single observation per // image, since MVE does not support multiple observations. - if (std::find(view_ids.begin(), view_ids.end(), + if (std::find(view_ids.begin(), view_ids.end(), view_id) != view_ids.end()) continue; view_ids.push_back(view_id); @@ -1006,7 +1006,7 @@ load_colmap_points_3D_bin(std::string const& points3D_filename, num_refs = refs.size(); /* There should be at least 2 cameras that see the point. */ - if (num_refs < 2 || num_refs > num_views) + if (num_refs < 2 || num_refs > num_views) { throw util::Exception("Invalid number of feature refs: ", util::string::get(num_refs)); @@ -1154,7 +1154,7 @@ load_colmap_depth_map(int scale, mve::CameraInfo& mve_cam, int original_width, math::Matrix3f inv_calib; mve_cam.fill_inverse_calibration(*inv_calib, original_width, original_height); - mve::image::depthmap_convert_conventions(depth_image, inv_calib, + mve::image::depthmap_convert_conventions(depth_image, inv_calib, true); if (depth_width == original_width && depth_height == original_height) diff --git a/libs/mve/image_base.h b/libs/mve/image_base.h index a3669995e..b8062cdb0 100644 --- a/libs/mve/image_base.h +++ b/libs/mve/image_base.h @@ -14,7 +14,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/defines.h" MVE_NAMESPACE_BEGIN diff --git a/libs/mve/image_exif.cc b/libs/mve/image_exif.cc index 01103c9dc..d5263eb05 100644 --- a/libs/mve/image_exif.cc +++ b/libs/mve/image_exif.cc @@ -35,7 +35,7 @@ #include #include "util/system.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/image_exif.h" MVE_NAMESPACE_BEGIN diff --git a/libs/mve/image_io.cc b/libs/mve/image_io.cc index 77b154d14..6e0273d53 100644 --- a/libs/mve/image_io.cc +++ b/libs/mve/image_io.cc @@ -34,7 +34,7 @@ #include "math/algo.h" #include "util/exception.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/system.h" #include "mve/image_io.h" diff --git a/libs/mve/mesh_io.cc b/libs/mve/mesh_io.cc index 5c24f5952..281ace43b 100644 --- a/libs/mve/mesh_io.cc +++ b/libs/mve/mesh_io.cc @@ -9,7 +9,7 @@ #include -#include "util/strings.h" +#include "util/string_utils.h" #include "mve/mesh.h" #include "mve/mesh_io.h" #include "mve/mesh_io_ply.h" diff --git a/libs/mve/mesh_io_obj.cc b/libs/mve/mesh_io_obj.cc index 6fb22b493..e4a4234ca 100644 --- a/libs/mve/mesh_io_obj.cc +++ b/libs/mve/mesh_io_obj.cc @@ -13,7 +13,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "util/tokenizer.h" #include "util/exception.h" #include "util/file_system.h" diff --git a/libs/ogl/check_gl_error.h b/libs/ogl/check_gl_error.h index 5fd71c9e4..6c22388ad 100644 --- a/libs/ogl/check_gl_error.h +++ b/libs/ogl/check_gl_error.h @@ -14,7 +14,7 @@ #include "ogl/defines.h" #include "ogl/opengl.h" -#include "util/strings.h" +#include "util/string_utils.h" OGL_NAMESPACE_BEGIN diff --git a/libs/util/arguments.cc b/libs/util/arguments.cc index 4e40f22cc..d4a3a42c7 100644 --- a/libs/util/arguments.cc +++ b/libs/util/arguments.cc @@ -13,7 +13,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "util/tokenizer.h" #include "util/arguments.h" diff --git a/libs/util/arguments.h b/libs/util/arguments.h index a6845909f..7fa24d94c 100644 --- a/libs/util/arguments.h +++ b/libs/util/arguments.h @@ -15,7 +15,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "util/defines.h" #include "util/exception.h" diff --git a/libs/util/ini_parser.cc b/libs/util/ini_parser.cc index ee41bc24a..af9e58fc4 100644 --- a/libs/util/ini_parser.cc +++ b/libs/util/ini_parser.cc @@ -10,7 +10,7 @@ #include #include "util/exception.h" -#include "util/strings.h" +#include "util/string_utils.h" #include "util/ini_parser.h" UTIL_NAMESPACE_BEGIN diff --git a/libs/util/strings.h b/libs/util/string_utils.h similarity index 99% rename from libs/util/strings.h rename to libs/util/string_utils.h index ee2aabdaa..9eb126307 100644 --- a/libs/util/strings.h +++ b/libs/util/string_utils.h @@ -7,8 +7,8 @@ * of the BSD 3-Clause license. See the LICENSE.txt file for details. */ -#ifndef UTIL_STRING_HEADER -#define UTIL_STRING_HEADER +#ifndef UTIL_STRING_UTILS_HEADER +#define UTIL_STRING_UTILS_HEADER #include #include @@ -511,4 +511,4 @@ get_size_string (std::size_t size) UTIL_STRING_NAMESPACE_END UTIL_NAMESPACE_END -#endif /* UTIL_STRING_HEADER */ +#endif /* UTIL_STRING_UTILS_HEADER */ diff --git a/libs/util/tokenizer.h b/libs/util/tokenizer.h index 8e5b76956..611f6b8ae 100644 --- a/libs/util/tokenizer.h +++ b/libs/util/tokenizer.h @@ -15,7 +15,7 @@ #include #include -#include "util/strings.h" +#include "util/string_utils.h" #include "util/defines.h" UTIL_NAMESPACE_BEGIN diff --git a/tests/util/gtest_string.cc b/tests/util/gtest_string_utils.cc similarity index 94% rename from tests/util/gtest_string.cc rename to tests/util/gtest_string_utils.cc index e7e863423..1343017dc 100644 --- a/tests/util/gtest_string.cc +++ b/tests/util/gtest_string_utils.cc @@ -3,9 +3,9 @@ #include -#include "util/strings.h" +#include "util/string_utils.h" -TEST(StringTest, LowerUpperCaseTest) +TEST(StringUtilsTest, LowerUpperCaseTest) { /* Test to lowerstring and to upper string. */ std::string str = "Test aAzZ 012349 STRING !! #$%"; @@ -15,7 +15,7 @@ TEST(StringTest, LowerUpperCaseTest) EXPECT_EQ(str_lc, util::string::lowercase(str)); } -TEST(StringTest, StringConversionTest) +TEST(StringUtilsTest, StringConversionTest) { EXPECT_EQ("1230", util::string::get(1230)); EXPECT_EQ("0.1", util::string::get(0.1)); @@ -61,7 +61,7 @@ TEST(StringTest, StringConversionTest) EXPECT_EQ("", util::string::convert("", false)); } -TEST(StringTest, LeftRightSubstringTest) +TEST(StringUtilsTest, LeftRightSubstringTest) { std::string str = "123456"; EXPECT_EQ("1234", util::string::left(str, 4)); @@ -70,7 +70,7 @@ TEST(StringTest, LeftRightSubstringTest) EXPECT_EQ("123456", util::string::right(str, 8)); } -TEST(StringTest, ClipAndChopTest) +TEST(StringUtilsTest, ClipAndChopTest) { std::string str1 = "\t \t test\t "; std::string str2 = " \t \t test\t"; @@ -89,7 +89,7 @@ TEST(StringTest, ClipAndChopTest) EXPECT_EQ("test", util::string::clipped_newlines(str7)); } -TEST(StringTest, PunctateTest) +TEST(StringUtilsTest, PunctateTest) { std::string str = "1234567890"; EXPECT_EQ("12.3456.7890", util::string::punctated(str, '.', 4)); @@ -106,7 +106,7 @@ TEST(StringTest, PunctateTest) EXPECT_EQ("1.234", util::string::punctated("1234", '.', 3)); } -TEST(StringTest, WordWrapTest) +TEST(StringUtilsTest, WordWrapTest) { std::string str1 = "some longword"; EXPECT_EQ("some\nlongword", util::string::wordwrap(str1.c_str(), 4)); @@ -120,7 +120,7 @@ TEST(StringTest, WordWrapTest) EXPECT_EQ("some\nlong word", util::string::wordwrap(str3.c_str(), 9)); } -TEST(StringTest, StringNormalizationTest) +TEST(StringUtilsTest, StringNormalizationTest) { std::string str = " string \t that\tis pretty messy \t"; std::string str_gt = " string that is pretty messy ";