Skip to content

Commit

Permalink
Merge pull request #1643 from alicevision/dev/exeClangDisable
Browse files Browse the repository at this point in the history
[software] Disable clang-format around program options
  • Loading branch information
fabiencastan authored Jan 11, 2024
2 parents a7bcaea + 3edcdc8 commit 3e4dff1
Show file tree
Hide file tree
Showing 89 changed files with 1,813 additions and 1,561 deletions.
10 changes: 6 additions & 4 deletions src/software/convert/main_convertMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ int aliceVision_main(int argc, char** argv)
std::string inputMeshPath;
std::string outputFilePath;

// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("inputMesh", po::value<std::string>(&inputMeshPath)->default_value(inputMeshPath),
"Mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).")
("output,o", po::value<std::string>(&outputFilePath)->default_value(outputFilePath),
"Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl)");
("inputMesh", po::value<std::string>(&inputMeshPath)->default_value(inputMeshPath),
"Mesh file path (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).")
("output,o", po::value<std::string>(&outputFilePath)->default_value(outputFilePath),
"Output file path for the new mesh file (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).");
// clang-format on

CmdLine cmdline("The program allows to convert a mesh to another mesh format.\n"
"AliceVision convertMesh");
Expand Down
49 changes: 26 additions & 23 deletions src/software/convert/main_convertSfMFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,32 @@ int aliceVision_main(int argc, char **argv)
bool flagStructure = true;
bool flagObservations = true;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputSfMDataFilename)->required(),
"Path to the output Alembic file.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
feature::EImageDescriberType_informations().c_str())
("imageWhiteList", po::value<std::vector<std::string>>(&imageWhiteList)->multitoken()->default_value(imageWhiteList),
"image white list containing uid(s), image filenames or regex(es) on the image file path (supported regex: '#' matches a single digit, '@' one or more digits, '?' one character and '*' zero or more)")
("views", po::value<bool>(&flagViews)->default_value(flagViews),
"Export views.")
("intrinsics", po::value<bool>(&flagIntrinsics)->default_value(flagIntrinsics),
"Export intrinsics.")
("extrinsics", po::value<bool>(&flagExtrinsics)->default_value(flagExtrinsics),
"Export extrinsics.")
("structure", po::value<bool>(&flagStructure)->default_value(flagStructure),
"Export structure.")
("observations", po::value<bool>(&flagObservations)->default_value(flagObservations),
"Export observations.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputSfMDataFilename)->required(),
"Path to the output Alembic file.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
feature::EImageDescriberType_informations().c_str())
("imageWhiteList", po::value<std::vector<std::string>>(&imageWhiteList)->multitoken()->default_value(imageWhiteList),
"Image white list containing uid(s), image filenames or regex(es) on the image file path (supported regex: '#'"
" matches a single digit, '@' one or more digits, '?' one character and '*' zero or more).")
("views", po::value<bool>(&flagViews)->default_value(flagViews),
"Export views.")
("intrinsics", po::value<bool>(&flagIntrinsics)->default_value(flagIntrinsics),
"Export intrinsics.")
("extrinsics", po::value<bool>(&flagExtrinsics)->default_value(flagExtrinsics),
"Export extrinsics.")
("structure", po::value<bool>(&flagStructure)->default_value(flagStructure),
"Export structure.")
("observations", po::value<bool>(&flagObservations)->default_value(flagObservations),
"Export observations.");
// clang-format on

CmdLine cmdline("AliceVision convertSfMFormat");
cmdline.add(requiredParams);
Expand Down
16 changes: 10 additions & 6 deletions src/software/convert/main_importKnownPoses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ int aliceVision_main(int argc, char **argv)

sfmData::SfMData sfmData;

// enter the parameter
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("knownPosesData", po::value<std::string>(&knownPosesFilePath)->required(), "Input path to a json file or a folder containing an XMP file per image.")
("sfmData", po::value<std::string>(&sfmDataFilePath)->required(), "SfmData filepath.")
("output,o", po::value<std::string>(&outputFilename)->required(), "Output sfmData filepath.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("knownPosesData", po::value<std::string>(&knownPosesFilePath)->required(),
"Input path to a json file or a folder containing an XMP file per image.")
("sfmData", po::value<std::string>(&sfmDataFilePath)->required(),
"SfmData filepath.")
("output,o", po::value<std::string>(&outputFilename)->required(),
"Output sfmData filepath.");
// clang-format on

