22#include "RNA_prototypes.hh"
40 for (
const auto &item :
42 std::pair<StringRef, eCurveProfilePresets>(
44 std::pair<StringRef, eCurveProfilePresets>(
46 std::pair<StringRef, eCurveProfilePresets>(
220 RNAUpdateCb *presets_cb = MEM_new<RNAUpdateCb>(__func__, cb);
255 TIP_(
"Reapply and update the preset, removing changes"));
264 row = &layout->
row(
false);
307 sub = &row->
row(
true);
314 ICON_ARROW_LEFTRIGHT,
322 TIP_(
"Reverse Path"));
330 const int icon = (profile->
flag &
PROF_USE_CLIP) ? ICON_CLIPUV_HLT : ICON_CLIPUV_DEHLT;
342 TIP_(
"Toggle Profile Clipping"));
350 RNAUpdateCb *tools_cb = MEM_new<RNAUpdateCb>(__func__, cb);
372 MEM_new<RNAUpdateCb>(__func__, cb),
380 const int path_height = path_width;
397 float *selection_x, *selection_y;
398 bool point_last_or_first =
false;
402 point = &profile->
path[
i];
403 selection_x = &point->
x;
404 selection_y = &point->
y;
408 point = &profile->
path[
i];
409 selection_x = &point->
h1_loc[0];
410 selection_y = &point->
h1_loc[1];
413 point = &profile->
path[
i];
414 selection_x = &point->
h2_loc[0];
415 selection_y = &point->
h2_loc[1];
419 point_last_or_first =
true;
433 row = &layout->
row(
true);
436 ptr->owner_id, &RNA_CurveProfilePoint, point);
438 row->
prop(&point_ptr,
465 if (point_last_or_first) {
486 if (point_last_or_first) {
502 TIP_(
"Delete points"));
508 if (point_last_or_first) {
526 RNA_warning(
"Curve Profile property not found: %s.%s",
533 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
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)
void UI_but_disable(uiBut *but, const char *disabled_hint)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, 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 * uiDefBut(uiBlock *block, int 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_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)
uiBut * uiDefIconBut(uiBlock *block, int 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_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)
uiBut * uiDefButF(uiBlock *block, int 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_block_lock_set(uiBlock *block, bool val, const char *lockstr)
void UI_but_flag_enable(uiBut *but, int flag)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
int uiLayoutGetWidth(uiLayout *layout)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
constexpr const char * c_str() const
#define ID_IS_EDITABLE(_id)
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)
uiLayout & row(bool align)
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)