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();
43is_tool_activated(
const ui::Registry& r, entt::id_type tool_type, entt::id_type element_type);
50is_tool_deactivated(
const ui::Registry& r, entt::id_type tool_type, entt::id_type element_type);
53template <
typename ToolTag>
54bool is_tool_active(
const ui::Registry& r)
56 return get_tools(r).get_current_tool_type() == entt::resolve<ToolTag>().id();
59template <
typename ToolTag,
typename ElementTag>
60bool is_tool_active(
const ui::Registry& r)
62 return is_tool_active<ToolTag>(r) &&
63 get_tools(r).get_current_element_type() == entt::resolve<ElementTag>().id();
66template <
typename ToolTag>
72template <
typename ToolTag,
typename ElementTag>
75 const auto idt = entt::resolve<ToolTag>().id();
76 const auto ide = entt::resolve<ElementTag>().id();
80template <
typename ToolTag>
86template <
typename ToolTag,
typename ElementTag>
89 const auto idt = entt::resolve<ToolTag>().id();
90 const auto ide = entt::resolve<ElementTag>().id();
Lagrange UI Viewer and mini 3D engine.
Definition AcceleratedPicking.h:23
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.