CmdLine cmdline("AliceVision importKnownPoses");
cmdline.add(requiredParams);
Expand Down
2 changes: 2 additions & 0 deletions src/software/export/main_exportAnimatedCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ int aliceVision_main(int argc, char** argv)
std::string outImageFileTypeName = image::EImageFileType_enumToString(image::EImageFileType::JPEG);
std::string outMapFileTypeName = image::EImageFileType_enumToString(image::EImageFileType::EXR);

// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
Expand All @@ -135,6 +136,7 @@ int aliceVision_main(int argc, char** argv)
"Filter out cameras from the export if they are part of this SfMData. Export all cameras if empty.")
("undistortedImageType", po::value<std::string>(&outImageFileTypeName)->default_value(outImageFileTypeName),
image::EImageFileType_informations().c_str());
// clang-format on

CmdLine cmdline("AliceVision exportAnimatedCamera");
cmdline.add(requiredParams);
Expand Down
16 changes: 9 additions & 7 deletions src/software/export/main_exportColmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ int aliceVision_main(int argc, char* argv[])
std::string outDirectory;
bool copyImages{false};


// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(), "SfMData file.")
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"The base path where the folder structure will be created with the relevant cameras.txt, images.txt "
"and points3D.txt files.")
"The base path where the folder structure will be created with the relevant cameras.txt, images.txt "
"and points3D.txt files.")
("copyImages", po::value<bool>(&copyImages)->default_value(copyImages),
"Copy original images to colmap folder. This is required if your images are not all in the same "
"folder.");
"Copy original images to Colmap folder. This is required if your images are not all in the same "
"folder.");
// clang-format on

CmdLine cmdline("Export an AV sfmdata to a Colmap scene, creating the folder structure and "
CmdLine cmdline("Export an AV SfMData to a Colmap scene, creating the folder structure and "
"the scene files that can be used for running a MVS step.\n"
"AliceVision exportColmap");
cmdline.add(requiredParams);
Expand Down
17 changes: 8 additions & 9 deletions src/software/export/main_exportColoredPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ int aliceVision_main(int argc, char **argv)
std::string sfmDataFilename;
std::string outputSfMDataFilename;

po::options_description allParams("AliceVision exportColoredPointCloud");

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputSfMDataFilename)->required(),
"Output point cloud with visibilities as SfMData file.");

// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputSfMDataFilename)->required(),
"Output point cloud with visibilities as SfMData file.");
// clang-format on

CmdLine cmdline("AliceVision exportColoredPointCloud");
cmdline.add(requiredParams);
Expand Down
19 changes: 11 additions & 8 deletions src/software/export/main_exportDistortion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,25 @@ int aliceVision_main(int argc, char* argv[])
bool exportSTMaps = true;

// Command line parameters
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmInputDataFilepath)->required(),
"SfMData file input.")
"SfMData file input.")
("output,o", po::value<std::string>(&outputFilePath)->required(),
"Output directory.");
"Output directory.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("exportNukeNode", po::value<bool>(&exportNukeNode)->default_value(exportLensGridsUndistorted), "Export Nuke node as FILE.nk")
("exportSTMaps", po::value<bool>(&exportSTMaps)->default_value(exportLensGridsUndistorted), "Export STMaps")
("exportLensGridsUndistorted,e", po::value<bool>(&exportLensGridsUndistorted)->default_value(exportLensGridsUndistorted), "Export lens grids undistorted for validation")
;
("exportNukeNode", po::value<bool>(&exportNukeNode)->default_value(exportLensGridsUndistorted),
"Export Nuke node as FILE.nk.")
("exportSTMaps", po::value<bool>(&exportSTMaps)->default_value(exportLensGridsUndistorted),
"Export STMaps.")
("exportLensGridsUndistorted,e", po::value<bool>(&exportLensGridsUndistorted)->default_value(exportLensGridsUndistorted),
"Export lens grids undistorted for validation.");
// clang-format on


CmdLine cmdline("AliceVision export distortion");
CmdLine cmdline("AliceVision exportDistortion");
cmdline.add(requiredParams);
cmdline.add(optionalParams);

Expand Down
28 changes: 15 additions & 13 deletions src/software/export/main_exportKeypoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,21 @@ int aliceVision_main(int argc, char ** argv)

