14#include <lagrange/ui/api.h>
15#include <lagrange/ui/types/Tools.h>
22LA_UI_API Tools& get_tools(ui::Registry& r);
23LA_UI_API
const Tools& get_tools(
const ui::Registry& r);
27bool is_element_type(entt::id_type elem_type)
29 return elem_type == entt::resolve<T>().id();
42LA_UI_API
bool is_tool_activated(
const ui::Registry& r, entt::id_type tool_type, entt::id_type element_type);
49 const ui::Registry& r,
50 entt::id_type tool_type,
51 entt::id_type element_type);
54template <
typename ToolTag>
55bool is_tool_active(
const ui::Registry& r)
57 return get_tools(r).get_current_tool_type() == entt::resolve<ToolTag>().id();
60template <
typename ToolTag,
typename ElementTag>
61bool is_tool_active(
const ui::Registry& r)
63 return is_tool_active<ToolTag>(r) &&
64 get_tools(r).get_current_element_type() == entt::resolve<ElementTag>().id();
67template <
typename ToolTag>
73template <
typename ToolTag,
typename ElementTag>
76 const auto idt = entt::resolve<ToolTag>().id();
77 const auto ide = entt::resolve<ElementTag>().id();
81template <
typename ToolTag>
87template <
typename ToolTag,
typename ElementTag>
90 const auto idt = entt::resolve<ToolTag>().id();
91 const auto ide = entt::resolve<ElementTag>().id();
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API bool is_tool_activated(const ui::Registry &r, entt::id_type tool_type)
Was tool type activated this frame.
Definition: tools_utils.cpp:54
LA_UI_API Tools & initialize_tools(ui::Registry &r)
Initialize Tools context variable.
Definition: tools_utils.cpp:25
LA_UI_API void run_current_tool(ui::Registry &r)
Run currently selected tool.
Definition: tools_utils.cpp:40
LA_UI_API bool is_tool_deactivated(const ui::Registry &r, entt::id_type tool_type)
Was tool type deactivated this frame.
Definition: tools_utils.cpp:69
LA_UI_API void update_previous_tool(ui::Registry &r)
Update previously used tool - must be called for is_tool_(de)activate to work.
Definition: tools_utils.cpp:46
Main namespace for Lagrange.
Definition: AABBIGL.h:30