Blender
V5.3
source
blender
bmesh
intern
bmesh_error.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
10
11
#include "
bmesh_operator_api.hh
"
12
13
#include "
bmesh_class.hh
"
14
15
namespace
blender
{
16
17
/*----------- BMOP error system ----------*/
18
22
enum
eBMOpErrorLevel
{
27
BMO_ERROR_CANCEL
= 0,
33
BMO_ERROR_WARN
= 1,
40
BMO_ERROR_FATAL
= 2,
41
};
42
47
void
BMO_error_raise
(BMesh *
bm
, BMOperator *owner,
eBMOpErrorLevel
level,
const
char
*msg)
48
ATTR_NONNULL
(1, 2, 4);
49
54
bool
BMO_error_get
(BMesh *
bm
,
const
char
**r_msg, BMOperator **r_op,
eBMOpErrorLevel
*r_level);
55
bool
BMO_error_get_at_level
(BMesh *
bm
,
56
eBMOpErrorLevel
level,
57
const
char
**r_msg,
58
BMOperator **r_op);
59
bool
BMO_error_occurred_at_level
(BMesh *
bm
,
eBMOpErrorLevel
level);
60
61
/* Same as #BMO_error_get, only pops the error off the stack as well. */
62
bool
BMO_error_pop
(BMesh *
bm
,
const
char
**r_msg, BMOperator **r_op,
eBMOpErrorLevel
*r_level);
63
void
BMO_error_clear
(BMesh *
bm
);
64
65
/* This is meant for handling errors, like self-intersection test failures.
66
* it's dangerous to handle errors in general though, so disabled for now. */
67
68
/* Catches an error raised by the op pointed to by catchop. */
69
/* Not yet implemented. */
70
// int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, char **r_msg);
71
72
#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b) \
73
BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
74
75
/* BMESH_ASSERT */
76
#ifdef WITH_ASSERT_ABORT
77
# define _BMESH_DUMMY_ABORT abort
78
#else
79
# define _BMESH_DUMMY_ABORT() (void)0
80
#endif
81
86
#define BMESH_ASSERT(a) \
87
(void)((!(a)) ? ((fprintf(stderr, \
88
"BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
89
__FILE__, \
90
__func__, \
91
__LINE__, \
92
STRINGIFY(a)), \
93
_BMESH_DUMMY_ABORT(), \
94
NULL)) : \
95
NULL)
96
97
}
// namespace blender
ATTR_NONNULL
#define ATTR_NONNULL(...)
bmesh_class.hh
bmesh_operator_api.hh
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
blender::BMO_error_occurred_at_level
bool BMO_error_occurred_at_level(BMesh *bm, eBMOpErrorLevel level)
Definition
bmesh_operators.cc:1499
blender::BMO_error_get_at_level
bool BMO_error_get_at_level(BMesh *bm, eBMOpErrorLevel level, const char **r_msg, BMOperator **r_op)
Definition
bmesh_operators.cc:1529
blender::bm
BMesh * bm
Definition
bmesh_iterators_inline.hh:38
blender::BMO_error_clear
void BMO_error_clear(BMesh *bm)
Definition
bmesh_operators.cc:1481
blender::BMO_error_raise
void BMO_error_raise(BMesh *bm, BMOperator *owner, eBMOpErrorLevel level, const char *msg) ATTR_NONNULL(1
Definition
bmesh_operators.cc:1488
blender::BMO_error_pop
bool BMO_error_pop(BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
Definition
bmesh_operators.cc:1549
blender::eBMOpErrorLevel
eBMOpErrorLevel
Definition
bmesh_error.hh:22
blender::BMO_ERROR_WARN
@ BMO_ERROR_WARN
Definition
bmesh_error.hh:33
blender::BMO_ERROR_FATAL
@ BMO_ERROR_FATAL
Definition
bmesh_error.hh:40
blender::BMO_ERROR_CANCEL
@ BMO_ERROR_CANCEL
Definition
bmesh_error.hh:27
blender::BMO_error_get
void bool BMO_error_get(BMesh *bm, const char **r_msg, BMOperator **r_op, eBMOpErrorLevel *r_level)
Definition
bmesh_operators.cc:1509
Generated on
for Blender by
doxygen
1.18.0