删除impl
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
namespace aethera::web {
|
||||
namespace {
|
||||
using namespace render_2d;
|
||||
using Scene_2D = Impl<Render_Scene_2D>;
|
||||
using Frequency_Axis_Object = Impl<Frequency_Axis>;
|
||||
using Numeric_Axis_Object = Impl<Numeric_Axis>;
|
||||
using Time_Axis_Object = Impl<Time_Axis>;
|
||||
using Selection_Object = Impl<Selection_Rectangle_Overlay>;
|
||||
using Scene_2D = Render_Scene_2D;
|
||||
using Frequency_Axis_Object = Frequency_Axis;
|
||||
using Numeric_Axis_Object = Numeric_Axis;
|
||||
using Time_Axis_Object = Time_Axis;
|
||||
using Selection_Object = Selection_Rectangle_Overlay;
|
||||
template <typename... Owned_Objects>
|
||||
struct Scene_View_Model final : public Plot::Scene_View {
|
||||
public:
|
||||
@@ -475,7 +475,7 @@ std::unique_ptr<Plot::Scene_View> make_scene_view(
|
||||
std::forward<Owned_Objects>(owned_objects)...);
|
||||
}
|
||||
std::unique_ptr<Frequency_Axis_Object> make_frequency_axis() {
|
||||
auto result = Frequency_Axis_Object::Builder{}
|
||||
auto result = Frequency_Axis_Object::Builder<Frequency_Axis_Object>{}
|
||||
.set(&Abs_Axis::Prop::orientation, Axis_Orientation::horizontal)
|
||||
.set(&Abs_Axis::Prop::position, Point_F{64.0, 370.0})
|
||||
.set(&Abs_Axis::Prop::pixel_length, 620.0)
|
||||
@@ -487,7 +487,7 @@ std::unique_ptr<Frequency_Axis_Object> make_frequency_axis() {
|
||||
std::unique_ptr<Numeric_Axis_Object> make_numeric_axis(
|
||||
Axis_Orientation orientation, Point_F position, Axis_Pixel_Length length,
|
||||
Axis_Range range) {
|
||||
auto result = Numeric_Axis_Object::Builder{}
|
||||
auto result = Numeric_Axis_Object::Builder<Numeric_Axis_Object>{}
|
||||
.set(&Abs_Axis::Prop::orientation, orientation)
|
||||
.set(&Abs_Axis::Prop::position, position)
|
||||
.set(&Abs_Axis::Prop::pixel_length, length)
|
||||
@@ -498,7 +498,7 @@ std::unique_ptr<Numeric_Axis_Object> make_numeric_axis(
|
||||
}
|
||||
std::unique_ptr<Time_Axis_Object> make_time_axis(
|
||||
Axis_Orientation orientation, Point_F position, Axis_Pixel_Length length) {
|
||||
auto result = Time_Axis_Object::Builder{}
|
||||
auto result = Time_Axis_Object::Builder<Time_Axis_Object>{}
|
||||
.set(&Abs_Axis::Prop::orientation, orientation)
|
||||
.set(&Abs_Axis::Prop::position, position)
|
||||
.set(&Abs_Axis::Prop::pixel_length, length)
|
||||
@@ -508,7 +508,7 @@ std::unique_ptr<Time_Axis_Object> make_time_axis(
|
||||
}
|
||||
template <Axis_Object Horizontal_Axis, Axis_Object Vertical_Axis>
|
||||
std::unique_ptr<Selection_Object> selection_overlay(Horizontal_Axis* horizontal_axis, Vertical_Axis* vertical_axis) {
|
||||
auto result = Selection_Object::Builder(horizontal_axis, vertical_axis).build();
|
||||
auto result = Selection_Object::Builder<Selection_Object>(horizontal_axis, vertical_axis).build();
|
||||
if (!result) throw std::logic_error("selection overlay axes form an invalid dependency graph");
|
||||
return std::move(result).value();
|
||||
}
|
||||
@@ -540,7 +540,7 @@ std::shared_ptr<Plot> make_axes_plot() {
|
||||
auto time = make_time_axis(
|
||||
Axis_Orientation::horizontal, {64.0, 190.0}, 620.0);
|
||||
time->template set<&Abs_Axis::Prop::unit_text>("Time");
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -606,12 +606,12 @@ std::shared_ptr<Plot> make_spectrum_plot() {
|
||||
constexpr Size canvas{720, 420};
|
||||
auto frequency = make_frequency_axis();
|
||||
auto vertical = make_numeric_axis(Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {-110.0, 0.0});
|
||||
auto spectrum = *Impl<Spectrum>::Builder(frequency.get(), vertical.get(), 4u)
|
||||
auto spectrum = *Spectrum::Builder<Spectrum>(frequency.get(), vertical.get(), 4u)
|
||||
.set(&Spectrum::Prop::frequency_range, Axis_Range{0.0, 100.0})
|
||||
.set(&Spectrum::Prop::max_hold_visible, true)
|
||||
.build();
|
||||
auto selection = selection_overlay(frequency.get(), vertical.get());
|
||||
auto scene = *Scene_2D::Builder()
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>()
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -669,9 +669,9 @@ std::shared_ptr<Plot> make_frequency_trace_plot() {
|
||||
Axis_Orientation::horizontal, {64.0, 370.0}, 620.0);
|
||||
auto vertical = make_numeric_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {-1.2, 1.2});
|
||||
auto trace = *Impl<Frequency_Trace>::Builder(time.get(), vertical.get(), 4u).build();
|
||||
auto trace = *Frequency_Trace::Builder<Frequency_Trace>(time.get(), vertical.get(), 4u).build();
|
||||
auto selection = selection_overlay(time.get(), vertical.get());
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -704,13 +704,13 @@ std::shared_ptr<Plot> make_sweep_spectrum_plot() {
|
||||
auto frequency = make_frequency_axis();
|
||||
auto vertical = make_numeric_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {-110.0, 0.0});
|
||||
auto sweep = *Impl<Sweep_Spectrum>::Builder(frequency.get(), vertical.get(), 4u)
|
||||
auto sweep = *Sweep_Spectrum::Builder<Sweep_Spectrum>(frequency.get(), vertical.get(), 4u)
|
||||
.set(&Sweep_Spectrum::Prop::frequency_range, Axis_Range{0.0, 100.0})
|
||||
.set(&Sweep_Spectrum::Prop::bins_per_block, std::size_t{8})
|
||||
.set(&Sweep_Spectrum::Prop::block_count, std::size_t{64})
|
||||
.build();
|
||||
auto selection = selection_overlay(frequency.get(), vertical.get());
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -752,14 +752,14 @@ std::shared_ptr<Plot> make_afterglow_plot() {
|
||||
auto frequency = make_frequency_axis();
|
||||
auto vertical = make_numeric_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {-110.0, 0.0});
|
||||
auto afterglow = *Impl<Afterglow>::Builder(
|
||||
auto afterglow = *Afterglow::Builder<Afterglow>(
|
||||
frequency.get(), vertical.get(), Plot_Partition_Grid{4, 3})
|
||||
.set(&Afterglow::Prop::frequency_range, Axis_Range{0.0, 100.0})
|
||||
.set(&Afterglow::Prop::power_range, Axis_Range{-110.0, 0.0})
|
||||
.set(&Afterglow::Prop::power_point_size, 96)
|
||||
.build();
|
||||
auto selection = selection_overlay(frequency.get(), vertical.get());
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -796,13 +796,13 @@ std::shared_ptr<Plot> make_waterfall_plot() {
|
||||
auto frequency = make_frequency_axis();
|
||||
auto time = make_time_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0);
|
||||
auto waterfall = *Impl<Waterfall>::Builder(
|
||||
auto waterfall = *Waterfall::Builder<Waterfall>(
|
||||
frequency.get(), time.get(), Plot_Partition_Grid{4, 3})
|
||||
.set(&Waterfall::Prop::frequency_range, Axis_Range{0.0, 100.0})
|
||||
.set(&Waterfall::Prop::power_range, Axis_Range{-110.0, 0.0})
|
||||
.build();
|
||||
auto selection = selection_overlay(frequency.get(), time.get());
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -850,13 +850,13 @@ std::shared_ptr<Plot> make_constellation_plot() {
|
||||
Axis_Orientation::horizontal, {64.0, 370.0}, 620.0, {-1.2, 1.2});
|
||||
auto vertical = make_numeric_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {-1.2, 1.2});
|
||||
auto constellation = *Impl<Constellation_Diagram>::Builder(
|
||||
auto constellation = *Constellation_Diagram::Builder<Constellation_Diagram>(
|
||||
horizontal.get(), vertical.get(), 4u)
|
||||
.set(&Constellation_Diagram::Prop::i_range, Axis_Range{-1.2, 1.2})
|
||||
.set(&Constellation_Diagram::Prop::q_range, Axis_Range{-1.2, 1.2})
|
||||
.build();
|
||||
auto selection = selection_overlay(horizontal.get(), vertical.get());
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
@@ -906,8 +906,8 @@ std::shared_ptr<Plot> make_selection_overlay_plot() {
|
||||
Axis_Orientation::horizontal, {64.0, 370.0}, 620.0, {0.0, 100.0});
|
||||
auto vertical = make_numeric_axis(
|
||||
Axis_Orientation::vertical, {64.0, 370.0}, -320.0, {0.0, 100.0});
|
||||
auto selection = *Impl<Selection_Rectangle_Overlay>::Builder(horizontal.get(), vertical.get()).build();
|
||||
auto scene = *Scene_2D::Builder{}
|
||||
auto selection = *Selection_Rectangle_Overlay::Builder<Selection_Rectangle_Overlay>(horizontal.get(), vertical.get()).build();
|
||||
auto scene = *Scene_2D::Builder<Scene_2D>{}
|
||||
.set(&Render_Scene_2D::Prop::viewport, canvas)
|
||||
.set(&Render_Scene_2D::Prop::background, Color{7, 13, 24, 255})
|
||||
.set(&Render_Scene_2D::Prop::view_active, true)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
namespace aethera::web {
|
||||
namespace {
|
||||
using namespace render_3d;
|
||||
using Scene_3D = Impl<Render_Scene_3D>;
|
||||
using Scene_3D = Render_Scene_3D;
|
||||
using Json = nlohmann::json;
|
||||
Json number_field(std::string key, std::string label, std::string description,
|
||||
double value, double minimum, double maximum, double step) {
|
||||
@@ -211,9 +211,9 @@ struct Random_Data_Generator {};
|
||||
template <typename Visual_Object, typename Data_Generator = Random_Data_Generator>
|
||||
struct Visual_Scene_View final : public Plot::Scene_View {
|
||||
public:
|
||||
using Camera_Object = Impl<Camera_3D>;
|
||||
using Axes_Object = Impl<Axes_3D>;
|
||||
using Marker_Object = Impl<Marker_Visual>;
|
||||
using Camera_Object = Camera_3D;
|
||||
using Axes_Object = Axes_3D;
|
||||
using Marker_Object = Marker_Visual;
|
||||
Visual_Scene_View(Scene_3D& scene, std::unique_ptr<Camera_Object> camera,
|
||||
std::unique_ptr<Axes_Object> axes,
|
||||
std::unique_ptr<Visual_Object> visual, std::string label,
|
||||
@@ -388,13 +388,13 @@ std::shared_ptr<Plot> make_visual_plot(std::string label,
|
||||
Build_Result build_result,
|
||||
Scene_Components_3D components = {},
|
||||
Data_Generator data_generator = {},
|
||||
std::unique_ptr<Impl<Marker_Visual>> markers = {}) {
|
||||
using Visual_Object = Impl<Definition>;
|
||||
using Camera_Object = Impl<Camera_3D>;
|
||||
using Axes_Object = Impl<Axes_3D>;
|
||||
std::unique_ptr<Marker_Visual> markers = {}) {
|
||||
using Visual_Object = Definition;
|
||||
using Camera_Object = Camera_3D;
|
||||
using Axes_Object = Axes_3D;
|
||||
if (!build_result) throw std::logic_error("3D Gallery visual dependency graph is invalid");
|
||||
auto visual = std::move(build_result).value();
|
||||
auto camera_result = Camera_Object::Builder{}
|
||||
auto camera_result = Camera_Object::Builder<Camera_Object>{}
|
||||
.set(&Camera_3D::Prop::initial_view, components.camera.initial_view)
|
||||
.set(&Camera_3D::Prop::projection, components.camera.projection)
|
||||
.set(&Camera_3D::Prop::controller, components.camera.controller)
|
||||
@@ -407,7 +407,7 @@ std::shared_ptr<Plot> make_visual_plot(std::string label,
|
||||
.set(&Camera_3D::Prop::near_plane, components.camera.near_plane)
|
||||
.set(&Camera_3D::Prop::far_plane, components.camera.far_plane)
|
||||
.build();
|
||||
auto axes_result = Axes_Object::Builder{}
|
||||
auto axes_result = Axes_Object::Builder<Axes_Object>{}
|
||||
.set(&Axes_3D::Prop::x_axis, components.axes[0])
|
||||
.set(&Axes_3D::Prop::y_axis, components.axes[1])
|
||||
.set(&Axes_3D::Prop::z_axis, components.axes[2])
|
||||
@@ -415,7 +415,7 @@ std::shared_ptr<Plot> make_visual_plot(std::string label,
|
||||
if (!camera_result || !axes_result) throw std::logic_error("3D Gallery component construction failed");
|
||||
auto camera = std::move(camera_result).value();
|
||||
auto axes = std::move(axes_result).value();
|
||||
auto scene_builder = Scene_3D::Builder{};
|
||||
auto scene_builder = Scene_3D::Builder<Scene_3D>{};
|
||||
scene_builder.add_camera(camera.get())
|
||||
.add_axes(axes.get())
|
||||
.add_renderable(visual.get())
|
||||
@@ -605,7 +605,7 @@ struct Spectrogram_Data_Generator {
|
||||
{"fields", std::move(fields)}
|
||||
};
|
||||
}
|
||||
[[nodiscard]] Json generate(Impl<Mesh_Visual>& visual, Impl<Axes_3D>& axes,
|
||||
[[nodiscard]] Json generate(Mesh_Visual& visual, Axes_3D& axes,
|
||||
const Json& input) {
|
||||
try {
|
||||
Spectrogram_Parameters next;
|
||||
@@ -665,8 +665,8 @@ struct Spectrogram_Data_Generator {
|
||||
return {{"success", false}, {"error", error.what()}};
|
||||
}
|
||||
}
|
||||
void update(Impl<Mesh_Visual>& visual, Impl<Axes_3D>&,
|
||||
Impl<Marker_Visual>* markers,
|
||||
void update(Mesh_Visual& visual, Axes_3D&,
|
||||
Marker_Visual* markers,
|
||||
const Plot_Render_Tick& request) {
|
||||
if (!parameters.animation_enabled ||
|
||||
request.sequence % parameters.update_every_n_frames != 0)
|
||||
@@ -687,24 +687,24 @@ struct Spectrogram_Data_Generator {
|
||||
};
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_point_plot() {
|
||||
return make_visual_plot<Point_Visual>("Point Visual", Impl<Point_Visual>::Builder{}
|
||||
return make_visual_plot<Point_Visual>("Point Visual", Point_Visual::Builder<Point_Visual>{}
|
||||
.set(&Point_Visual::Prop::items, std::vector<Point>{{{-0.65F, -0.25F, 0.05F}, color(255, 91, 110), 28.0F}, {{0.0F, 0.58F, 0.25F}, color(82, 226, 190), 34.0F}, {{0.62F, -0.12F, -0.15F}, color(75, 145, 255), 30.0F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_splat_plot() {
|
||||
return make_visual_plot<Splat_Visual>("Splat Visual", Impl<Splat_Visual>::Builder{}
|
||||
return make_visual_plot<Splat_Visual>("Splat Visual", Splat_Visual::Builder<Splat_Visual>{}
|
||||
.set(&Splat_Visual::Prop::items, std::vector<Splat>{{{-0.48F, 0.0F, 0.1F}, color(255, 98, 115, 210), {0.18F, 0.08F}, 0.45F}, {{0.28F, 0.15F, 0.0F}, color(66, 218, 188, 210), {0.12F, 0.22F}, -0.3F}, {{0.15F, -0.38F, 0.2F}, color(76, 132, 255, 210), {0.2F, 0.1F}, 0.9F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_pixel_plot() {
|
||||
std::vector<Pixel> pixels;
|
||||
for (int y = -8; y <= 8; ++y) for (int x = -12; x <= 12; ++x) pixels.push_back({{x / 13.0F, y / 9.0F, 0.12F * std::sin(x * .45F) * std::cos(y * .35F)}, color(static_cast<std::uint8_t>(90 + 6 * (x + 12)), static_cast<std::uint8_t>(100 + 8 * (y + 8)), 230), 5.0F});
|
||||
return make_visual_plot<Pixel_Visual>("Pixel Visual", Impl<Pixel_Visual>::Builder{}.set(&Pixel_Visual::Prop::items, std::move(pixels)).build());
|
||||
return make_visual_plot<Pixel_Visual>("Pixel Visual", Pixel_Visual::Builder<Pixel_Visual>{}.set(&Pixel_Visual::Prop::items, std::move(pixels)).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_marker_plot() {
|
||||
return make_visual_plot<Marker_Visual>("Marker Visual", Impl<Marker_Visual>::Builder{}
|
||||
return make_visual_plot<Marker_Visual>("Marker Visual", Marker_Visual::Builder<Marker_Visual>{}
|
||||
.set(&Marker_Visual::Prop::items, std::vector<Marker>{{{-0.7F, 0.0F, 0.0F}, color(255, 93, 115), 34.0F, 0.0F, Marker_Shape::disc}, {{-0.35F, 0.25F, 0.1F}, color(91, 226, 193), 36.0F, 0.25F, Marker_Shape::square}, {{0.0F, -0.2F, 0.2F}, color(100, 158, 255), 38.0F, 0.5F, Marker_Shape::triangle}, {{0.35F, 0.25F, 0.1F}, color(250, 195, 92), 40.0F, 0.75F, Marker_Shape::diamond}, {{0.7F, 0.0F, 0.0F}, color(201, 132, 255), 42.0F, 1.0F, Marker_Shape::cross}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_sphere_plot() {
|
||||
return make_visual_plot<Sphere_Visual>("Sphere Visual", Impl<Sphere_Visual>::Builder{}
|
||||
return make_visual_plot<Sphere_Visual>("Sphere Visual", Sphere_Visual::Builder<Sphere_Visual>{}
|
||||
.set(&Sphere_Visual::Prop::items, std::vector<Sphere>{{{-0.48F, -0.2F, 0.0F}, color(255, 91, 110), 0.28F}, {{0.08F, 0.25F, 0.18F}, color(82, 226, 190), 0.36F}, {{0.55F, -0.18F, -0.12F}, color(75, 145, 255), 0.24F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_segment_plot() {
|
||||
@@ -713,24 +713,24 @@ std::shared_ptr<Plot> make_datoviz_segment_plot() {
|
||||
const float angle = static_cast<float>(index) * std::numbers::pi_v<float> / 6.0F;
|
||||
segments.push_back({{0.0F, 0.0F, 0.0F}, {0.82F * std::cos(angle), 0.82F * std::sin(angle), 0.18F * std::sin(2 * angle)}, color(static_cast<std::uint8_t>(80 + index * 13), static_cast<std::uint8_t>(220 - index * 8), 240), 4.0F});
|
||||
}
|
||||
return make_visual_plot<Segment_Visual>("Segment Visual", Impl<Segment_Visual>::Builder{}.set(&Segment_Visual::Prop::items, std::move(segments)).build());
|
||||
return make_visual_plot<Segment_Visual>("Segment Visual", Segment_Visual::Builder<Segment_Visual>{}.set(&Segment_Visual::Prop::items, std::move(segments)).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_vector_plot() {
|
||||
return make_visual_plot<Vector_Visual>("Vector Visual", Impl<Vector_Visual>::Builder{}
|
||||
return make_visual_plot<Vector_Visual>("Vector Visual", Vector_Visual::Builder<Vector_Visual>{}
|
||||
.set(&Vector_Visual::Prop::items, std::vector<Vector_Glyph>{{{-0.55F, -0.35F, 0.0F}, {0.55F, 0.2F, 0.25F}, color(255, 98, 115), 4.0F}, {{-0.1F, 0.0F, 0.0F}, {0.2F, 0.62F, 0.18F}, color(80, 225, 190), 5.0F}, {{0.35F, -0.25F, 0.0F}, {-0.12F, 0.25F, 0.65F}, color(78, 145, 255), 4.0F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_primitive_plot() {
|
||||
return make_visual_plot<Primitive_Visual>("Primitive Visual", Impl<Primitive_Visual>::Builder{}
|
||||
return make_visual_plot<Primitive_Visual>("Primitive Visual", Primitive_Visual::Builder<Primitive_Visual>{}
|
||||
.set(&Primitive_Visual::Prop::topology, Primitive_Topology::triangle_list)
|
||||
.set(&Primitive_Visual::Prop::items, std::vector<Primitive_Vertex>{{{-0.72F, -0.55F, 0.0F}, color(255, 86, 110), {0, 0, 1}}, {{0.72F, -0.55F, 0.0F}, color(75, 145, 255), {0, 0, 1}}, {{0.0F, 0.72F, 0.25F}, color(82, 226, 190), {0, 0, 1}}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_mesh_plot() {
|
||||
const std::vector<Mesh_Vertex> mesh{{{-0.65F, -0.55F, 0.0F}, color(255, 94, 112), {0, 0, 1}, {0, 0}}, {{0.65F, -0.55F, 0.0F}, color(75, 145, 255), {0, 0, 1}, {1, 0}}, {{0.65F, 0.55F, 0.0F}, color(82, 226, 190), {0, 0, 1}, {1, 1}}, {{-0.65F, -0.55F, 0.0F}, color(255, 94, 112), {0, 0, 1}, {0, 0}}, {{0.65F, 0.55F, 0.0F}, color(82, 226, 190), {0, 0, 1}, {1, 1}}, {{-0.65F, 0.55F, 0.0F}, color(244, 190, 86), {0, 0, 1}, {0, 1}}};
|
||||
return make_visual_plot<Mesh_Visual>("Mesh Visual", Impl<Mesh_Visual>::Builder{}.set(&Mesh_Visual::Prop::items, mesh).build());
|
||||
return make_visual_plot<Mesh_Visual>("Mesh Visual", Mesh_Visual::Builder<Mesh_Visual>{}.set(&Mesh_Visual::Prop::items, mesh).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_spectrogram_plot() {
|
||||
const Spectrogram_Parameters parameters;
|
||||
auto marker_result = Impl<Marker_Visual>::Builder{}
|
||||
auto marker_result = Marker_Visual::Builder<Marker_Visual>{}
|
||||
.set(&Marker_Visual::Prop::items, std::vector<Marker>{
|
||||
{
|
||||
{-0.35F, -0.18F, 0.72F}, color(255, 244, 170), 23.0F, 0.0F,
|
||||
@@ -780,7 +780,7 @@ std::shared_ptr<Plot> make_datoviz_spectrogram_plot() {
|
||||
};
|
||||
return make_visual_plot<Mesh_Visual>(
|
||||
"3D Spectrogram",
|
||||
Impl<Mesh_Visual>::Builder{}
|
||||
Mesh_Visual::Builder<Mesh_Visual>{}
|
||||
.set(&Mesh_Visual::Prop::items, spectrogram_mesh(parameters))
|
||||
.build(),
|
||||
std::move(components), Spectrogram_Data_Generator{parameters}, std::move(markers));
|
||||
@@ -791,31 +791,31 @@ std::shared_ptr<Plot> make_datoviz_path_plot() {
|
||||
const float t = static_cast<float>(index) / 63.0F;
|
||||
path.push_back({{-0.9F + 1.8F * t, 0.48F * std::sin(t * 4.0F * std::numbers::pi_v<float>), 0.25F * std::cos(t * 2.0F * std::numbers::pi_v<float>)}, color(static_cast<std::uint8_t>(70 + 170 * t), static_cast<std::uint8_t>(220 - 80 * t), 245), 5.0F});
|
||||
}
|
||||
return make_visual_plot<Path_Visual>("Path Visual", Impl<Path_Visual>::Builder{}.set(&Path_Visual::Prop::items, std::move(path)).build());
|
||||
return make_visual_plot<Path_Visual>("Path Visual", Path_Visual::Builder<Path_Visual>{}.set(&Path_Visual::Prop::items, std::move(path)).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_image_plot() {
|
||||
return make_visual_plot<Image_Visual>("Image Visual", Impl<Image_Visual>::Builder{}
|
||||
return make_visual_plot<Image_Visual>("Image Visual", Image_Visual::Builder<Image_Visual>{}
|
||||
.set(&Image_Visual::Prop::field_width, 32U).set(&Image_Visual::Prop::field_height, 32U)
|
||||
.set(&Image_Visual::Prop::items, std::vector<Image>{{{0.0F, 0.0F, 0.0F}, {1.45F, 1.0F}, {0, 0, 1, 1}, color(255, 255, 255)}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_labels_plot() {
|
||||
return make_visual_plot<Labels_Visual>("Labels Visual", Impl<Labels_Visual>::Builder{}
|
||||
return make_visual_plot<Labels_Visual>("Labels Visual", Labels_Visual::Builder<Labels_Visual>{}
|
||||
.set(&Labels_Visual::Prop::field_width, 8U).set(&Labels_Visual::Prop::field_height, 8U)
|
||||
.set(&Labels_Visual::Prop::items, std::vector<Label>{{{-0.55F, 0.28F, 0.0F}, 0, {72, 34}, color(255, 255, 255)}, {{0.5F, 0.25F, 0.1F}, 1, {72, 34}, color(255, 255, 255)}, {{-0.45F, -0.32F, 0.1F}, 2, {72, 34}, color(255, 255, 255)}, {{0.55F, -0.3F, 0.0F}, 3, {72, 34}, color(255, 255, 255)}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_glyph_plot() {
|
||||
return make_visual_plot<Glyph_Visual>("Glyph Visual", Impl<Glyph_Visual>::Builder{}
|
||||
return make_visual_plot<Glyph_Visual>("Glyph Visual", Glyph_Visual::Builder<Glyph_Visual>{}
|
||||
.set(&Glyph_Visual::Prop::field_width, 32U).set(&Glyph_Visual::Prop::field_height, 32U)
|
||||
.set(&Glyph_Visual::Prop::items, std::vector<Glyph>{{{-0.55F, -0.15F, 0.0F}, {-0.18F, -0.18F, 0.18F, 0.18F}, {0, 0, 1, 1}, color(255, 100, 120), -0.2F}, {{0.0F, 0.22F, 0.1F}, {-0.22F, -0.22F, 0.22F, 0.22F}, {0, 0, 1, 1}, color(82, 226, 190), 0.25F}, {{0.55F, -0.15F, 0.0F}, {-0.2F, -0.2F, 0.2F, 0.2F}, {0, 0, 1, 1}, color(80, 145, 255), 0.55F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_text_plot() {
|
||||
return make_visual_plot<Text_Visual>("Text Visual", Impl<Text_Visual>::Builder{}
|
||||
return make_visual_plot<Text_Visual>("Text Visual", Text_Visual::Builder<Text_Visual>{}
|
||||
.set(&Text_Visual::Prop::items, std::vector<Text_Label>{{{-0.72F, 0.28F, 0.0F}, "Aethera", color(82, 226, 190), 28.0F}, {{-0.62F, -0.15F, 0.1F}, "Datoviz Visual", color(90, 155, 255), 22.0F}}).build());
|
||||
}
|
||||
std::shared_ptr<Plot> make_datoviz_volume_plot() {
|
||||
std::vector<Voxel> voxels(16U * 16U * 16U);
|
||||
for (std::size_t index = 0; index < voxels.size(); ++index) voxels[index].value = static_cast<float>(index % 256U) / 255.0F;
|
||||
return make_visual_plot<Volume_Visual>("Volume Visual", Impl<Volume_Visual>::Builder{}
|
||||
return make_visual_plot<Volume_Visual>("Volume Visual", Volume_Visual::Builder<Volume_Visual>{}
|
||||
.set(&Volume_Visual::Prop::field_width, 16U).set(&Volume_Visual::Prop::field_height, 16U).set(&Volume_Visual::Prop::field_depth, 16U)
|
||||
.set(&Volume_Visual::Prop::items, std::move(voxels)).build());
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ void Gallery_Video_Stream::Private::complete_media_frame() {
|
||||
}
|
||||
std::shared_ptr<Gallery_Video_Stream> Gallery_Video_Stream::create(
|
||||
std::vector<Plot_Entry> plots) {
|
||||
auto built = Impl<Gallery_Video_Stream>::Builder{}.build();
|
||||
auto built = Gallery_Video_Stream::Builder<Gallery_Video_Stream>{}.build();
|
||||
if (!built)
|
||||
throw std::logic_error(
|
||||
"gallery video stream definition validation failed");
|
||||
@@ -595,8 +595,7 @@ nlohmann::json Gallery_Video_Stream::diagnostics() const {
|
||||
{"version", 3},
|
||||
{"sources", nlohmann::json::object()}
|
||||
};
|
||||
static_cast<const Impl<Gallery_Video_Stream>*>(this)
|
||||
->template access_state<Base_Tag>([&output](const State& state) {
|
||||
this->template access_state<Base_Tag>([&output](const State& state) {
|
||||
if (!state.diagnostics.empty()) output = state.diagnostics;
|
||||
});
|
||||
const auto& data = static_cast<const Private&>(*d);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <chrono>
|
||||
namespace aethera::web {
|
||||
struct Gallery_Video_Stream::Private : Prev_Private {
|
||||
using Object = Impl<Gallery_Video_Stream>;
|
||||
using Object = Gallery_Video_Stream;
|
||||
struct Source {
|
||||
Plot_Entry entry; /* 布局槽位关联的实际 Plot。 */
|
||||
Plot::Stream_Id stream{}; /* Plot 完成帧的唯一订阅标识。 */
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace aethera::web {
|
||||
namespace {
|
||||
using namespace render_2d;
|
||||
using namespace render_3d;
|
||||
using Scene_2D = Impl<Render_Scene_2D>;
|
||||
using Scene_3D = Impl<Render_Scene_3D>;
|
||||
using Scene_2D = Render_Scene_2D;
|
||||
using Scene_3D = Render_Scene_3D;
|
||||
constexpr std::uint16_t plot_stream_protocol_version{9};
|
||||
constexpr std::size_t diagnostic_window_capacity{600};
|
||||
|
||||
|
||||
@@ -69,9 +69,9 @@ public:
|
||||
[[nodiscard]] virtual nlohmann::json generate_data(const nlohmann::json& input) = 0;
|
||||
virtual void update(const Plot_Render_Tick& tick) = 0;
|
||||
};
|
||||
Plot(std::unique_ptr<Impl<render_2d::Render_Scene_2D>> scene,
|
||||
Plot(std::unique_ptr<render_2d::Render_Scene_2D> scene,
|
||||
std::unique_ptr<Scene_View> view);
|
||||
Plot(std::unique_ptr<Impl<render_3d::Render_Scene_3D>> scene,
|
||||
Plot(std::unique_ptr<render_3d::Render_Scene_3D> scene,
|
||||
std::unique_ptr<Scene_View> view);
|
||||
~Plot();
|
||||
Plot(const Plot&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user