28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
#pragma once
|
|
#include "Gallery_Plots_2D.hpp"
|
|
#include "Gallery_Plots_3D.hpp"
|
|
#include <optional>
|
|
#include <ownership.hpp>
|
|
#include <span>
|
|
#include <string_view>
|
|
|
|
namespace aethera::web {
|
|
enum struct Plot_Dimension : std::uint8_t { two_d, three_d };
|
|
|
|
struct Plot_Definition {
|
|
std::string_view id; /* 协议和路由使用的稳定标识。 */
|
|
std::string_view title; /* 前端直接展示的业务名称。 */
|
|
std::string_view category; /* Catalog 分组名称。 */
|
|
std::string_view description; /* Plot 能力说明。 */
|
|
Plot_Dimension dimension{Plot_Dimension::two_d}; /* 渲染后端维度。 */
|
|
std::shared_ptr<Plot> (*create)(); /* 创建该 Plot 唯一实例的工厂。 */
|
|
};
|
|
|
|
[[nodiscard]] std::span<const Plot_Definition>
|
|
gallery_plot_definitions() noexcept;
|
|
[[nodiscard]] std::optional<not_null<const Plot_Definition*>>
|
|
find_gallery_plot_definition(std::string_view id) noexcept;
|
|
[[nodiscard]] std::string_view plot_dimension_name(
|
|
Plot_Dimension dimension) noexcept;
|
|
}
|