Blender  V3.3
Classes | Macros | Enumerations | Functions | Variables
editmesh_bevel.c File Reference
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_editmesh.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_unit.h"
#include "DNA_curveprofile_types.h"
#include "DNA_mesh_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "ED_mesh.h"
#include "ED_numinput.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_transform.h"
#include "ED_util.h"
#include "ED_view3d.h"
#include "mesh_intern.h"

Go to the source code of this file.

Classes

struct  BevelObjectStore
 
struct  BevelData
 

Macros

#define MVAL_PIXEL_MARGIN   5.0f
 
#define PROFILE_HARD_MIN   0.0f
 
#define SEGMENTS_HARD_MAX   1000
 
#define OFFSET_VALUE   0
 
#define OFFSET_VALUE_PERCENT   1
 
#define PROFILE_VALUE   2
 
#define SEGMENTS_VALUE   3
 
#define NUM_VALUE_KINDS   4
 
#define WM_MODALKEY(_id)
 

Enumerations

enum  {
  BEV_MODAL_CANCEL = 1 , BEV_MODAL_CONFIRM , BEV_MODAL_VALUE_OFFSET , BEV_MODAL_VALUE_PROFILE ,
  BEV_MODAL_VALUE_SEGMENTS , BEV_MODAL_SEGMENTS_UP , BEV_MODAL_SEGMENTS_DOWN , BEV_MODAL_OFFSET_MODE_CHANGE ,
  BEV_MODAL_CLAMP_OVERLAP_TOGGLE , BEV_MODAL_AFFECT_CHANGE , BEV_MODAL_HARDEN_NORMALS_TOGGLE , BEV_MODAL_MARK_SEAM_TOGGLE ,
  BEV_MODAL_MARK_SHARP_TOGGLE , BEV_MODAL_OUTER_MITER_CHANGE , BEV_MODAL_INNER_MITER_CHANGE , BEV_MODAL_PROFILE_TYPE_CHANGE ,
  BEV_MODAL_VERTEX_MESH_CHANGE
}
 

Functions

static float get_bevel_offset (wmOperator *op)
 
static void edbm_bevel_update_status_text (bContext *C, wmOperator *op)
 
static bool edbm_bevel_init (bContext *C, wmOperator *op, const bool is_modal)
 
static bool edbm_bevel_calc (wmOperator *op)
 
static void edbm_bevel_exit (bContext *C, wmOperator *op)
 
static void edbm_bevel_cancel (bContext *C, wmOperator *op)
 
static int edbm_bevel_exec (bContext *C, wmOperator *op)
 
static void edbm_bevel_calc_initial_length (wmOperator *op, const wmEvent *event, bool mode_changed)
 
static int edbm_bevel_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void edbm_bevel_mouse_set_value (wmOperator *op, const wmEvent *event)
 
static void edbm_bevel_numinput_set_value (wmOperator *op)
 
wmKeyMapbevel_modal_keymap (wmKeyConfig *keyconf)
 
static int edbm_bevel_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void edbm_bevel_ui (bContext *C, wmOperator *op)
 
void MESH_OT_bevel (wmOperatorType *ot)
 

Variables

static const char * value_rna_name [NUM_VALUE_KINDS]
 
static const float value_clamp_min [NUM_VALUE_KINDS] = {0.0f, 0.0f, PROFILE_HARD_MIN, 1.0f}
 
static const float value_clamp_max [NUM_VALUE_KINDS] = {1e6, 100.0f, 1.0f, SEGMENTS_HARD_MAX}
 
static const float value_start [NUM_VALUE_KINDS] = {0.0f, 0.0f, 0.5f, 1.0f}
 
static const float value_scale_per_inch [NUM_VALUE_KINDS] = {0.0f, 100.0f, 1.0f, 4.0f}
 

Macro Definition Documentation

◆ MVAL_PIXEL_MARGIN

#define MVAL_PIXEL_MARGIN   5.0f

Definition at line 45 of file editmesh_bevel.c.

◆ NUM_VALUE_KINDS

#define NUM_VALUE_KINDS   4

Definition at line 56 of file editmesh_bevel.c.

◆ OFFSET_VALUE

#define OFFSET_VALUE   0

Definition at line 52 of file editmesh_bevel.c.

◆ OFFSET_VALUE_PERCENT

#define OFFSET_VALUE_PERCENT   1

Definition at line 53 of file editmesh_bevel.c.

◆ PROFILE_HARD_MIN

#define PROFILE_HARD_MIN   0.0f

Definition at line 47 of file editmesh_bevel.c.

◆ PROFILE_VALUE

#define PROFILE_VALUE   2

Definition at line 54 of file editmesh_bevel.c.

◆ SEGMENTS_HARD_MAX

#define SEGMENTS_HARD_MAX   1000

Definition at line 49 of file editmesh_bevel.c.

◆ SEGMENTS_VALUE

#define SEGMENTS_VALUE   3

Definition at line 55 of file editmesh_bevel.c.

◆ WM_MODALKEY

