~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/bmesh/intern/bmesh_error.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * Contributor(s): Joseph Eagar.
 
19
 *
 
20
 * ***** END GPL LICENSE BLOCK *****
 
21
 */
 
22
 
 
23
#ifndef __BMESH_ERROR_H__
 
24
#define __BMESH_ERROR_H__
 
25
 
 
26
/** \file blender/bmesh/bmesh_error.h
 
27
 *  \ingroup bmesh
 
28
 */
 
29
 
 
30
/*----------- bmop error system ----------*/
 
31
 
 
32
/* pushes an error onto the bmesh error stack.
 
33
 * if msg is null, then the default message for the errorcode is used.*/
 
34
void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg);
 
35
 
 
36
/* gets the topmost error from the stack.
 
37
 * returns error code or 0 if no error.*/
 
38
int BMO_error_get(BMesh *bm, const char **msg, BMOperator **op);
 
39
int BMO_error_occurred(BMesh *bm);
 
40
 
 
41
/* same as geterror, only pops the error off the stack as well */
 
42
int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op);
 
43
void BMO_error_clear(BMesh *bm);
 
44
 
 
45
/* this is meant for handling errors, like self-intersection test failures.
 
46
 * it's dangerous to handle errors in general though, so disabled for now. */
 
47
 
 
48
/* catches an error raised by the op pointed to by catchop.
 
49
 * errorcode is either the errorcode, or BMERR_ALL for any
 
50
 * error.*/
 
51
 
 
52
/* not yet implemented.
 
53
 * int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, int errorcode, char **msg);
 
54
 */
 
55
 
 
56
#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b) \
 
57
        BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
 
58
 
 
59
/*------ error code defines -------*/
 
60
 
 
61
/*error messages*/
 
62
#define BMERR_SELF_INTERSECTING                 1
 
63
#define BMERR_DISSOLVEDISK_FAILED               2
 
64
#define BMERR_CONNECTVERT_FAILED                3
 
65
#define BMERR_WALKER_FAILED                             4
 
66
#define BMERR_DISSOLVEFACES_FAILED              5
 
67
#define BMERR_DISSOLVEVERTS_FAILED              6
 
68
#define BMERR_TESSELLATION                              7
 
69
#define BMERR_NONMANIFOLD                               8
 
70
#define BMERR_INVALID_SELECTION                 9
 
71
#define BMERR_MESH_ERROR                                10
 
72
 
 
73
/* BMESH_ASSERT */
 
74
#ifdef WITH_ASSERT_ABORT
 
75
#  define _BMESH_DUMMY_ABORT abort
 
76
#else
 
77
#  define _BMESH_DUMMY_ABORT() (void)0
 
78
#endif
 
79
 
 
80
/* this is meant to be higher level then BLI_assert(),
 
81
 * its enabled even when in Release mode*/
 
82
#define BMESH_ASSERT(a)                                                       \
 
83
        (void)((!(a)) ?  (                                                        \
 
84
                (                                                                     \
 
85
                fprintf(stderr,                                                       \
 
86
                        "BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n",                  \
 
87
                        __FILE__, __func__, __LINE__, STRINGIFY(a)),                      \
 
88
                _BMESH_DUMMY_ABORT(),                                                 \
 
89
                NULL)) : NULL)
 
90
 
 
91
#endif /* __BMESH_ERROR_H__ */