diff --git a/.github/workflows/style-checks.yml b/.github/workflows/style-checks.yml index 45257e5629..0320ad4bde 100644 --- a/.github/workflows/style-checks.yml +++ b/.github/workflows/style-checks.yml @@ -10,8 +10,9 @@ jobs: - name: C++ Formatting uses: DoozyX/clang-format-lint-action@v0.16.1 with: - source: 'library application python plugins' - extensions: 'h,cxx' + source: 'library application python plugins examples' + extensions: 'h,cxx,in' + exclude: '**/*.py.in' clangFormatVersion: 14 # Last Ubuntu LTS version (22.04) - name: Python Formatting uses: psf/black@stable diff --git a/application/F3DConfig.h.in b/application/F3DConfig.h.in index 35803c22be..fd22136008 100644 --- a/application/F3DConfig.h.in +++ b/application/F3DConfig.h.in @@ -5,11 +5,11 @@ namespace F3D { - const std::string AppName = "@PROJECT_NAME@"; - const std::string AppTitle = "@PROJECT_DESCRIPTION@"; - const std::string AppVersion = "@F3D_VERSION@"; - const std::string AppVersionFull = "@F3D_VERSION_FULL@"; - const std::string PluginsInstallDir = "@F3D_PLUGINS_INSTALL_DIR@"; +const std::string AppName = "@PROJECT_NAME@"; +const std::string AppTitle = "@PROJECT_DESCRIPTION@"; +const std::string AppVersion = "@F3D_VERSION@"; +const std::string AppVersionFull = "@F3D_VERSION_FULL@"; +const std::string PluginsInstallDir = "@F3D_PLUGINS_INSTALL_DIR@"; } // TODO: Use CMake definitions and get rid of these diff --git a/application/F3DOptionsParser.cxx b/application/F3DOptionsParser.cxx index 0bff935459..8c082e91b4 100644 --- a/application/F3DOptionsParser.cxx +++ b/application/F3DOptionsParser.cxx @@ -316,6 +316,13 @@ void ConfigurationOptions::GetOptions(F3DAppOptions& appOptions, f3d::options& o // cxxopts sense. HasDefault LocalHasDefaultNo = allOptionsInitialized ? HasDefault::YES : HasDefault::NO; + std::unordered_map libf3dOptions; + std::vector keys = options.getNames(); + for (const std::string& key : keys) + { + libf3dOptions.emplace(key, options.getAsString(key)); + } + try { cxxopts::Options cxxOptions(this->ExecutableName, F3D::AppTitle); @@ -338,70 +345,70 @@ void ConfigurationOptions::GetOptions(F3DAppOptions& appOptions, f3d::options& o auto grp1 = cxxOptions.add_options("General"); this->DeclareOption(grp1, "verbose", "", "Set verbose level, providing more information about the loaded data in the console output", appOptions.VerboseLevel, HasDefault::YES, MayHaveConfig::YES, "{debug, info, warning, error, quiet}", HasImplicitValue::YES, "debug"); - this->DeclareOption(grp1, "progress", "", "Show loading progress bar", options.getAsBoolRef("ui.loader-progress"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "animation-progress", "", "Show animation progress bar", options.getAsBoolRef("ui.animation-progress"), HasDefault::YES, MayHaveConfig::YES); + this->DeclareOption(grp1, "progress", "", "Show loading progress bar", libf3dOptions["ui.loader_progress"], HasDefault::YES, MayHaveConfig::YES, "", HasImplicitValue::YES, "1"); + this->DeclareOption(grp1, "animation-progress", "", "Show animation progress bar", libf3dOptions["ui.animation_progress"], HasDefault::YES, MayHaveConfig::YES, "", HasImplicitValue::YES, "1"); this->DeclareOption(grp1, "geometry-only", "", "Do not read materials, cameras and lights from file", appOptions.GeometryOnly, HasDefault::YES, MayHaveConfig::YES); this->DeclareOption(grp1, "group-geometries", "", "When opening multiple files, show them all in the same scene. Force geometry-only. The configuration file for the first file will be loaded.", appOptions.GroupGeometries, HasDefault::YES, MayHaveConfig::NO); - this->DeclareOption(grp1, "up", "", "Up direction", options.getAsStringRef("scene.up-direction"), HasDefault::YES, MayHaveConfig::YES, "{-X, +X, -Y, +Y, -Z, +Z}"); - this->DeclareOption(grp1, "axis", "x", "Show axes", options.getAsBoolRef("interactor.axis"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "grid", "g", "Show grid", options.getAsBoolRef("render.grid.enable"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "grid-absolute", "", "Position grid at the absolute origin instead of below the model", options.getAsBoolRef("render.grid.absolute"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "grid-unit", "", "Size of grid unit square, set to a non-positive value for automatic computation", options.getAsDoubleRef("render.grid.unit"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "grid-subdivisions", "", "Number of grid subdivisions", options.getAsIntRef("render.grid.subdivisions"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "grid-color", "", "Color of main grid lines", options.getAsDoubleVectorRef("render.grid.color"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "edges", "e", "Show cell edges", options.getAsBoolRef("render.show-edges"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "camera-index", "", "Select the camera to use", options.getAsIntRef("scene.camera.index"), HasDefault::YES, MayHaveConfig::YES, ""); - this->DeclareOption(grp1, "trackball", "k", "Enable trackball interaction", options.getAsBoolRef("interactor.trackball"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "invert-zoom", "", "Invert zoom direction with right mouse click", options.getAsBoolRef("interactor.invert-zoom"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "animation-autoplay", "", "Automatically start animation", options.getAsBoolRef("scene.animation.autoplay"), HasDefault::YES, MayHaveConfig::YES); - this->DeclareOption(grp1, "animation-index", "", "Select animation to show", options.getAsIntRef("scene.animation.index"), HasDefault::YES, MayHaveConfig::YES, ""); - this->DeclareOption(grp1, "animation-speed-factor", "", "Set animation speed factor", options.getAsDoubleRef("scene.animation.speed-factor"), HasDefault::YES, MayHaveConfig::YES, ""); - this->DeclareOption(grp1, "animation-time", "", "Set animation time to load", options.getAsDoubleRef("scene.animation.time"), HasDefault::YES, MayHaveConfig::YES, "