Lagrange
Systems.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/Entity.h>
15#include <lagrange/ui/api.h>
16
17#include <vector>
18
19namespace lagrange {
20namespace ui {
21
33class LA_UI_API Systems
34{
35public:
36 enum class Stage : int { Init = 0, Interface, Simulation, Render, Post, _SIZE };
37
41 void run(Stage stage, Registry& registry);
42
49 StringID add(Stage stage, const System& system, StringID id = 0);
50
55 bool enable(StringID id, bool value);
56
62 bool succeeds(StringID system_id, StringID after_id);
63
67 bool remove(StringID id);
68
69private:
70 struct SystemItem
71 {
72 System system;
73 Stage stage;
74 StringID id;
75 bool enabled = true;
76 };
77
78 StringID new_id();
79 StringID m_id_counter = 1;
80
81 std::vector<SystemItem> m_items;
82};
83
84
85} // namespace ui
86} // namespace lagrange
Container for Systems.
Definition: Systems.h:34
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API void remove(Registry &r, Entity e, bool recursive=false)
Removes entity.
Definition: treenode.cpp:47
Main namespace for Lagrange.
Definition: AABBIGL.h:30