~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 *  \ingroup bke
27
27
 */
28
28
 
29
 
typedef enum SK_PType
30
 
{
 
29
typedef enum SK_PType {
31
30
        PT_CONTINUOUS,
32
31
        PT_EXACT,
33
32
} SK_PType;
34
33
 
35
 
typedef enum SK_PMode
36
 
{
 
34
typedef enum SK_PMode {
37
35
        PT_SNAP,
38
36
        PT_PROJECT,
39
37
} SK_PMode;
40
38
 
41
 
typedef struct SK_Point
42
 
{
 
39
typedef struct SK_Point {
43
40
        float p[3];
44
41
        short p2d[2];
45
42
        float no[3];
48
45
        SK_PMode mode;
49
46
} SK_Point;
50
47
 
51
 
typedef struct SK_Stroke
52
 
{
 
48
typedef struct SK_Stroke {
53
49
        struct SK_Stroke *next, *prev;
54
50
 
55
51
        SK_Point *points;
58
54
        int selected;
59
55
} SK_Stroke;
60
56
 
61
 
#define SK_OVERDRAW_LIMIT       5
 
57
#define SK_OVERDRAW_LIMIT   5
62
58
 
63
 
typedef struct SK_Overdraw
64
 
{
 
59
typedef struct SK_Overdraw {
65
60
        SK_Stroke *target;
66
 
        int     start, end;
 
61
        int start, end;
67
62
        int count;
68
63
} SK_Overdraw;
69
64
 
70
65
#define SK_Stroke_BUFFER_INIT_SIZE 20
71
66
 
72
 
typedef struct SK_DrawData
73
 
{
 
67
typedef struct SK_DrawData {
74
68
        int mval[2];
75
69
        int previous_mval[2];
76
70
        SK_PType type;
77
71
} SK_DrawData;
78
72
 
79
 
typedef struct SK_Intersection
80
 
{
 
73
typedef struct SK_Intersection {
81
74
        struct SK_Intersection *next, *prev;
82
75
        SK_Stroke *stroke;
83
 
        int                     before;
84
 
        int                     after;
85
 
        int                     gesture_index;
86
 
        float           p[3];
87
 
        float           lambda; /* used for sorting intersection points */
 
76
        int        before;
 
77
        int        after;
 
78
        int        gesture_index;
 
79
        float      p[3];
 
80
        float      lambda;       /* used for sorting intersection points */
88
81
} SK_Intersection;
89
82
 
90
 
typedef struct SK_Sketch
91
 
{
92
 
        ListBase        strokes;
93
 
        ListBase        depth_peels;
94
 
        SK_Stroke       *active_stroke;
95
 
        SK_Stroke       *gesture;
96
 
        SK_Point        next_point;
 
83
typedef struct SK_Sketch {
 
84
        ListBase   strokes;
 
85
        ListBase   depth_peels;
 
86
        SK_Stroke *active_stroke;
 
87
        SK_Stroke *gesture;
 
88
        SK_Point   next_point;
97
89
        SK_Overdraw over;
98
90
} SK_Sketch;
99
91
 
100
92
 
101
93
typedef struct SK_Gesture {
102
 
        SK_Stroke       *stk;
103
 
        SK_Stroke       *segments;
104
 
 
105
 
        ListBase        intersections;
106
 
        ListBase        self_intersections;
107
 
 
108
 
        int                     nb_self_intersections;
109
 
        int                     nb_intersections;
110
 
        int                     nb_segments;
 
94
        SK_Stroke   *stk;
 
95
        SK_Stroke   *segments;
 
96
 
 
97
        ListBase     intersections;
 
98
        ListBase     self_intersections;
 
99
 
 
100
        int          nb_self_intersections;
 
101
        int          nb_intersections;
 
102
        int          nb_segments;
111
103
} SK_Gesture;
112
104
 
113
105
 
114
106
/************************************************/
115
107
 
116
108
void freeSketch(SK_Sketch *sketch);
117
 
SK_Sketch* createSketch(void);
 
109
SK_Sketch *createSketch(void);
118
110
 
119
111
void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk);
120
112
 
121
113
void sk_freeStroke(SK_Stroke *stk);
122
 
SK_Stroke* sk_createStroke(void);
 
114
SK_Stroke *sk_createStroke(void);
123
115
 
124
116
SK_Point *sk_lastStrokePoint(SK_Stroke *stk);
125
117
 
134
126
void sk_insertStrokePoints(SK_Stroke *stk, SK_Point *pts, int len, int start, int end);
135
127
 
136
128
void sk_trimStroke(SK_Stroke *stk, int start, int end);
137
 
void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], float p_end[3]);
 
129
void sk_straightenStroke(SK_Stroke * stk, int start, int end, float p_start[3], float p_end[3]);
138
130
void sk_polygonizeStroke(SK_Stroke *stk, int start, int end);
139
131
void sk_flattenStroke(SK_Stroke *stk, int start, int end);
140
132
void sk_reverseStroke(SK_Stroke *stk);