#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/GradientCurveEditor.hpp>
Public Types | |
| using | PointList = std::vector<GradientAnchor> |
Public Member Functions | |
| GradientCurveEditor (wxWindow *parent, const wxColour &color_low=wxColour(217, 217, 217), const wxColour &color_high=wxColour(217, 217, 217)) | |
| ~GradientCurveEditor () override | |
| void | set_points (const PointList &pts) |
| const PointList & | get_points () const |
| void | set_colors (const wxColour &color_low, const wxColour &color_high) |
| void | set_selected_curve (int curve_idx) |
| int | get_selected_curve () const |
| void | reset_to_linear (double y0, double y1) |
| void | reverse () |
Private Types | |
| enum class | DragMode { None , Anchor } |
Private Member Functions | |
| void | normalize_points () |
| void | emit_changed () |
| void | on_paint (wxPaintEvent &evt) |
| void | on_left_down (wxMouseEvent &evt) |
| void | on_left_up (wxMouseEvent &evt) |
| void | on_right_down (wxMouseEvent &evt) |
| void | on_motion (wxMouseEvent &evt) |
| void | on_leave (wxMouseEvent &evt) |
| void | on_size (wxSizeEvent &evt) |
| wxRect | plot_rect () const |
| wxPoint2DDouble | data_to_px_f (double x, double y) const |
| wxPoint | data_to_px (double x, double y) const |
| void | px_to_data (int px, int py, double &x, double &y) const |
| int | hit_test (int px, int py) const |
| int | hit_test_curve (int px, int py, int *seg_out=nullptr) const |
| double | sample_curve_y (double x) const |
Static Private Member Functions | |
| static double | to_stored_y (int curve_idx, double visual_y) |
| static double | to_visual_y (int curve_idx, double stored_y) |
Private Attributes | |
| PointList | m_points |
| wxColour | m_color_low |
| wxColour | m_color_high |
| int | m_selected_curve = 0 |
| DragMode | m_drag_mode = DragMode::None |
| int | m_drag_idx = -1 |
| bool | m_dragged_moved = false |
| using Slic3r::GUI::GradientCurveEditor::PointList = std::vector<GradientAnchor> |
|
strongprivate |
| Slic3r::GUI::GradientCurveEditor::GradientCurveEditor | ( | wxWindow * | parent, |
| const wxColour & | color_low = wxColour(217, 217, 217), | ||
| const wxColour & | color_high = wxColour(217, 217, 217) ) |
References m_color_high, m_color_low, m_drag_idx, m_drag_mode, m_dragged_moved, None, on_leave(), on_left_down(), on_left_up(), on_motion(), on_paint(), on_right_down(), on_size(), and reset_to_linear().
|
override |
|
private |
References data_to_px_f().
Referenced by hit_test(), and hit_test_curve().
|
private |
References plot_rect().
Referenced by data_to_px(), and on_paint().
|
private |
Referenced by on_left_down(), on_left_up(), on_right_down(), reset_to_linear(), and reverse().
|
inline |
References m_points.
|
inline |
References m_selected_curve.
|
private |
References data_to_px(), m_points, m_selected_curve, and to_visual_y().
Referenced by on_left_down(), and on_right_down().
|
private |
References data_to_px(), Slic3r::l2(), m_points, m_selected_curve, plot_rect(), px_to_data(), sample_curve_y(), and to_visual_y().
Referenced by on_left_down(), and on_right_down().
|
private |
References Slic3r::kGradientMaxRatio, Slic3r::kGradientMinRatio, m_points, Slic3r::GradientAnchor::x, and Slic3r::GradientAnchor::y.
Referenced by set_points().
|
private |
References Slic3r::GUI::wxMouseEvent.
Referenced by GradientCurveEditor().
|
private |
References Anchor, emit_changed(), hit_test(), hit_test_curve(), m_drag_idx, m_drag_mode, m_dragged_moved, m_points, m_selected_curve, None, px_to_data(), sample_curve_y(), Slic3r::GUI::wxMouseEvent, Slic3r::GradientAnchor::x, and Slic3r::GradientAnchor::y.
Referenced by GradientCurveEditor().
|
private |
References Anchor, emit_changed(), m_drag_idx, m_drag_mode, m_dragged_moved, None, and Slic3r::GUI::wxMouseEvent.
Referenced by GradientCurveEditor().
|
private |
References Anchor, Slic3r::kGradientMaxRatio, Slic3r::kGradientMinRatio, m_drag_idx, m_drag_mode, m_dragged_moved, m_points, m_selected_curve, px_to_data(), to_stored_y(), and Slic3r::GUI::wxMouseEvent.
Referenced by GradientCurveEditor().
|
private |
References StateColor::darkModeColorFor(), data_to_px_f(), Slic3r::GUI::draw_mixed_gradient_plot(), m_color_high, m_color_low, m_points, m_selected_curve, plot_rect(), sample_curve_y(), and to_visual_y().
Referenced by GradientCurveEditor().
|
private |
References emit_changed(), hit_test(), hit_test_curve(), m_points, m_selected_curve, and Slic3r::GUI::wxMouseEvent.
Referenced by GradientCurveEditor().
|
private |
Referenced by GradientCurveEditor().
|
private |
References Slic3r::GUI::mixed_gradient_plot_rect().
Referenced by data_to_px_f(), hit_test_curve(), on_paint(), and px_to_data().
|
private |
References plot_rect().
Referenced by hit_test_curve(), on_left_down(), and on_motion().
| void Slic3r::GUI::GradientCurveEditor::reset_to_linear | ( | double | y0, |
| double | y1 ) |
References emit_changed(), Slic3r::kGradientMaxRatio, Slic3r::kGradientMinRatio, m_points, m_selected_curve, Slic3r::GradientAnchor::x, and Slic3r::GradientAnchor::y.
Referenced by GradientCurveEditor().
| void Slic3r::GUI::GradientCurveEditor::reverse | ( | ) |
References emit_changed(), and m_points.
|
private |
References m_points, Slic3r::GradientCurve::points, and Slic3r::sample_gradient_curve().
Referenced by hit_test_curve(), on_left_down(), and on_paint().
| void Slic3r::GUI::GradientCurveEditor::set_colors | ( | const wxColour & | color_low, |
| const wxColour & | color_high ) |
References m_color_high, and m_color_low.
| void Slic3r::GUI::GradientCurveEditor::set_points | ( | const PointList & | pts | ) |
References m_points, and normalize_points().
| void Slic3r::GUI::GradientCurveEditor::set_selected_curve | ( | int | curve_idx | ) |
References m_selected_curve.
|
inlinestaticprivate |
Referenced by on_motion().
|
inlinestaticprivate |
Referenced by hit_test(), hit_test_curve(), and on_paint().
|
private |
Referenced by GradientCurveEditor(), on_paint(), and set_colors().
|
private |
Referenced by GradientCurveEditor(), on_paint(), and set_colors().
|
private |
Referenced by GradientCurveEditor(), on_left_down(), on_left_up(), and on_motion().
|
private |
Referenced by GradientCurveEditor(), on_left_down(), on_left_up(), and on_motion().
|
private |
Referenced by GradientCurveEditor(), on_left_down(), on_left_up(), and on_motion().
|
private |
Referenced by get_points(), hit_test(), hit_test_curve(), normalize_points(), on_left_down(), on_motion(), on_paint(), on_right_down(), reset_to_linear(), reverse(), sample_curve_y(), and set_points().
|
private |
Referenced by get_selected_curve(), hit_test(), hit_test_curve(), on_left_down(), on_motion(), on_paint(), on_right_down(), reset_to_linear(), and set_selected_curve().