|
Blender V4.5
|
#include "DNA_curveprofile_types.h"Go to the source code of this file.
Enumerations | |
| enum | { PROF_UPDATE_NONE = 0 , PROF_UPDATE_REMOVE_DOUBLES = (1 << 0) , PROF_UPDATE_CLIP = (1 << 1) } |
| anonymous enum |
| Enumerator | |
|---|---|
| PROF_UPDATE_NONE | |
| PROF_UPDATE_REMOVE_DOUBLES | |
| PROF_UPDATE_CLIP | |
Definition at line 124 of file BKE_curveprofile.h.
| struct CurveProfile * BKE_curveprofile_add | ( | eCurveProfilePresets | preset | ) |
Returns a pointer to a newly allocated curve profile, using the given preset.
Definition at line 33 of file curveprofile.cc.
References BKE_curveprofile_add(), BKE_curveprofile_reset(), BKE_curveprofile_set_defaults(), BKE_curveprofile_update(), MEM_callocN(), and CurveProfile::preset.
Referenced by BKE_curveprofile_add(), blo_do_versions_280(), blo_update_defaults_scene(), init_data(), and scene_init_data().
| void BKE_curveprofile_blend_read | ( | struct BlendDataReader * | reader, |
| struct CurveProfile * | profile ) |
Expects that the curve profile itself has been read already.
Definition at line 90 of file curveprofile.cc.
References BKE_curveprofile_blend_read(), BKE_curveprofile_init(), BLO_read_struct_array, i, CurveProfile::path, CurveProfile::path_len, CurveProfilePoint::profile, CurveProfile::segments, CurveProfile::segments_len, and CurveProfile::table.
Referenced by BKE_curveprofile_blend_read(), BKE_curveprofile_blend_write(), blend_read(), curve_blend_read_data(), and scene_blend_read_data().
| void BKE_curveprofile_blend_write | ( | struct BlendWriter * | writer, |
| const struct CurveProfile * | profile ) |
References BKE_curveprofile_blend_read(), and BKE_curveprofile_blend_write().
Referenced by BKE_curveprofile_blend_write(), BKE_curveprofile_blend_write(), blend_write(), curve_blend_write(), and scene_blend_write().
| struct CurveProfile * BKE_curveprofile_copy | ( | const struct CurveProfile * | profile | ) |
References BKE_curveprofile_copy(), BKE_curveprofile_insert(), BKE_curveprofile_move_handle(), BKE_curveprofile_move_point(), BKE_curveprofile_remove_by_flag(), BKE_curveprofile_remove_point(), BKE_curveprofile_reset(), BKE_curveprofile_reset_view(), BKE_curveprofile_reverse(), BKE_curveprofile_selected_handle_set(), snap(), x, and y.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_copy(), BKE_toolsettings_copy(), copy_data(), and curve_copy_data().
| void BKE_curveprofile_copy_data | ( | struct CurveProfile * | target, |
| const struct CurveProfile * | profile ) |
References BKE_curveprofile_copy_data().
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_copy_data(), BKE_curveprofile_copy_data(), ui_but_copy_CurveProfile(), and ui_but_paste_CurveProfile().
| void BKE_curveprofile_evaluate_length_portion | ( | const struct CurveProfile * | profile, |
| float | length_portion, | ||
| float * | x_out, | ||
| float * | y_out ) |
Does a single evaluation along the profile's path. Travels down (length_portion * path) length and returns the position at that point. Where length portion is the fraction of the total path length where we want the location.
| length_portion | The portion (0 to 1) of the path's full length to sample at. |
References BKE_curveprofile_evaluate_length_portion().
Referenced by BKE_curveprofile_evaluate_length_portion(), and BKE_curveprofile_evaluate_length_portion().
| void BKE_curveprofile_free | ( | struct CurveProfile * | profile | ) |
Definition at line 52 of file curveprofile.cc.
References BKE_curveprofile_free(), BKE_curveprofile_free_data(), and MEM_freeN().
Referenced by BKE_curveprofile_free(), BKE_toolsettings_free(), curve_free_data(), and free_data().
| void BKE_curveprofile_free_data | ( | struct CurveProfile * | profile | ) |
Definition at line 45 of file curveprofile.cc.
References BKE_curveprofile_free_data(), MEM_SAFE_FREE, CurveProfile::path, CurveProfile::segments, and CurveProfile::table.
Referenced by BKE_curveprofile_free(), BKE_curveprofile_free_data(), ui_but_clipboard_free(), ui_but_copy_CurveProfile(), and ui_but_paste_CurveProfile().
| void BKE_curveprofile_init | ( | struct CurveProfile * | profile, |
| short | segments_len ) |
Refreshes the higher resolution table sampled from the input points. A call to this or BKE_curveprofile_update is needed before evaluation functions that use the table. Also sets the number of segments used for the display preview of the locations of the sampled points.
Definition at line 823 of file curveprofile.cc.
References BKE_curveprofile_init(), BKE_curveprofile_update(), CurveProfile::flag, PROF_DIRTY_PRESET, PROF_UPDATE_NONE, and CurveProfile::segments_len.
Referenced by BKE_curveprofile_blend_read(), BKE_curveprofile_init(), BKE_curveprofile_table_size(), and set_profile_spacing().
| struct CurveProfilePoint * BKE_curveprofile_insert | ( | struct CurveProfile * | profile, |
| float | x, | ||
| float | y ) |
Adds a new point at the specified location. The choice for which points to place the new vertex between is made by checking which control point line segment is closest to the new point and placing the new vertex in between that segment's points.
Definition at line 266 of file curveprofile.cc.
References BKE_curveprofile_insert(), dist_squared_to_line_segment_v2(), distance(), CurveProfilePoint::flag, FLT_MAX, CurveProfilePoint::h1, CurveProfilePoint::h2, HD_AUTO, HD_VECT, i, MEM_freeN(), MEM_malloc_arrayN(), CurveProfile::path, CurveProfile::path_len, point_init(), PROF_SELECT, PROF_TABLE_MAX, CurveProfilePoint::profile, CurveProfilePoint::x, x, CurveProfilePoint::y, and y.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_insert(), and ui_do_but_CURVEPROFILE().
| bool BKE_curveprofile_move_handle | ( | struct CurveProfilePoint * | point, |
| bool | handle_1, | ||
| bool | snap, | ||
| const float | delta[2] ) |
Move a point's handle, accounting for the alignment of handles with the HD_ALIGN type.
| handle_1 | Whether to move the 1st or 2nd control point. |
| delta | The relative change in the handle's position. |
Definition at line 110 of file curveprofile.cc.
References BKE_curveprofile_move_handle(), copy_v2_v2(), ELEM, equals_v2v2(), CurveProfilePoint::h1, CurveProfilePoint::h1_loc, CurveProfilePoint::h2, CurveProfilePoint::h2_loc, HD_ALIGN, HD_FREE, snap(), CurveProfilePoint::x, and CurveProfilePoint::y.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_move_handle(), BKE_curveprofile_selected_handle_set(), and ui_numedit_but_CURVEPROFILE().
| bool BKE_curveprofile_move_point | ( | struct CurveProfile * | profile, |
| struct CurveProfilePoint * | point, | ||
| bool | snap, | ||
| const float | delta[2] ) |
Moves a control point, accounting for clipping and snapping, and moving free handles.
| snap | Whether to snap the point to the grid |
| delta | The relative change of the point's location. |
Definition at line 150 of file curveprofile.cc.
References BKE_curveprofile_move_point(), CurveProfile::clip_rect, ELEM, CurveProfile::flag, CurveProfilePoint::h1, CurveProfilePoint::h1_loc, CurveProfilePoint::h2, CurveProfilePoint::h2_loc, HD_ALIGN, HD_FREE, max_ff(), min_ff(), CurveProfile::path, CurveProfile::path_len, PROF_USE_CLIP, snap(), CurveProfilePoint::x, rctf::xmax, rctf::xmin, CurveProfilePoint::y, rctf::ymax, and rctf::ymin.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_move_point(), and ui_numedit_but_CURVEPROFILE().
| void BKE_curveprofile_remove_by_flag | ( | struct CurveProfile * | profile, |
| short | flag ) |
Removes every point in the widget with the supplied flag set, except for the first and last.
| flag | CurveProfilePoint.flag. |
Definition at line 227 of file curveprofile.cc.
References BKE_curveprofile_remove_by_flag(), CurveProfilePoint::flag, MEM_freeN(), MEM_malloc_arrayN(), CurveProfile::path, and CurveProfile::path_len.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_remove_by_flag(), CurveProfile_buttons_layout(), and ui_do_but_CURVEPROFILE().
| bool BKE_curveprofile_remove_point | ( | struct CurveProfile * | profile, |
| struct CurveProfilePoint * | point ) |
Removes a specific point from the path of control points.
Definition at line 197 of file curveprofile.cc.
References BKE_curveprofile_remove_point(), BLI_assert, MEM_freeN(), MEM_malloc_arrayN(), CurveProfile::path, and CurveProfile::path_len.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_remove_point(), and BKE_curveprofile_update().
| void BKE_curveprofile_reset | ( | struct CurveProfile * | profile | ) |
Resets the profile to the current preset.
Definition at line 424 of file curveprofile.cc.
References BKE_curveprofile_reset(), curveprofile_build_steps(), curveprofile_build_supports(), CurveProfile::flag, HD_AUTO, HD_VECT, i, MEM_calloc_arrayN(), MEM_SAFE_FREE, CurveProfile::path, CurveProfile::path_len, point_init(), CurveProfile::preset, PROF_DIRTY_PRESET, PROF_PRESET_CORNICE, PROF_PRESET_CROWN, PROF_PRESET_LINE, PROF_PRESET_STEPS, PROF_PRESET_SUPPORTS, CurveProfilePoint::profile, CurveProfile::segments_len, and CurveProfile::table.
Referenced by BKE_curveprofile_add(), BKE_curveprofile_copy(), BKE_curveprofile_reset(), curve_profile_presets_fn(), curve_profile_tools_fn(), and CurveProfile_buttons_layout().
| void BKE_curveprofile_reset_view | ( | struct CurveProfile * | profile | ) |
Reset the view to the clipping rectangle.
Definition at line 419 of file curveprofile.cc.
References BKE_curveprofile_reset_view(), CurveProfile::clip_rect, and CurveProfile::view_rect.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_reset_view(), and curve_profile_tools_fn().
| void BKE_curveprofile_reverse | ( | struct CurveProfile * | profile | ) |
Flips the profile across the diagonal so that its orientation is reversed.
Definition at line 343 of file curveprofile.cc.
References BKE_curveprofile_reverse(), BLI_assert, ELEM, CurveProfilePoint::h1, CurveProfilePoint::h1_loc, CurveProfilePoint::h2, CurveProfilePoint::h2_loc, HD_ALIGN, HD_FREE, i, MEM_freeN(), MEM_malloc_arrayN(), mirror_point(), CurveProfile::path, CurveProfile::path_len, and CurveProfilePoint::profile.
Referenced by BKE_curveprofile_copy(), BKE_curveprofile_reverse(), and CurveProfile_buttons_layout().
| void BKE_curveprofile_selected_handle_set | ( | struct CurveProfile * | profile, |
| int | type_1, | ||
| int | type_2 ) |
Sets the handle type of the selected control points.
| type_1,type_2 | Handle type for the first handle. HD_VECT, HD_AUTO, HD_FREE, or HD_ALIGN. |
Definition at line 321 of file curveprofile.cc.
References BKE_curveprofile_move_handle(), BKE_curveprofile_selected_handle_set(), ELEM, CurveProfilePoint::flag, CurveProfilePoint::h1, CurveProfilePoint::h2, HD_ALIGN, i, CurveProfile::path, CurveProfile::path_len, PROF_H1_SELECT, PROF_H2_SELECT, and PROF_SELECT.
Referenced by BKE_curveprofile_copy(), and BKE_curveprofile_selected_handle_set().
| void BKE_curveprofile_set_defaults | ( | struct CurveProfile * | profile | ) |
Sets the default settings and clip range for the profile widget. Does not generate either table.
Definition at line 803 of file curveprofile.cc.
References BKE_curveprofile_set_defaults(), BLI_rctf_init(), CurveProfile::changed_timestamp, CurveProfile::clip_rect, CurveProfile::flag, MEM_calloc_arrayN(), CurveProfile::path, CurveProfile::path_len, PROF_USE_CLIP, CurveProfilePoint::profile, CurveProfile::view_rect, CurveProfilePoint::x, and CurveProfilePoint::y.
Referenced by BKE_curveprofile_add(), and BKE_curveprofile_set_defaults().
| int BKE_curveprofile_table_size | ( | const struct CurveProfile * | profile | ) |
References BKE_curveprofile_init(), and BKE_curveprofile_table_size().
Referenced by BKE_curveprofile_evaluate_length_portion(), BKE_curveprofile_table_size(), BKE_curveprofile_table_size(), curveprofile_distance_to_next_table_point(), curveprofile_make_table(), curveprofile_total_length(), ui_do_but_CURVEPROFILE(), and ui_draw_but_CURVEPROFILE().
| void BKE_curveprofile_update | ( | struct CurveProfile * | profile, |
| int | update_flags ) |
Should be called after the widget is changed. Does profile and remove double checks and more importantly, recreates the display / evaluation and segments tables.
| update_flags | Bit-field with fields defined in header file. Controls removing doubles and clipping. |
Definition at line 966 of file curveprofile.cc.
References BKE_curveprofile_remove_point(), BKE_curveprofile_update(), BLI_assert, BLI_rctf_size_x(), BLI_rctf_size_y(), CurveProfile::changed_timestamp, clamp_f(), CurveProfile::clip_rect, curveprofile_make_segments_table(), curveprofile_make_table(), CurveProfile::flag, i, len_squared_v2v2(), CurveProfile::path, CurveProfile::path_len, pow2f(), PROF_UPDATE_CLIP, PROF_UPDATE_REMOVE_DOUBLES, PROF_USE_CLIP, CurveProfile::segments_len, CurveProfile::view_rect, CurveProfilePoint::x, x, rctf::xmax, rctf::xmin, CurveProfilePoint::y, y, rctf::ymax, and rctf::ymin.
Referenced by BKE_curveprofile_add(), BKE_curveprofile_init(), BKE_curveprofile_update(), curve_profile_presets_fn(), curve_profile_tools_fn(), CurveProfile_buttons_layout(), ui_do_but_CURVEPROFILE(), ui_draw_but_CURVEPROFILE(), and ui_numedit_but_CURVEPROFILE().