Euphoria
scurve.h
Go to the documentation of this file.
1#pragma once
2
3#include "dear_imgui/imgui.h"
4
5namespace eu::core
6{
7 struct SCurve;
8}
9
10namespace eu::imgui
11{
12
15{
16 ImVec2 drag = {0.5f, 0.5f};
17
18 SCurveGuiState() = default;
19 SCurveGuiState(float x, float y);
20
22
23 std::vector<ImVec2> point_cache;
24};
25
28{
29 bool widget_border = false;
31
32 float drag_radius = 10.0f;
33 ImU32 drag_color = IM_COL32(100, 0, 0, 255);
34
35 float point_radius = 3.0f;
36 ImU32 point_color = IM_COL32(0, 100, 0, 255);
37 bool draw_points = false;
38
40
41 ImU32 background_color = IM_COL32(50, 50, 50, 255);
42 ImU32 line_color = IM_COL32(100, 100, 100, 255);
43
44 std::size_t num_points = 21;
45};
46
47enum class FlipX
48{
49 no, yes
50};
51
53
58} // namespace klotter
bool imgui_s_curve_editor(const char *title, core::SCurve *scurve, SCurveGuiState *gui, FlipX flip_x, const SCurveImguiSettings &settings, bool force_init_curve)
A (inclusive) range between two values.
Definition range.h:19
Contains the parameters for an S-Curve.
Definition scurve.h:15
Represents the GUI state for an S-curve.
Definition scurve.h:15
ImVec2 drag
the gui data
Definition scurve.h:16
static SCurveGuiState light_curve()
SCurveGuiState(float x, float y)
std::vector< ImVec2 > point_cache
Definition scurve.h:23
Configuration settings for displaying and interacting with an S-curve widget.
Definition scurve.h:28
ImVec2 widget_size
size of the widget
Definition scurve.h:30
ImGuiMouseButton_ button
Definition scurve.h:39
std::size_t num_points
number of points to draw, more points means smoother curve, but more expensive
Definition scurve.h:44
bool widget_border
draw a border around the widget
Definition scurve.h:29