删除realtime 的一个组件
This commit is contained in:
@@ -1492,21 +1492,26 @@ public:
|
||||
publish_demo_points();
|
||||
last_action_result_ = "points_orbited";
|
||||
rendered_since_last_pixel_ = false;
|
||||
return "Point positions updated through Latest_Real_Time_Data";
|
||||
return "Point positions updated through Point_Visual double buffering";
|
||||
}
|
||||
if (request.id == "add_point") {
|
||||
auto points = current_points();
|
||||
points.push_back({{0.12F, -0.72F, 0.58F}, {55, 235, 230, 255}, 46.0F});
|
||||
demo_.points->update(std::move(points));
|
||||
demo_.visual->edit_points([](auto& points) {
|
||||
points.push_back(
|
||||
{{0.12F, -0.72F, 0.58F}, {55, 235, 230, 255}, 46.0F});
|
||||
});
|
||||
last_action_result_ = "point_added";
|
||||
rendered_since_last_pixel_ = false;
|
||||
return "Point added to the bulk payload";
|
||||
}
|
||||
if (request.id == "remove_point") {
|
||||
auto points = current_points();
|
||||
if (points.size() > render_3d::point_demo_data().size()) {
|
||||
points.pop_back();
|
||||
demo_.points->update(std::move(points));
|
||||
bool removed{};
|
||||
demo_.visual->edit_points([&](auto& points) {
|
||||
if (points.size() > render_3d::point_demo_data().size()) {
|
||||
points.pop_back();
|
||||
removed = true;
|
||||
}
|
||||
});
|
||||
if (removed) {
|
||||
last_action_result_ = "point_removed";
|
||||
rendered_since_last_pixel_ = false;
|
||||
return "Last added Point removed";
|
||||
@@ -1515,11 +1520,11 @@ public:
|
||||
return "No added Point to remove";
|
||||
}
|
||||
if (request.id == "point_churn") {
|
||||
auto stable = current_points();
|
||||
auto transient = stable;
|
||||
transient.push_back({{0.0F, 0.0F, 0.8F}, {255, 255, 255, 255}, 72.0F});
|
||||
demo_.points->update(std::move(transient));
|
||||
demo_.points->update(std::move(stable));
|
||||
demo_.visual->edit_points([](auto& points) {
|
||||
points.push_back(
|
||||
{{0.0F, 0.0F, 0.8F}, {255, 255, 255, 255}, 72.0F});
|
||||
points.pop_back();
|
||||
});
|
||||
last_action_result_ = "point_churned";
|
||||
rendered_since_last_pixel_ = false;
|
||||
return "Transient Point added and removed before the next frame snapshot";
|
||||
@@ -1541,7 +1546,7 @@ public:
|
||||
[[nodiscard]] std::string telemetry_json() const override {
|
||||
const auto status = demo_.scene->frame_status();
|
||||
const auto frame = demo_.scene->latest_frame();
|
||||
const auto points = current_points();
|
||||
const auto point_count = demo_.visual->point_count();
|
||||
const auto render_window = render_duration_statistics_.snapshot();
|
||||
const auto encode_window = pixel_encode_statistics_.snapshot();
|
||||
const auto request_window = pixel_request_statistics_.snapshot();
|
||||
@@ -1607,20 +1612,17 @@ public:
|
||||
{"renderable_observers", nlohmann::json::array()},
|
||||
{"performance_capture", nullptr},
|
||||
{"last_action_result", last_action_result_},
|
||||
{"point_3d", {{"point_count", points.size()},
|
||||
{"data_revision", demo_.points->revision()}}},
|
||||
{"data_shape", {{"input_elements", points.size()},
|
||||
{"rendered_elements", points.size()}}}}
|
||||
{"point_3d", {{"point_count", point_count},
|
||||
{"data_revision", demo_.visual->data_revision()}}},
|
||||
{"data_shape", {{"input_elements", point_count},
|
||||
{"rendered_elements", point_count}}}}
|
||||
;
|
||||
return telemetry.dump();
|
||||
}
|
||||
|
||||
private:
|
||||
[[nodiscard]] std::vector<render_3d::Point> current_points() const {
|
||||
return demo_.points->snapshot().value_or(std::vector<render_3d::Point>{});
|
||||
}
|
||||
void publish_demo_points() {
|
||||
demo_.points->update(render_3d::point_demo_data(phase_));
|
||||
demo_.visual->update_points(render_3d::point_demo_data(phase_));
|
||||
}
|
||||
template <class Render>
|
||||
bool record_render(Render&& render) {
|
||||
|
||||
Reference in New Issue
Block a user