Lagrange
layer.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/Layer.h>
17#include <string>
18
19namespace lagrange {
20namespace ui {
21
22// TODO move to default_layers or one setup_defaults file
24{
25 constexpr static const LayerIndex Default = 0;
26 constexpr static const LayerIndex Selection = 255 - 1;
27 constexpr static const LayerIndex Hover = 255 - 2;
28 constexpr static const LayerIndex NoShadow = 255 - 3;
29};
30
31
32LA_UI_API void add_to_layer(Registry& registry, Entity e, LayerIndex index);
33
34LA_UI_API void remove_from_layer(Registry& registry, Entity e, LayerIndex index);
35
36LA_UI_API bool is_in_layer(Registry& registry, Entity e, LayerIndex index);
37
38LA_UI_API bool is_in_any_layers(Registry& registry, Entity e, Layer layers_bitset);
39
40LA_UI_API bool is_visible_in(
41 const Registry& registry,
42 Entity e,
43 const Layer& visible_layers,
44 const Layer& hidden_layers);
45
46LA_UI_API LayerIndex get_next_available_layer_index(Registry& r);
47
48LA_UI_API LayerIndex register_layer_name(Registry& registry, const std::string& name, LayerIndex index);
49LA_UI_API LayerIndex register_layer_name(Registry& registry, const std::string& name);
50
51
52LA_UI_API const std::string& get_layer_name(Registry& registry, LayerIndex index);
53
54LA_UI_API void register_default_layer_names(Registry& registry);
55
56
57} // namespace ui
58} // namespace lagrange
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Definition: layer.h:24
Definition: Layer.h:29