From c226bc2d630f886969509e5a7b13d0a8513c6c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 6 Oct 2020 21:54:30 +0200 Subject: [PATCH] Doc++ --- doc/building.dox | 6 +++++- doc/cmake.dox | 2 ++ src/Magnum/MeshTools/sceneconverter.cpp | 19 ++++++++++--------- src/Magnum/Trade/imageconverter.cpp | 8 ++++---- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/doc/building.dox b/doc/building.dox index 9a09303ff..928997b14 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -620,7 +620,11 @@ There are also a few command-line utilities, also all disabled by default: `TARGET_GL` to be enabled; enables building of one of the windowless application libraries based on the target platform. - `WITH_IMAGECONVERTER` --- Build the @ref magnum-imageconverter "magnum-imageconverter" - executable for converting images of different formats. + executable for converting images of different formats. Enables also + building of the @ref Trade library. +- `WITH_SCENECONVERTER` --- Build the @ref magnum-shaderconverter "magnum-sceneconverter" + executable for converting scenes of different formats. Enables also + building of the @ref MeshTools library. Options controlling the build: diff --git a/doc/cmake.dox b/doc/cmake.dox index e972e6383..661c0f983 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -267,6 +267,8 @@ Lastly, a few utility executables are available: executable - `imageconverter` --- @ref magnum-imageconverter "magnum-imageconverter" executable +- `sceneconverter` --- @ref magnum-sceneconverter "magnum-imageconverter" + executable - `gl-info` --- @ref magnum-gl-info "magnum-gl-info" executable - `al-info` --- @ref magnum-al-info "magnum-al-info" executable diff --git a/src/Magnum/MeshTools/sceneconverter.cpp b/src/Magnum/MeshTools/sceneconverter.cpp index 27e01ce40..6dfed61cc 100644 --- a/src/Magnum/MeshTools/sceneconverter.cpp +++ b/src/Magnum/MeshTools/sceneconverter.cpp @@ -86,7 +86,7 @@ magnum-sceneconverter [-h|--help] [-I|--importer IMPORTER] Arguments: - `input` --- input file -- `output` --- output file +- `output` --- output file, ignored if `--info` is present - `-h`, `--help` --- display this help message and exit - `-I`, `--importer IMPORTER` --- scene importer plugin (default: @ref Trade::AnySceneImporter "AnySceneImporter") @@ -119,16 +119,16 @@ converter plugin configuration. If the `=` character is omitted, it's equivalent to saying `key=true`; configuration subgroups are delimited with `/`. -It's possible to specify the `--converter` option (and correspondingly also -`-c` / `--converter-options`) multiple times in order to chain more converters -together. All converters in the chain have to support the +It's possible to specify the `-C` / `--converter` option (and correspondingly +also `-c` / `--converter-options`) multiple times in order to chain more +converters together. All converters in the chain have to support the @ref Trade::SceneConverterFeature::ConvertMesh feature, the last converter either @ref Trade::SceneConverterFeature::ConvertMesh or @ref Trade::SceneConverterFeature::ConvertMeshToFile. If the last converter doesn't support conversion to a file, @ref Trade::AnySceneConverter "AnySceneConverter" is used to save its output; -if no `--converter` is specified, @ref Trade::AnySceneConverter "AnySceneConverter" -is used. +if no `-C` / `--converter` is specified, +@ref Trade::AnySceneConverter "AnySceneConverter" is used. @section magnum-sceneconverter-example Example usage @@ -199,7 +199,7 @@ UnsignedInt namedAttributeId(const Trade::MeshData& mesh, UnsignedInt id) { int main(int argc, char** argv) { Utility::Arguments args; args.addArgument("input").setHelp("input", "input file") - .addArgument("output").setHelp("output", "output file") + .addArgument("output").setHelp("output", "output file, ignored if --info is present") .addOption('I', "importer", "AnySceneImporter").setHelp("importer", "scene importer plugin") .addArrayOption('C', "converter").setHelp("converter", "scene converter plugin(s)") .addOption("plugin-dir").setHelp("plugin-dir", "override base plugin dir", "DIR") @@ -232,12 +232,13 @@ comma-separated list of key/value pairs to set in the importer / converter plugin configuration. If the = character is omitted, it's equivalent to saying key=true; configuration subgroups are delimited with /. -It's possible to specify the --converter option (and correspondingly also +It's possible to specify the -C / --converter option (and correspondingly also -c / --converter-options) multiple times in order to chain more converters together. All converters in the chain have to support the ConvertMesh feature, the last converter either ConvertMesh or ConvertMeshToFile. If the last converter doesn't support conversion to a file, AnySceneConverter is used to -save its output; if no --converter is specified, AnySceneConverter is used.)") +save its output; if no -C / --converter is specified, AnySceneConverter is +used.)") .parse(argc, argv); PluginManager::Manager importerManager{ diff --git a/src/Magnum/Trade/imageconverter.cpp b/src/Magnum/Trade/imageconverter.cpp index 6611d1f36..554295f6e 100644 --- a/src/Magnum/Trade/imageconverter.cpp +++ b/src/Magnum/Trade/imageconverter.cpp @@ -75,7 +75,7 @@ magnum-imageconverter [-h|--help] [-I|--importer IMPORTER] Arguments: - `input` --- input image -- `output` --- output image, ignored if `--in-place` is present +- `output` --- output image, ignored if `--in-place` or `--info` is present - `-h`, `--help` --- display this help message and exit - `-I`, `--importer IMPORTER` --- image importer plugin (default: @ref Trade::AnyImageImporter "AnyImageImporter") @@ -93,7 +93,7 @@ Arguments: - `-v`, `--verbose` --- verbose output from importer and converter plugins Specifying `--importer raw:<format>` will treat the input as a raw -tightly-packed square of pixels in given @ref PixelFormat. Specifying +tightly-packed square of pixels in given @ref PixelFormat. Specifying `-C` / `--converter raw` will save raw imported data instead of using a converter plugin. @@ -169,8 +169,8 @@ int main(int argc, char** argv) { .setGlobalHelp(R"(Converts images of different formats. Specifying --importer raw: will treat the input as a raw tightly-packed -square of pixels in given pixel format. Specifying --converter raw will save -raw imported data instead of using a converter plugin. +square of pixels in given pixel format. Specifying -C / --converter raw will +save raw imported data instead of using a converter plugin. If --info is given, the utility will print information about all images present in the file. In this case no conversion is done and output file doesn't need to