File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ void exposeVisualizer() {
3030 eigenpy::OptionalConverter<ConstVectorRef, std::optional>::registration ();
3131 eigenpy::OptionalConverter<Vector3, std::optional>::registration ();
3232 eigenpy::OptionalConverter<float , std::optional>::registration ();
33+ eigenpy::OptionalConverter<bool , std::optional>::registration ();
3334 eigenpy::detail::NoneToPython<std::nullopt_t >::registration ();
3435
3536 bp::class_<Visualizer::Config>(" VisualizerConfig" , bp::no_init)
@@ -50,6 +51,10 @@ void exposeVisualizer() {
5051 .def_readonly (" renderer" , &Visualizer::renderer)
5152 .def_readwrite (" worldSceneBounds" , &Visualizer::worldSceneBounds)
5253 .def (" resetCamera" , &Visualizer::resetCamera, (" self" _a))
54+ .def (" toggleGui" , &Visualizer::toggleGui,
55+ (" self" _a, " value" _a = std::nullopt ),
56+ " Toggle the GUI on and off. Passing no value will toggle. Passing a "
57+ " value will override." )
5358 .DEF_PROP_PROXY (device)
5459 .def (
5560 " takeScreenshot" ,
Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ class Visualizer final : public BaseVisualizer {
132132
133133 void processEvents ();
134134
135+ void toggleGui (std::optional<bool > value = std::nullopt ) noexcept {
136+ m_showGui = value.value_or (!m_showGui);
137+ }
138+
135139 [[nodiscard]] bool shouldExit () const noexcept { return m_shouldExit; }
136140
137141 void takeScreenshot (std::string_view filename);
You can’t perform that action at this time.
0 commit comments