Blender V4.3
bmesh_error.hh File Reference

Go to the source code of this file.

Macros

#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b)    BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
 
#define _BMESH_DUMMY_ABORT()   (void)0
 
#define BMESH_ASSERT(a)
 

Typedefs

typedef enum eBMOpErrorLevel eBMOpErrorLevel
 

Enumerations

enum  eBMOpErrorLevel { BMO_ERROR_CANCEL = 0 , BMO_ERROR_WARN = 1 , BMO_ERROR_FATAL = 2 }
 

Functions

void BMO_error_raise (BMesh *bm, BMOperator *owner, eBMOpErrorLevel level, const char *msg) ATTR_NONNULL(1
 
void bool BMO_error_get (BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
 
bool BMO_error_get_at_level (BMesh *bm, eBMOpErrorLevel level, const char **r_msg, BMOperator **r_op)
 
bool BMO_error_occurred_at_level (BMesh *bm, eBMOpErrorLevel level)
 
bool BMO_error_pop (BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
 
void BMO_error_clear (BMesh *bm)
 

Macro Definition Documentation

◆ _BMESH_DUMMY_ABORT

#define _BMESH_DUMMY_ABORT ( )    (void)0

Definition at line 75 of file bmesh_error.hh.

◆ BM_ELEM_INDEX_VALIDATE

#define BM_ELEM_INDEX_VALIDATE ( _bm,
_msg_a,
_msg_b )    BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)

Definition at line 68 of file bmesh_error.hh.

Referenced by BM_mesh_elem_index_ensure_ex(), BMO_op_finish(), and BMO_op_init().

◆ BMESH_ASSERT

#define BMESH_ASSERT ( a)
Value:
(void)((!(a)) ? ((fprintf(stderr, \
"BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
__FILE__, \
__func__, \
__LINE__, \
STRINGIFY(a)), \
_BMESH_DUMMY_ABORT(), \
NULL)) : \
#define STRINGIFY(x)
#define NULL

This is meant to be higher level than BLI_assert(), its enabled even when in Release mode.

Definition at line 82 of file bmesh_error.hh.

Referenced by _bm_elem_hide_set(), BM_edge_split(), BM_face_exists_multi_edge(), BM_faces_join(), BM_select_history_merge_from_targetmap(), bmesh_elem_check(), bmesh_kernel_join_edge_kill_vert(), bmesh_kernel_join_face_kill_edge(), bmesh_kernel_split_edge_make_vert(), bmesh_radial_length(), bmesh_radial_loop_append(), bmesh_radial_loop_remove(), bmesh_radial_validate(), and quad_4edge_subdivide().

Typedef Documentation

◆ eBMOpErrorLevel

Note
More can be added as needed.

Enumeration Type Documentation

◆ eBMOpErrorLevel

Note
More can be added as needed.
Enumerator
BMO_ERROR_CANCEL 

Use when the operation could not succeed, typically from input that isn't sufficient for completing the operation.

BMO_ERROR_WARN 

Use this when one or more operations could not succeed, when the resulting mesh can be used (since some operations succeeded or no change was made). This is used by default.

BMO_ERROR_FATAL 

The mesh resulting from this operation should not be used (where possible). It should not be left in a corrupt state either.

See BMBackup type & function calls.

Definition at line 18 of file bmesh_error.hh.

Function Documentation

◆ BMO_error_clear()

void BMO_error_clear ( BMesh * bm)

Definition at line 1462 of file bmesh_operators.cc.

References bm, and BMO_error_pop().

Referenced by BM_mesh_data_free(), bpy_bm_op_as_py_error(), and BPy_BMO_call().

◆ BMO_error_get()

void bool BMO_error_get ( BMesh * bm,
const char ** r_msg,
BMOperator ** r_op,
eBMOpErrorLevel * r_level )

Gets the topmost error from the stack. returns error code or 0 if no error.

Definition at line 1492 of file bmesh_operators.cc.

References bm, BMesh::errorstack, ListBase::first, BMOpError::level, BMOpError::msg, and BMOpError::op.

Referenced by BMO_error_pop(), and bpy_bm_op_as_py_error().

◆ BMO_error_get_at_level()

bool BMO_error_get_at_level ( BMesh * bm,
eBMOpErrorLevel level,
const char ** r_msg,
BMOperator ** r_op )

Definition at line 1512 of file bmesh_operators.cc.

References bm, BMesh::errorstack, and LISTBASE_FOREACH.

◆ BMO_error_occurred_at_level()

◆ BMO_error_pop()

bool BMO_error_pop ( BMesh * bm,
const char ** r_msg,
BMOperator ** r_op,
eBMOpErrorLevel * r_level )

◆ BMO_error_raise()

void BMO_error_raise ( BMesh * bm,
BMOperator * owner,
eBMOpErrorLevel level,
const char * msg )

Pushes an error onto the bmesh error stack. if msg is null, then the default message for the errcode is used.

Referenced by bmo_bisect_plane_exec(), bmo_bridge_loops_exec(), bmo_connect_verts_exec(), bmo_grid_fill_exec(), bmo_reverse_colors_exec(), bmo_rotate_colors_exec(), and bmo_subdivide_edgering_exec().