走偏的一版
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "Gallery_Protocol.h"
|
||||
#include "Gallery_Actions.h"
|
||||
#include "Gallery_Enum.h"
|
||||
#include "Gallery_Observer_Adminive.h"
|
||||
#include "Gallery_Renderables.h"
|
||||
@@ -52,9 +53,9 @@ const std::vector<Case_Model>& cases() {
|
||||
{"selection_overlay", "框选叠层", "Selection_Rectangle_Overlay", "交互控件",
|
||||
"鼠标框选、多区域保留、标注样式和清空。", 70},
|
||||
{"constellation", "星座图", "Constellation_Diagram", "点图控件",
|
||||
"PSK4/PSK8/PSK16 模式、相位、寿命、坐标范围和方形拟合。", 80}
|
||||
,{"point_3d", "Datoviz 3D 点组件", "Point Visual", "3D",
|
||||
"Kernel 状态双缓冲、实时批量点数据、单线程 Datoviz 渲染与 RGBA 回读。", 90}
|
||||
"PSK4/PSK8/PSK16 模式、相位、寿命、坐标范围和方形拟合。", 80},
|
||||
{"datoviz_3d", "Datoviz 3D", "Mesh / Texture / MSDF Text", "3D",
|
||||
"Render3D 通过 Kernel 帧策略驱动迁移后的 Datoviz Vulkan 后端;3D 的已发布帧禁止自动覆盖。", 90}
|
||||
};
|
||||
return value;
|
||||
}
|
||||
@@ -81,7 +82,9 @@ void append_session_actions(Gallery_Frame_Mode frame_mode,
|
||||
}
|
||||
throw std::invalid_argument("unknown gallery frame mode");
|
||||
}
|
||||
std::size_t session_control_count(Gallery_Frame_Mode frame_mode) {
|
||||
std::size_t session_control_count(std::string_view case_id, Gallery_Frame_Mode frame_mode) {
|
||||
if (case_id == "datoviz_3d")
|
||||
return 0;
|
||||
switch (frame_mode) {
|
||||
case Gallery_Frame_Mode::Manual:
|
||||
return gallery_control_count<Gallery_Session_Control<Manual_Scene2D>>();
|
||||
@@ -92,40 +95,39 @@ std::size_t session_control_count(Gallery_Frame_Mode frame_mode) {
|
||||
}
|
||||
throw std::invalid_argument("unknown gallery frame mode");
|
||||
}
|
||||
std::vector<Action_Model> registered_actions(std::string_view case_id,
|
||||
Gallery_Frame_Mode frame_mode) {
|
||||
void append_3d_actions(Gallery_Frame_Mode frame_mode, std::vector<Action_Model>& result) {
|
||||
const auto append = [&result](const Gallery_Action_Attribute& action) {
|
||||
result.push_back(gallery_action_model(action));
|
||||
};
|
||||
switch (frame_mode) {
|
||||
case Gallery_Frame_Mode::Manual:
|
||||
append(gallery_action("mode_prepare", "准备 3D 帧", "Manual_Scene3D::prepare_frame", "3D 帧策略"));
|
||||
append(gallery_action("mode_refresh", "提交手动刷新", "Manual_Scene3D::refresh", "3D 帧策略"));
|
||||
append(gallery_action("mode_render", "渲染已刷新帧", "Manual_Scene3D::render_frame", "3D 帧策略", {}, {}, {}, 0.0, true));
|
||||
break;
|
||||
case Gallery_Frame_Mode::Low_Latency:
|
||||
append(gallery_action("mode_prepare", "发布 3D 帧", "Scene3D::prepare_frame", "3D 帧策略"));
|
||||
append(gallery_action("mode_render", "消费 3D 帧", "Scene3D::render_frame", "3D 帧策略", {}, {}, {}, 0.0, true));
|
||||
break;
|
||||
case Gallery_Frame_Mode::Playback:
|
||||
append(gallery_action("mode_enqueue", "压入 3D 帧", "Playback_Scene3D::prepare_frame", "3D 帧策略"));
|
||||
append(gallery_action("mode_dequeue", "消费队首 3D 帧", "Playback_Scene3D::render_frame", "3D 帧策略", {}, {}, {}, 0.0, true));
|
||||
break;
|
||||
}
|
||||
append(gallery_action("move_mesh", "移动蓝色对象", "Mesh::place", "3D 场景"));
|
||||
append(gallery_action("add_mesh", "添加黄色对象", "Scene_Edit::attach", "3D 场景"));
|
||||
append(gallery_action("remove_mesh", "移除黄色对象", "Scene_Edit::detach", "3D 场景"));
|
||||
append(gallery_action("mesh_churn", "Attach/Detach 验证", "Scene_Edit::attach/detach", "3D 场景"));
|
||||
append(gallery_action("reset_camera", "重置相机", "Camera::look_at/use_perspective", "3D 相机"));
|
||||
append(gallery_action("toggle_projection", "切换投影", "Camera::use_perspective/use_orthographic", "3D 相机"));
|
||||
append(gallery_action("toggle_texture", "切换纹理", "Material::use_texture", "3D 材质"));
|
||||
append(gallery_action("change_text", "修改 MSDF 文本", "Text::set_string", "3D 文本"));
|
||||
append(gallery_action("reset", "恢复 3D 场景", "Gallery_Scene3D factory", "3D 场景"));
|
||||
}
|
||||
std::vector<Action_Model> registered_actions(std::string_view case_id, Gallery_Frame_Mode frame_mode) {
|
||||
std::vector<Action_Model> result;
|
||||
if (case_id == "point_3d") {
|
||||
const auto keep_frame_action = [frame_mode](std::string_view id) {
|
||||
switch (frame_mode) {
|
||||
case Gallery_Frame_Mode::Manual:
|
||||
return id == "mode_prepare" || id == "mode_refresh" ||
|
||||
id == "mode_render" || id == "mode_discard";
|
||||
case Gallery_Frame_Mode::Low_Latency:
|
||||
return id == "mode_prepare" || id == "mode_render" ||
|
||||
id == "mode_discard";
|
||||
case Gallery_Frame_Mode::Playback:
|
||||
return id == "mode_enqueue" || id == "mode_dequeue";
|
||||
}
|
||||
return false;
|
||||
};
|
||||
for (auto& action : gallery_frame_actions(frame_mode)) {
|
||||
if (keep_frame_action(action.id))
|
||||
result.push_back(std::move(action));
|
||||
}
|
||||
const auto add = [&result](std::string id, std::string label,
|
||||
std::string api, std::string description) {
|
||||
result.push_back({std::move(id), std::move(label), std::move(api),
|
||||
std::move(description), "Point Visual", {}, {}, 0.0,
|
||||
true});
|
||||
};
|
||||
add("orbit_points", "移动点", "Point_Visual::update_points",
|
||||
"通过 Kernel Multi_Double_Buffer_Strategy 发布一批新位置");
|
||||
add("add_point", "添加点", "Point_Visual::edit_points", "向批量点数据追加一个点");
|
||||
add("remove_point", "移除点", "Point_Visual::edit_points", "移除最后追加的点");
|
||||
add("point_churn", "点增删压力", "Point_Visual::edit_points",
|
||||
"在帧快照前连续追加并移除临时点");
|
||||
add("reset_points", "重置点", "Point_Visual::update_points", "恢复 3D 点演示数据");
|
||||
if (case_id == "datoviz_3d") {
|
||||
append_3d_actions(frame_mode, result);
|
||||
return result;
|
||||
}
|
||||
append_session_actions(frame_mode, result);
|
||||
@@ -151,7 +153,7 @@ struct Type_Descriptor<renderive::web::gallery_detail::Case_Model> {
|
||||
return object<T>("renderive_gallery_case",
|
||||
ADMINIVE_FIELD_LABEL(T, id, "标识"),
|
||||
ADMINIVE_FIELD_LABEL(T, title, "标题"),
|
||||
ADMINIVE_FIELD_LABEL(T, component, "Core2 控件"),
|
||||
ADMINIVE_FIELD_LABEL(T, component, "Renderive 组件"),
|
||||
ADMINIVE_FIELD_LABEL(T, category, "分类"),
|
||||
ADMINIVE_FIELD_LABEL(T, description, "说明"),
|
||||
ADMINIVE_FIELD_LABEL(T, order, "顺序"),
|
||||
@@ -168,7 +170,7 @@ struct Type_Descriptor<renderive::web::gallery_detail::Action_Model> {
|
||||
return object<T>("renderive_gallery_action",
|
||||
ADMINIVE_FIELD_LABEL(T, id, "动作"),
|
||||
ADMINIVE_FIELD_LABEL(T, label, "名称"),
|
||||
ADMINIVE_FIELD_LABEL(T, api, "Core2 API"),
|
||||
ADMINIVE_FIELD_LABEL(T, api, "Renderive API"),
|
||||
ADMINIVE_FIELD_LABEL(T, description, "说明"),
|
||||
ADMINIVE_FIELD_LABEL(T, group, "分组"),
|
||||
ADMINIVE_FIELD_LABEL(T, argument_input, "参数类型"),
|
||||
@@ -188,7 +190,7 @@ adminive::Table_View action_view() {
|
||||
return adminive::table_view<T>(
|
||||
adminive::column<&T::label>("动作"),
|
||||
adminive::column<&T::group>("分组"),
|
||||
adminive::column<&T::api>("Core2 API"))
|
||||
adminive::column<&T::api>("Renderive API"))
|
||||
.titled("保留 API 动作");
|
||||
}
|
||||
|
||||
@@ -552,12 +554,11 @@ std::string Gallery_Protocol::catalog_json() {
|
||||
Json entry = adminive::to_frontend_json<Json>(item);
|
||||
entry["control_count_by_mode"] = Json::object();
|
||||
entry["action_count_by_mode"] = Json::object();
|
||||
const std::size_t renderable_controls = gallery_renderable_control_count(item.id);
|
||||
const std::size_t renderable_controls = item.id == "datoviz_3d" ? 0 : gallery_renderable_control_count(item.id);
|
||||
for (const auto mode : frame_modes) {
|
||||
const std::string key = gallery_enum_id(mode);
|
||||
const std::size_t controls = item.id == "point_3d"
|
||||
? 0U
|
||||
: gallery_detail::session_control_count(mode) + renderable_controls;
|
||||
const std::size_t controls =
|
||||
gallery_detail::session_control_count(item.id, mode) + renderable_controls;
|
||||
const std::size_t actions =
|
||||
gallery_detail::registered_actions(item.id, mode).size();
|
||||
entry["control_count_by_mode"][key] = controls;
|
||||
@@ -565,10 +566,9 @@ std::string Gallery_Protocol::catalog_json() {
|
||||
controls_total += controls;
|
||||
actions_total += actions;
|
||||
}
|
||||
entry["control_count"] = item.id == "point_3d"
|
||||
? 0U
|
||||
: gallery_detail::session_control_count(Gallery_Frame_Mode::Low_Latency) +
|
||||
renderable_controls;
|
||||
entry["control_count"] =
|
||||
gallery_detail::session_control_count(item.id, Gallery_Frame_Mode::Low_Latency) +
|
||||
renderable_controls;
|
||||
entry["action_count"] =
|
||||
gallery_detail::registered_actions(
|
||||
item.id, Gallery_Frame_Mode::Low_Latency).size();
|
||||
|
||||
Reference in New Issue
Block a user