~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_bmesh.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

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
 
 * The Original Code is Copyright (C) 2004 Blender Foundation.
19
 
 * All rights reserved.
20
 
 *
21
 
 * The Original Code is: all of this file.
22
 
 *
23
 
 * Contributor(s): Geoffrey Bantle.
24
 
 *
25
 
 * ***** END GPL LICENSE BLOCK *****
26
 
 */
27
 
 
28
 
#ifndef __BKE_BMESH_H__
29
 
#define __BKE_BMESH_H__
30
 
 
31
 
/** \file BKE_bmesh.h
32
 
 *  \ingroup bke
33
 
 *  \since January 2007
34
 
 *  \brief BMesh modeler structure and functions.
35
 
 *
36
 
 */
37
 
 
38
 
/*NOTE: this is the bmesh 1.0 code.  it's completely outdated.*/
39
 
 
40
 
/* uncomment to use the new bevel operator as a modifier */
41
 
#define USE_BM_BEVEL_OP_AS_MOD
42
 
 
43
 
/* bevel tool defines */
44
 
/* element flags */
45
 
#define BME_BEVEL_ORIG          1
46
 
#define BME_BEVEL_BEVEL         (1 << 1)
47
 
#define BME_BEVEL_NONMAN        (1 << 2)
48
 
#define BME_BEVEL_WIRE          (1 << 3)
49
 
 
50
 
/* tool options */
51
 
#define BME_BEVEL_SELECT        1
52
 
#define BME_BEVEL_VERT          (1 << 1)
53
 
#define BME_BEVEL_RADIUS        (1 << 2)
54
 
#define BME_BEVEL_ANGLE         (1 << 3)
55
 
#define BME_BEVEL_WEIGHT        (1 << 4)
56
 
#define BME_BEVEL_VGROUP        (1 << 5)
57
 
//~ #define BME_BEVEL_EWEIGHT           (1<<4)
58
 
//~ #define BME_BEVEL_VWEIGHT           (1<<5)
59
 
#define BME_BEVEL_PERCENT       (1 << 6)
60
 
#define BME_BEVEL_EMIN          (1 << 7)
61
 
#define BME_BEVEL_EMAX          (1 << 8)
62
 
#define BME_BEVEL_RUNNING       (1 << 9)
63
 
#define BME_BEVEL_RES           (1 << 10)
64
 
 
65
 
#define BME_BEVEL_EVEN          (1 << 11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding
66
 
                                               * here because they are mixed - campbell */
67
 
#define BME_BEVEL_DIST          (1 << 12) /* same as above */
68
 
 
69
 
#define BME_BEVEL_OVERLAP_OK    (1 << 13)
70
 
 
71
 
typedef struct BME_TransData {
72
 
        struct BMesh *bm; /* the bmesh the vert belongs to */
73
 
        struct BMVert *v;  /* pointer to the vert this tdata applies to */
74
 
        float co[3];  /* the original coordinate */
75
 
        float org[3]; /* the origin */
76
 
        float vec[3]; /* a directional vector; always, always normalize! */
77
 
        void *loc;    /* a pointer to the data to transform (likely the vert's cos) */
78
 
        float factor; /* primary scaling factor; also accumulates number of weighted edges for beveling tool */
79
 
        float weight; /* another scaling factor; used primarily for propogating vertex weights to transforms; */
80
 
                      /* weight is also used across recursive bevels to help with the math */
81
 
        float maxfactor; /* the unscaled, original factor (used only by "edge verts" in recursive beveling) */
82
 
        float *max;   /* the maximum distance this vert can be transformed; negative is infinite
83
 
                       * it points to the "parent" maxfactor (where maxfactor makes little sense)
84
 
                       * where the max limit is stored (limits are stored per-corner) */
85
 
} BME_TransData;
86
 
 
87
 
typedef struct BME_TransData_Head {
88
 
        struct GHash *gh;       /* the hash structure for element lookup */
89
 
        struct MemArena *ma;    /* the memory "pool" we will be drawing individual elements from */
90
 
        int len;
91
 
} BME_TransData_Head;
92
 
 
93
 
struct BME_TransData *BME_get_transdata(struct BME_TransData_Head *td, struct BMVert *v);
94
 
void BME_free_transdata(struct BME_TransData_Head *td);
95
 
struct BMesh *BME_bevel(struct BMesh *bm, float value, int res, int options, int defgrp_index, float angle,
96
 
                        BME_TransData_Head **rtd);
97
 
 
98
 
#endif