Lagrange
bounds.h
1/*
2 * Copyright 2021 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/ui/api.h>
15#include <lagrange/ui/Entity.h>
16#include <lagrange/ui/components/Bounds.h>
17#include <lagrange/ui/components/Layer.h>
18
19namespace lagrange {
20namespace ui {
21
22
25LA_UI_API AABB get_bounding_box(const Registry& registry, Entity e);
26
29LA_UI_API AABB get_bounding_box_local(const Registry& registry, Entity e);
30
33LA_UI_API AABB get_selection_bounding_box(const Registry& registry);
34
38LA_UI_API float get_nearest_bounds_distance(
39 const Registry& registry,
40 const Eigen::Vector3f& from,
41 const Layer& visible,
42 const Layer& hidden);
43
46LA_UI_API float get_furthest_bounds_distance(
47 const Registry& registry,
48 const Eigen::Vector3f& from,
49 const Layer& visible,
50 const Layer& hidden);
51
54LA_UI_API AABB get_scene_bounding_box(const Registry& registry);
55
58LA_UI_API const Bounds& get_scene_bounds(const Registry& registry);
59
61LA_UI_API Bounds& get_scene_bounds(Registry& registry);
62
63
64} // namespace ui
65} // namespace lagrange
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API float get_nearest_bounds_distance(const Registry &registry, const Eigen::Vector3f &from, const Layer &visible, const Layer &hidden)
Returns the least distance between from and any point within any bounding box.
Definition: bounds.cpp:22
LA_UI_API AABB get_bounding_box_local(const Registry &registry, Entity e)
Returns Axis Aligned Bounding Box of the entity in model space If entity does not have bounds,...
Definition: bounds.cpp:114
LA_UI_API AABB get_bounding_box(const Registry &registry, Entity e)
Returns Axis Aligned Bounding Box of the entity in world space If entity does not have bounds,...
Definition: bounds.cpp:105
LA_UI_API AABB get_scene_bounding_box(const Registry &registry)
Returns the bounding box of everything (must be set as context variable after update_scene_bounds)
Definition: bounds.cpp:79
LA_UI_API const Bounds & get_scene_bounds(const Registry &registry)
Returns the bounds of everything (must be set as context variable after update_scene_bounds)
Definition: bounds.cpp:84
LA_UI_API AABB get_selection_bounding_box(const Registry &registry)
Returns Axis Aligned Bounding Box of all entities with <Selected> component If there's no selection r...
Definition: bounds.cpp:94
LA_UI_API float get_furthest_bounds_distance(const Registry &registry, const Eigen::Vector3f &from, const Layer &visible, const Layer &hidden)
Returns the greatest distance between from and any point within any bounding box.
Definition: bounds.cpp:45
Main namespace for Lagrange.
Definition: AABBIGL.h:30