#define WM_MODALKEY (   _id)
Value:
op->type, (_id), true, UI_MAX_SHORTCUT_STR, &available_len, &p)
#define UI_MAX_SHORTCUT_STR
Definition: UI_interface.h:93
char * WM_modalkeymap_operator_items_to_string_buf(wmOperatorType *ot, const int propvalue, const bool compact, const int max_len, int *r_available_len, char **r_result)
Definition: wm_keymap.c:1270

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BEV_MODAL_CANCEL 
BEV_MODAL_CONFIRM 
BEV_MODAL_VALUE_OFFSET 
BEV_MODAL_VALUE_PROFILE 
BEV_MODAL_VALUE_SEGMENTS 
BEV_MODAL_SEGMENTS_UP 
BEV_MODAL_SEGMENTS_DOWN 
BEV_MODAL_OFFSET_MODE_CHANGE 
BEV_MODAL_CLAMP_OVERLAP_TOGGLE 
BEV_MODAL_AFFECT_CHANGE 
BEV_MODAL_HARDEN_NORMALS_TOGGLE 
BEV_MODAL_MARK_SEAM_TOGGLE 
BEV_MODAL_MARK_SHARP_TOGGLE 
BEV_MODAL_OUTER_MITER_CHANGE 
BEV_MODAL_INNER_MITER_CHANGE 
BEV_MODAL_PROFILE_TYPE_CHANGE 
BEV_MODAL_VERTEX_MESH_CHANGE 

Definition at line 93 of file editmesh_bevel.c.

Function Documentation

◆ bevel_modal_keymap()

wmKeyMap* bevel_modal_keymap ( wmKeyConfig keyconf)

◆ edbm_bevel_calc()

static bool edbm_bevel_calc ( wmOperator op)
static

◆ edbm_bevel_calc_initial_length()

static void edbm_bevel_calc_initial_length ( wmOperator op,
const wmEvent event,
bool  mode_changed 
)
static

◆ edbm_bevel_cancel()

static void edbm_bevel_cancel ( bContext C,
wmOperator op 
)
static

◆ edbm_bevel_exec()

static int edbm_bevel_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_bevel_exit()

static void edbm_bevel_exit ( bContext C,
wmOperator op 
)
static

◆ edbm_bevel_init()

static bool edbm_bevel_init ( bContext C,
wmOperator op,
const bool  is_modal 
)
static

◆ edbm_bevel_invoke()

static int edbm_bevel_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ edbm_bevel_modal()

static int edbm_bevel_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ edbm_bevel_mouse_set_value()

static void edbm_bevel_mouse_set_value ( wmOperator op,
const wmEvent event 
)
static

◆ edbm_bevel_numinput_set_value()

static void edbm_bevel_numinput_set_value ( wmOperator op)
static

◆ edbm_bevel_ui()

static void edbm_bevel_ui ( bContext C,
wmOperator op 
)
static

◆ edbm_bevel_update_status_text()

static void edbm_bevel_update_status_text ( bContext C,
wmOperator op 
)
static

◆ get_bevel_offset()

static float get_bevel_offset ( wmOperator op)
static

Definition at line 113 of file editmesh_bevel.c.

References BEVEL_AMT_PERCENT, wmOperator::ptr, RNA_enum_get(), and RNA_float_get().

Referenced by edbm_bevel_calc().

◆ MESH_OT_bevel()

void MESH_OT_bevel ( wmOperatorType ot)

Variable Documentation

◆ value_clamp_max

const float value_clamp_max[NUM_VALUE_KINDS] = {1e6, 100.0f, 1.0f, SEGMENTS_HARD_MAX}
static

Definition at line 61 of file editmesh_bevel.c.

Referenced by edbm_bevel_mouse_set_value(), and edbm_bevel_numinput_set_value().

◆ value_clamp_min

const float value_clamp_min[NUM_VALUE_KINDS] = {0.0f, 0.0f, PROFILE_HARD_MIN, 1.0f}
static

Definition at line 60 of file editmesh_bevel.c.

Referenced by edbm_bevel_mouse_set_value(), and edbm_bevel_numinput_set_value().

◆ value_rna_name

const char* value_rna_name[NUM_VALUE_KINDS]
static
Initial value:
= {
"offset", "offset_pct", "profile", "segments"}

Definition at line 58 of file editmesh_bevel.c.

Referenced by edbm_bevel_calc_initial_length(), edbm_bevel_mouse_set_value(), and edbm_bevel_numinput_set_value().

◆ value_scale_per_inch

const float value_scale_per_inch[NUM_VALUE_KINDS] = {0.0f, 100.0f, 1.0f, 4.0f}
static

Definition at line 63 of file editmesh_bevel.c.

Referenced by edbm_bevel_init().

◆ value_start

const float value_start[NUM_VALUE_KINDS] = {0.0f, 0.0f, 0.5f, 1.0f}
static

Definition at line 62 of file editmesh_bevel.c.

Referenced by edbm_bevel_calc_initial_length(), and edbm_bevel_mouse_set_value().