23#include "RNA_prototypes.hh"
41 for (
const auto &item :
43 std::pair<StringRef, eCurveProfilePresets>(
45 std::pair<StringRef, eCurveProfilePresets>(
47 std::pair<StringRef, eCurveProfilePresets>(
215 RNAUpdateCb *presets_cb = MEM_new<RNAUpdateCb>(__func__, cb);
248 TIP_(
"Reapply and update the preset, removing changes"));
257 row = &layout->
row(
false);
300 sub = &row->
row(
true);
307 ICON_ARROW_LEFTRIGHT,
315 TIP_(
"Reverse Path"));
323 const int icon = (profile->
flag &
PROF_USE_CLIP) ? ICON_CLIPUV_HLT : ICON_CLIPUV_DEHLT;
335 TIP_(
"Toggle Profile Clipping"));
343 RNAUpdateCb *tools_cb = MEM_new<RNAUpdateCb>(__func__, cb);
365 MEM_new<RNAUpdateCb>(__func__, cb),
373 const int path_height = path_width;
390 float *selection_x, *selection_y;
391 bool point_last_or_first =
false;
395 point = &profile->
path[
i];
396 selection_x = &point->
x;
397 selection_y = &point->
y;
401 point = &profile->
path[
i];
402 selection_x = &point->
h1_loc[0];
403 selection_y = &point->
h1_loc[1];
406 point = &profile->
path[
i];
407 selection_x = &point->
h2_loc[0];
408 selection_y = &point->
h2_loc[1];
412 point_last_or_first =
true;
426 row = &layout->
row(
true);
429 ptr->owner_id, &RNA_CurveProfilePoint, point);
431 row->
prop(&point_ptr,
458 if (point_last_or_first) {
479 if (point_last_or_first) {
495 TIP_(
"Delete points"));
501 if (point_last_or_first) {
519 RNA_warning(
"Curve Profile property not found: %s.%s",
526 RNA_warning(
"Curve Profile is not a pointer: %s.%s",
ARegion * CTX_wm_region(const bContext *C)
void BKE_curveprofile_update(struct CurveProfile *profile, int update_flags)
@ PROF_UPDATE_REMOVE_DOUBLES
void BKE_curveprofile_reset_view(struct CurveProfile *profile)
void BKE_curveprofile_remove_by_flag(struct CurveProfile *profile, short flag)
void BKE_curveprofile_reset(struct CurveProfile *profile)
void BKE_curveprofile_reverse(struct CurveProfile *profile)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_ID_MESH
#define ID_IS_EDITABLE(_id)
void ED_region_tag_redraw(ARegion *region)
void ED_undo_push(bContext *C, const char *str)
#define RNA_warning(format,...)
void UI_but_func_set(uiBut *but, std::function< void(bContext &)> func)
void * but_func_argN_copy(const void *argN)
void but_func_argN_free(void *argN)
uiBut * uiDefButF(uiBlock *block, ButType type, int retval, blender::StringRef str, int x, int y, short width, short height, float *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_disable(uiBut *but, const char *disabled_hint)
uiBut * uiDefIconTextBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, std::optional< blender::StringRef > tip)
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_block_lock_clear(uiBlock *block)
uiBut * uiDefIconBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_number_step_size_set(uiBut *but, float step_size)
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_block_bounds_set_text(uiBlock *block, int addval)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void UI_but_number_precision_set(uiBut *but, float precision)
void UI_block_direction_set(uiBlock *block, char direction)
uiBut * uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_flag_enable(uiBut *but, int flag)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
constexpr const char * c_str() const
void uiTemplateCurveProfile(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname)
static void CurveProfile_buttons_layout(uiLayout *layout, PointerRNA *ptr, const RNAUpdateCb &cb)
static bool curve_profile_can_zoom_out(CurveProfile *profile)
static uiBlock * curve_profile_presets_fn(bContext *C, ARegion *region, void *cb_v)
static uiBlock * curve_profile_tools_fn(bContext *C, ARegion *region, void *cb_v)
static bool curve_profile_can_zoom_in(CurveProfile *profile)
static void curve_profile_zoom_out(bContext *C, CurveProfile *profile)
static void curve_profile_zoom_in(bContext *C, CurveProfile *profile)
static void rna_update_cb(bContext &C, const RNAUpdateCb &cb)
#define ERROR_LIBDATA_MESSAGE
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void alignment_set(blender::ui::LayoutAlign alignment)
uiLayout & row(bool align)
void use_property_split_set(bool value)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)