14#include <lagrange/ui/api.h>
15#include <lagrange/ui/Entity.h>
16#include <lagrange/ui/components/TreeNode.h>
24LA_UI_API Entity create_scene_node(
26 const std::string& name =
"Unnamed Scene Node Entity",
27 Entity parent = NullEntity);
34LA_UI_API
void remove(Registry& r, Entity e,
bool recursive =
false);
40LA_UI_API
void set_parent(Registry& registry, Entity child, Entity new_parent);
47LA_UI_API Entity
get_parent(
const Registry& registry, Entity e);
54LA_UI_API std::vector<Entity>
get_children(
const Registry& registry, Entity e);
59LA_UI_API
bool is_orphan(
const Registry& registry, Entity child);
64LA_UI_API
void orphan(Registry& registry, Entity child);
71 const Registry& registry,
73 const std::function<
void(Entity)>& fn);
80 const Registry& registry,
82 const std::function<
void(Entity)>& fn);
87 const std::function<
bool(Entity)>& on_enter,
88 const std::function<
void(Entity,
bool)>& on_exit);
90LA_UI_API Entity group(
92 const std::vector<Entity>& entities,
93 const std::string& name =
"NewGroup");
95LA_UI_API Entity group_under(Registry& registry,
const std::vector<Entity>& entities, Entity parent);
99LA_UI_API Entity
ungroup(Registry& registry, Entity parent,
bool remove_parent =
false);
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API void iterate_inorder(Registry ®istry, const std::function< bool(Entity)> &on_enter, const std::function< void(Entity, bool)> &on_exit)
Alternative to foreach_child_recursive.
Definition: treenode.cpp:209
LA_UI_API void set_parent(Registry ®istry, Entity child, Entity new_parent)
Sets new_parent as as child's new parent.
Definition: treenode.cpp:155
LA_UI_API void orphan(Registry ®istry, Entity child)
Reparents child to be top-level (i.e., to have to parents).
Definition: treenode.cpp:119
LA_UI_API std::vector< Entity > get_children(const Registry ®istry, Entity e)
Returns all children of e.
Definition: treenode.cpp:243
LA_UI_API void foreach_child_recursive(const Registry ®istry, const Entity parent, const std::function< void(Entity)> &fn)
Calls fn(Entity) on each child of parent entity recursively.
Definition: treenode.cpp:85
LA_UI_API Entity ungroup(Registry ®istry, Entity parent, bool remove_parent=false)
Returns new parent.
Definition: treenode.cpp:251
LA_UI_API void orphan_without_subtree(Registry ®istry, Entity e)
Removes the node from tree and puts it as top-level node.
Definition: treenode.cpp:267
LA_UI_API void remove(Registry &r, Entity e, bool recursive=false)
Removes entity.
Definition: treenode.cpp:47
LA_UI_API void foreach_child(const Registry ®istry, const Entity parent, const std::function< void(Entity)> &fn)
Calls fn(Entity) on each direct child of parent entity.
Definition: treenode.cpp:61
LA_UI_API bool is_orphan(const Registry ®istry, Entity child)
Returns true if child has no parents (is at top-level in the hierarachy)
Definition: treenode.cpp:114
LA_UI_API Entity get_parent(const Registry ®istry, Entity e)
Returns parent of e.
Definition: treenode.cpp:237
Main namespace for Lagrange.
Definition: AABBIGL.h:30