std::string describerTypesName = feature::EImageDescriberType_enumToString(feature::EImageDescriberType::SIFT);

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output path for keypoints.")
("featuresFolders,f", po::value<std::vector<std::string>>(&featuresFolders)->multitoken()->required(),
"Path to folder(s) containing the extracted features.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
feature::EImageDescriberType_informations().c_str());
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output path for keypoints.")
("featuresFolders,f", po::value<std::vector<std::string>>(&featuresFolders)->multitoken()->required(),
"Path to folder(s) containing the extracted features.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
feature::EImageDescriberType_informations().c_str());
// clang-format on

CmdLine cmdline("AliceVision exportKeypoints");
cmdline.add(requiredParams);
Expand Down
16 changes: 9 additions & 7 deletions src/software/export/main_exportMVE2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,15 @@ int aliceVision_main(int argc, char *argv[])

po::options_description allParams("AliceVision exportMVE2");

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.\n"
"Note: this program writes output in MVE file format");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.\n"
"Note: this program writes output in MVE file format.");
// clang-format on

CmdLine cmdline("AliceVision exportMVE2");
cmdline.add(requiredParams);
Expand Down
14 changes: 8 additions & 6 deletions src/software/export/main_exportMVSTexturing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ int aliceVision_main(int argc, char **argv)
std::string sfmDataFilename;
std::string outDirectory;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.");
// clang-format on

CmdLine cmdline("AliceVision exportMVSTexturing");
cmdline.add(requiredParams);
Expand Down
32 changes: 17 additions & 15 deletions src/software/export/main_exportMatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,23 @@ int aliceVision_main(int argc, char ** argv)

std::string describerTypesName = EImageDescriberType_enumToString(EImageDescriberType::SIFT);

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output path for matches.")
("featuresFolders,f", po::value<std::vector<std::string>>(&featuresFolders)->multitoken()->required(),
"Path to folder(s) containing the extracted features.")
("matchesFolders,m", po::value<std::vector<std::string>>(&matchesFolders)->multitoken()->required(),
"Path to folder(s) in which computed matches are stored.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
EImageDescriberType_informations().c_str());
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output path for matches.")
("featuresFolders,f", po::value<std::vector<std::string>>(&featuresFolders)->multitoken()->required(),
"Path to folder(s) containing the extracted features.")
("matchesFolders,m", po::value<std::vector<std::string>>(&matchesFolders)->multitoken()->required(),
"Path to folder(s) in which computed matches are stored.");

po::options_description optionalParams("Optional parameters");
optionalParams.add_options()
("describerTypes,d", po::value<std::string>(&describerTypesName)->default_value(describerTypesName),
EImageDescriberType_informations().c_str());
// clang-format on

CmdLine cmdline("AliceVision exportMatches");
cmdline.add(requiredParams);
Expand Down
14 changes: 8 additions & 6 deletions src/software/export/main_exportMatlab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ int aliceVision_main(int argc, char *argv[])
std::string sfmDataFilename;
std::string outputFolder;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output folder.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output folder.");
// clang-format on

CmdLine cmdline("AliceVision exportMatlab");
cmdline.add(requiredParams);
Expand Down
18 changes: 10 additions & 8 deletions src/software/export/main_exportMeshlab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ int aliceVision_main(int argc, char **argv)
std::string plyPath;
std::string outDirectory;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("ply", po::value<std::string>(&plyPath)->required(),
"Ply.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("ply", po::value<std::string>(&plyPath)->required(),
"PLY path.")
("output,o", po::value<std::string>(&outDirectory)->required(),
"Output folder.");
// clang-format on

CmdLine cmdline("AliceVision exportMeshlab");
cmdline.add(requiredParams);
Expand Down
14 changes: 8 additions & 6 deletions src/software/export/main_exportMeshroomMaya.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ int aliceVision_main(int argc, char **argv)
std::string sfmDataFilename;
std::string outputFolder;

po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output folder.");
// clang-format off
po::options_description requiredParams("Required parameters");
requiredParams.add_options()
("input,i", po::value<std::string>(&sfmDataFilename)->required(),
"SfMData file.")
("output,o", po::value<std::string>(&outputFolder)->required(),
"Output folder.");
// clang-format on

CmdLine cmdline("AliceVision exportMeshroomMaya");
cmdline.add(requiredParams);
Expand Down
Loading

0 comments on commit 3e4dff1

Please sign in to comment.