Skip to content

Commit

Permalink
Rename interactor.axis into ui.axis
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal committed Dec 18, 2024
1 parent fc01708 commit da3d14e
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion application/F3DOptionsTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static inline const std::map<std::string_view, std::string_view> LibOptionsNames
{ "progress", "ui.loader_progress" },
{ "animation-progress", "ui.animation_progress" },
{ "up", "scene.up_direction" },
{ "axis", "interactor.axis" },
{ "axis", "ui.axis" },
{ "grid", "render.grid.enable" },
{ "grid-absolute", "render.grid.absolute" },
{ "grid-unit", "render.grid.unit" },
Expand Down
2 changes: 1 addition & 1 deletion application/F3DStarter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ void F3DStarter::SaveScreenshot(const std::string& filenameTemplate, bool minima
options.ui.fps = false;
options.ui.metadata = false;
options.ui.animation_progress = false;
options.interactor.axis = false;
options.ui.axis = false;
options.render.grid.enable = false;
noBackground = true;
}
Expand Down
2 changes: 1 addition & 1 deletion application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ f3d_test(NAME TestVerboseNonExistentFont DATA suzanne.ply ARGS -n --font-file=${

# Test scalar rendering without any array
f3d_test(NAME TestVerboseOptionsCLI ARGS -x --verbose=debug REGEXP "'axis' = '1' from CLI options" NO_BASELINE)
f3d_test(NAME TestVerboseOptionsConfig ARGS --verbose=debug CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json REGEXP "'interactor.axis' = 'true'" NO_BASELINE)
f3d_test(NAME TestVerboseOptionsConfig ARGS --verbose=debug CONFIG ${F3D_SOURCE_DIR}/testing/configs/complex.json REGEXP "'ui.axis' = 'true'" NO_BASELINE)

# Test quiet with a non existent file
f3d_test(NAME TestQuietNonExistentFile DATA nonExistentFile.vtp ARGS --verbose=quiet --no-render REGEXP_FAIL "File .*nonExistentFile.vtp does not exist")
Expand Down
3 changes: 2 additions & 1 deletion doc/libf3d/OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ scene.camera.orthographic|bool<br>optional<br>load|Set to true to force orthogra

Option|Type<br>Default<br>Trigger|Description|F3D option
:---:|:---:|:---|:---:
interactor.axis|bool<br>false<br>render|Show *axes* as a trihedron in the scene.|\-\-axis
interactor.trackball|bool<br>false<br>render|Enable trackball interaction.|\-\-trackball
interactor.invert_zoom|bool<br>false<br>render|Invert the zoom direction.|\-\-invert-zoom

## Model Options

Expand Down Expand Up @@ -97,6 +97,7 @@ render.light.intensity|double<br>1.0<br>render|Adjust the intensity of every lig

Option|Type<br>Default<br>Trigger|Description|F3D option
:---:|:---:|:---|:---:
ui.axis|bool<br>false<br>render|Show *axes* as a trihedron in the scene.|\-\-axis
ui.scalar_bar|bool<br>false<br>render|Show *scalar bar* of the coloring by data array.|\-\-bar
ui.cheatsheet|bool<br>false<br>render|Show a interactor cheatsheet
ui.console|bool<br>false<br>render|Show the console
Expand Down
2 changes: 1 addition & 1 deletion doc/user/CONFIGURATION_FILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ A typical config file with bindings may look like this:
"Any+3": "roll_camera 90",
"Shift+O": "toggle model.point_sprites.enable",
"Ctrl+O": ["toggle render.grid.enable", "toggle scene.camera.orthographic"],
"None+I": "toggle interactor.axis"
"None+I": "toggle ui.axis"
}
}
]
Expand Down
8 changes: 4 additions & 4 deletions library/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
}
},
"ui": {
"axis": {
"type": "bool",
"default_value": "false"
},
"scalar_bar": {
"type": "bool",
"default_value": "false"
Expand Down Expand Up @@ -275,10 +279,6 @@
}
},
"interactor": {
"axis": {
"type": "bool",
"default_value": "false"
},
"trackball": {
"type": "bool",
"default_value": "false"
Expand Down
2 changes: 1 addition & 1 deletion library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ interactor& interactor_impl::initBindings()
this->addBinding({mod_t::NONE, "A"}, "toggle render.effect.anti_aliasing","Scene", std::bind(docTgl, "Toggle anti-aliasing", std::cref(opts.render.effect.anti_aliasing)));
this->addBinding({mod_t::NONE, "T"}, "toggle render.effect.tone_mapping","Scene", std::bind(docTgl, "Toggle tone mapping", std::cref(opts.render.effect.tone_mapping)));
this->addBinding({mod_t::NONE, "E"}, "toggle render.show_edges","Scene", std::bind(docTglOpt, "Toggle edges display", std::cref(opts.render.show_edges)));
this->addBinding({mod_t::NONE, "X"}, "toggle interactor.axis","Scene", std::bind(docTgl, "Toggle axes display", std::cref(opts.interactor.axis)));
this->addBinding({mod_t::NONE, "X"}, "toggle ui.axis","Scene", std::bind(docTgl, "Toggle axes display", std::cref(opts.ui.axis)));
this->addBinding({mod_t::NONE, "G"}, "toggle render.grid.enable","Scene", std::bind(docTgl, "Toggle grid display", std::cref(opts.render.grid.enable)));
#if F3D_MODULE_UI
this->addBinding({mod_t::NONE, "N"}, "toggle ui.filename","Scene", std::bind(docTgl, "Toggle filename display", std::cref(opts.ui.filename)));
Expand Down
2 changes: 1 addition & 1 deletion library/src/window_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void window_impl::UpdateDynamicOptions()
renderer->UpdateLights();

const options& opt = this->Internals->Options;
renderer->ShowAxis(opt.interactor.axis);
renderer->ShowAxis(opt.ui.axis);
renderer->SetUseTrackball(opt.interactor.trackball);
renderer->SetInvertZoom(opt.interactor.invert_zoom);

Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKInteractorCallBack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int TestSDKInteractorCallBack(int argc, char* argv[])
inter.removeBinding({ mod_t::NONE, "Z" });

// Check that an binding can be added
inter.addBinding({ mod_t::NONE, "S" }, "toggle interactor.axis");
inter.addBinding({ mod_t::NONE, "S" }, "toggle ui.axis");

// Check CTRL modifier and that another interaction can be added on the same key with another
// modifier
Expand Down
30 changes: 15 additions & 15 deletions python/testing/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_closest_option():

def test_setitem():
options = f3d.Options()
options["interactor.axis"] = False
options["ui.axis"] = False
options["render.background.blur.coc"] = 33.33
options["scene.animation.speed_factor"] = 3.3
options["render.raytracing.samples"] = 5
Expand All @@ -23,7 +23,7 @@ def test_getitem():
engine = f3d.Engine.create_none()
options = engine.options

assert options["interactor.axis"] is False
assert options["ui.axis"] is False
assert options["render.background.blur.coc"] == 20.0
assert options["scene.animation.speed_factor"] == 1.0
assert options["render.raytracing.samples"] == 5
Expand All @@ -46,7 +46,7 @@ def test_set_non_existent_key():
def test_set_incompatible_key():
options = f3d.Options()
with pytest.raises(AttributeError):
options["interactor.axis"] = "world"
options["ui.axis"] = "world"


def test_len():
Expand All @@ -67,7 +67,7 @@ def test_contains():

def test_set_options():
options = f3d.Options()
options["interactor.axis"] = True
options["ui.axis"] = True
options["model.material.roughness"] = 0.7
options["scene.animation.speed_factor"] = 3.7
options["render.raytracing.samples"] = 2
Expand All @@ -76,7 +76,7 @@ def test_set_options():

engine = f3d.Engine.create_none()
engine.options = options
assert engine.options["interactor.axis"] is True
assert engine.options["ui.axis"] is True
assert engine.options["model.material.roughness"] == 0.7
assert engine.options["scene.animation.speed_factor"] == 3.7
assert engine.options["render.raytracing.samples"] == 2
Expand All @@ -98,7 +98,7 @@ def test_update_from_dict():
options = f3d.Options()

d = {
"interactor.axis": True,
"ui.axis": True,
"model.material.roughness": 0.8,
"scene.animation.speed_factor": 3.8,
"render.raytracing.samples": 8,
Expand All @@ -114,7 +114,7 @@ def test_update_from_kv_pairs():
options = f3d.Options()

d = {
"interactor.axis": True,
"ui.axis": True,
"model.material.roughness": 0.8,
"scene.animation.speed_factor": 3.8,
"render.raytracing.samples": 8,
Expand All @@ -129,16 +129,16 @@ def test_update_from_kv_pairs():
def test_is_same():
options1 = f3d.Options()
options2 = f3d.Options()
options1["interactor.axis"] = True
options2["interactor.axis"] = False
assert not options2.is_same(options1, "interactor.axis")
options1["ui.axis"] = True
options2["ui.axis"] = False
assert not options2.is_same(options1, "ui.axis")


def test_is_copy():
options1 = f3d.Options()
options2 = f3d.Options()
options1["interactor.axis"] = True
options2["interactor.axis"] = False
assert not options2.is_same(options1, "interactor.axis")
options2.copy(options1, "interactor.axis")
assert options2.is_same(options1, "interactor.axis")
options1["ui.axis"] = True
options2["ui.axis"] = False
assert not options2.is_same(options1, "ui.axis")
options2.copy(options1, "ui.axis")
assert options2.is_same(options1, "ui.axis")
2 changes: 1 addition & 1 deletion testing/configs/bindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"Any+3": "roll_camera 90",
"Shift+O": "toggle model.point_sprites.enable",
"Ctrl+O": ["toggle render.grid.enable", "toggle scene.camera.orthographic"],
"None+I": "toggle interactor.axis"
"None+I": "toggle ui.axis"
}
}
]
2 changes: 1 addition & 1 deletion testing/configs/complex.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"options":
{
"scalar-coloring": true,
"interactor.axis": true,
"ui.axis": true,
"grid": true
}
},
Expand Down
4 changes: 2 additions & 2 deletions webassembly/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h1 class="title">F3D Web</h1>
options.toggle('render.hdri.ambient');

// display widgets
options.toggle('interactor.axis');
options.toggle('ui.axis');
options.toggle('render.grid.enable');

// default to +Z
Expand Down Expand Up @@ -163,7 +163,7 @@ <h1 class="title">F3D Web</h1>
};

mapToggleIdToOption('grid', 'render.grid.enable');
mapToggleIdToOption('axis', 'interactor.axis');
mapToggleIdToOption('axis', 'ui.axis');
mapToggleIdToOption('fxaa', 'render.effect.anti_aliasing');
mapToggleIdToOption('tone', 'render.effect.tone_mapping');
mapToggleIdToOption('ssao', 'render.effect.ambient_occlusion');
Expand Down

0 comments on commit da3d14e

Please sign in to comment.