Blender  V3.3
DNA_curve_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 #include "DNA_defs.h"
12 #include "DNA_listBase.h"
13 #include "DNA_vec_types.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #define MAXTEXTBOX 256 /* used in readfile.c and editfont.c */
20 
21 struct AnimData;
22 struct Curves;
23 struct CurveProfile;
24 struct EditFont;
25 struct GHash;
26 struct Ipo;
27 struct Key;
28 struct Material;
29 struct Object;
30 struct VFont;
31 
32 /* These two Lines with # tell makesdna this struct can be excluded. */
33 #
34 #
35 typedef struct BevPoint {
36  float vec[3], tilt, radius, weight, offset;
38  float sina, cosa;
40  float dir[3], tan[3], quat[4];
41  short dupe_tag;
43 
44 /* These two Lines with # tell makesdna this struct can be excluded. */
45 #
46 #
47 typedef struct BevList {
48  struct BevList *next, *prev;
49  int nr, dupe_nr;
50  int poly, hole;
51  int charidx;
53  float *seglen;
56 
74 typedef struct BezTriple {
75  float vec[3][3];
77  float tilt;
79  float weight;
81  float radius;
82 
84  char ipo;
85 
90 
93  char hide;
94 
96  char easing;
98  float back;
101 
104  char _pad[3];
106 
110 typedef struct BPoint {
111  float vec[4];
113  float tilt;
115  float weight;
118  char _pad1[1];
119  short hide;
121  float radius;
122  char _pad[4];
124 
129 typedef struct Nurb {
131 
132 
133  struct Nurb *next, *prev;
134  short type;
136  short mat_nr;
137  short hide, flag;
139  int pntsu, pntsv;
140  char _pad[4];
142  short resolu, resolv;
143  short orderu, orderv;
144  short flagu, flagv;
145 
146  float *knotsu, *knotsv;
149 
151  short tilt_interp;
153 
154  /* only used for dynamically generated Nurbs created from OB_FONT's */
155  int charidx;
157 
158 typedef struct CharInfo {
159  short kern;
161  short mat_nr;
162  char flag;
163  char _pad[3];
165 
166 typedef struct TextBox {
167  float x, y, w, h;
169 
170 /* These two Lines with # tell makesdna this struct can be excluded. */
171 #
172 #
173 typedef struct EditNurb {
175 
176  /* base of nurbs' list (old Curve->editnurb) */
177  ListBase nurbs;
178 
179  /* index data for shape keys */
180  struct GHash *keyindex;
181 
182  /* shape key being edited */
183  int shapenr;
184 
189  char needs_flush_to_id;
190 
192 
193 typedef struct Curve {
195 
196  ID id;
198  struct AnimData *adt;
199 
201  ListBase nurb;
202 
204  EditNurb *editnurb;
205 
206  struct Object *bevobj, *taperobj, *textoncurve;
208  struct Ipo *ipo DNA_DEPRECATED;
209  struct Key *key;
210  struct Material **mat;
211 
212  struct CurveProfile *bevel_profile;
213 
214  /* texture space, copied as one block in editobject.c */
215  float loc[3];
216  float size[3];
217 
219  short type;
220 
221  char texflag;
222  char _pad0[7];
223  short twist_mode;
224  float twist_smooth, smallcaps_scale;
225 
226  int pathlen;
227  short bevresol, totcol;
228  int flag;
229  float offset, extrude, bevel_radius;
230 
231  /* default */
232  short resolu, resolv;
233  short resolu_ren, resolv_ren;
234 
235  /* edit, index in nurb list */
236  int actnu;
237  /* edit, index in active nurb (BPoint or BezTriple) */
238  int actvert;
239 
240  char overflow;
241  char spacemode, align_y;
242  char bevel_mode;
247  char taper_radius_mode;
248  char _pad;
249 
250  /* font part */
251  short lines;
252  float spacing, linedist, shear, fsize, wordspace, ulpos, ulheight;
253  float xof, yof;
254  float linewidth;
255 
256  /* copy of EditFont vars (wchar_t aligned),
257  * warning! don't use in editmode (storage only) */
258  int pos;
259  int selstart, selend;
260 
261  /* text data */
266  int len_char32;
268  int len;
269  char *str;
270  struct EditFont *editfont;
271 
272  char family[64];
273  struct VFont *vfont;
274  struct VFont *vfontb;
275  struct VFont *vfonti;
276  struct VFont *vfontbi;
277 
278  struct TextBox *tb;
279  int totbox, actbox;
280 
281  struct CharInfo *strinfo;
282  struct CharInfo curinfo;
283  /* font part end */
284 
286  float ctime;
287  float bevfac1, bevfac2;
288  char bevfac1_mapping, bevfac2_mapping;
289 
290  char _pad2[6];
291  float fsize_realtime;
292 
300  const struct Curves *curve_eval;
306  char edit_data_from_original;
307  char _pad3[7];
308 
309  void *batch_cache;
310 } Curve;
311 
312 #define CURVE_VFONT_ANY(cu) ((cu)->vfont), ((cu)->vfontb), ((cu)->vfonti), ((cu)->vfontbi)
313 
314 /* **************** CURVE ********************* */
315 
317 enum {
320 };
321 
323 enum {
324  CU_3D = 1 << 0,
325  CU_FRONT = 1 << 1,
326  CU_BACK = 1 << 2,
327  CU_PATH = 1 << 3,
328  CU_FOLLOW = 1 << 4,
329  CU_PATH_CLAMP = 1 << 5,
331  CU_STRETCH = 1 << 7,
332  /* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */
333  CU_FAST = 1 << 9, /* Font: no filling inside editmode */
334  /* CU_RETOPO = 1 << 10, */ /* DEPRECATED */
335  CU_DS_EXPAND = 1 << 11,
337  CU_PATH_RADIUS = 1 << 12,
338  /* CU_DEFORM_FILL = 1 << 13, */ /* DEPRECATED */
340  CU_FILL_CAPS = 1 << 14,
342  CU_MAP_TAPER = 1 << 15,
343 };
344 
346 enum {
348  /* CU_TWIST_Y_UP = 1, */ /* not used yet */
349  /* CU_TWIST_X_UP = 2, */
352 };
353 
354 /* Curve.bevfac1_mapping, Curve.bevfac2_mapping, bevel factor mapping */
355 enum {
359 };
360 
362 enum {
368 };
369 
371 enum {
377 };
378 
380 enum {
384 };
385 
387 enum {
394 };
395 
396 /* Curve.overflow. */
397 enum {
401 };
402 
404 enum {
405  CU_SMOOTH = 1 << 0,
406 };
407 
409 enum {
410  CU_POLY = 0,
412  CU_NURBS = 4,
414 
415  /* only for adding */
416  CU_PRIMITIVE = 0xF00,
417 
418  /* 2 or 4 points */
419  CU_PRIM_CURVE = 0x100,
420  /* 8 points circle */
421  CU_PRIM_CIRCLE = 0x200,
422  /* 4x4 patch Nurb */
423  CU_PRIM_PATCH = 0x300,
424  CU_PRIM_TUBE = 0x400,
425  CU_PRIM_SPHERE = 0x500,
426  CU_PRIM_DONUT = 0x600,
427  /* 5 points, 5th order straight line (for anim path) */
428  CU_PRIM_PATH = 0x700,
429 };
430 
431 /* Nurb.flagu, Nurb.flagv */
432 enum {
433  CU_NURB_CYCLIC = 1 << 0,
435  CU_NURB_BEZIER = 1 << 2,
436 };
437 
438 #define CU_ACT_NONE -1
439 
440 /* *************** BEZTRIPLE **************** */
441 
442 /* BezTriple.f1,2,3 */
443 typedef enum eBezTriple_Flag {
444  /* SELECT */
445  BEZT_FLAG_TEMP_TAG = (1 << 1), /* always clear. */
446  /* Can be used to ignore keyframe points for certain operations. */
449 
450 /* h1 h2 (beztriple) */
451 typedef enum eBezTriple_Handle {
452  HD_FREE = 0,
453  HD_AUTO = 1,
454  HD_VECT = 2,
455  HD_ALIGN = 3,
456  HD_AUTO_ANIM = 4, /* auto-clamped handles for animation */
457  HD_ALIGN_DOUBLESIDE = 5, /* align handles, displayed both of them. used for masks */
459 
460 /* auto_handle_type (beztriple) */
461 typedef enum eBezTriple_Auto_Type {
462  /* Normal automatic handle that can be refined further. */
464  /* Handle locked horizontal due to being an Auto Clamped local
465  * extreme or a curve endpoint with Constant extrapolation.
466  * Further smoothing is disabled. */
469 
470 /* interpolation modes (used only for BezTriple->ipo) */
472  /* traditional interpolation */
473  BEZT_IPO_CONST = 0, /* constant interpolation */
474  BEZT_IPO_LIN = 1, /* linear interpolation */
475  BEZT_IPO_BEZ = 2, /* bezier interpolation */
476 
477  /* easing equations */
489 
490 /* easing modes (used only for Keyframes - BezTriple->easing) */
491 typedef enum eBezTriple_Easing {
493 
498 
499 /* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
501  BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */
502  BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */
503  BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */
504  BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */
505  BEZT_KEYTYPE_MOVEHOLD = 4, /* one end of a 'moving hold' */
507 
508 /* checks if the given BezTriple is selected */
509 #define BEZT_ISSEL_ANY(bezt) \
510  (((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT))
511 #define BEZT_ISSEL_ALL(bezt) \
512  (((bezt)->f2 & SELECT) && ((bezt)->f1 & SELECT) && ((bezt)->f3 & SELECT))
513 #define BEZT_ISSEL_ALL_HIDDENHANDLES(v3d, bezt) \
514  ((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
515  (bezt)->f2 & SELECT : \
516  BEZT_ISSEL_ALL(bezt))
517 #define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) \
518  ((((v3d) != NULL) && ((v3d)->overlay.handle_display == CURVE_HANDLE_NONE)) ? \
519  (bezt)->f2 & SELECT : \
520  BEZT_ISSEL_ANY(bezt))
521 
522 #define BEZT_ISSEL_IDX(bezt, i) \
523  ((i == 0 && (bezt)->f1 & SELECT) || (i == 1 && (bezt)->f2 & SELECT) || \
524  (i == 2 && (bezt)->f3 & SELECT))
525 
526 #define BEZT_SEL_ALL(bezt) \
527  { \
528  (bezt)->f1 |= SELECT; \
529  (bezt)->f2 |= SELECT; \
530  (bezt)->f3 |= SELECT; \
531  } \
532  ((void)0)
533 #define BEZT_DESEL_ALL(bezt) \
534  { \
535  (bezt)->f1 &= ~SELECT; \
536  (bezt)->f2 &= ~SELECT; \
537  (bezt)->f3 &= ~SELECT; \
538  } \
539  ((void)0)
540 #define BEZT_SEL_INVERT(bezt) \
541  { \
542  (bezt)->f1 ^= SELECT; \
543  (bezt)->f2 ^= SELECT; \
544  (bezt)->f3 ^= SELECT; \
545  } \
546  ((void)0)
547 
548 #define BEZT_SEL_IDX(bezt, i) \
549  { \
550  switch (i) { \
551  case 0: \
552  (bezt)->f1 |= SELECT; \
553  break; \
554  case 1: \
555  (bezt)->f2 |= SELECT; \
556  break; \
557  case 2: \
558  (bezt)->f3 |= SELECT; \
559  break; \
560  default: \
561  break; \
562  } \
563  } \
564  ((void)0)
565 
566 #define BEZT_DESEL_IDX(bezt, i) \
567  { \
568  switch (i) { \
569  case 0: \
570  (bezt)->f1 &= ~SELECT; \
571  break; \
572  case 1: \
573  (bezt)->f2 &= ~SELECT; \
574  break; \
575  case 2: \
576  (bezt)->f3 &= ~SELECT; \
577  break; \
578  default: \
579  break; \
580  } \
581  } \
582  ((void)0)
583 
584 #define BEZT_IS_AUTOH(bezt) \
585  (ELEM((bezt)->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM((bezt)->h2, HD_AUTO, HD_AUTO_ANIM))
586 
587 /* *************** CHARINFO **************** */
588 
590 enum {
591  /* NOTE: CU_CHINFO_WRAP, CU_CHINFO_SMALLCAPS_TEST and CU_CHINFO_TRUNCATE are set dynamically. */
592  CU_CHINFO_BOLD = 1 << 0,
596  CU_CHINFO_WRAP = 1 << 3,
602 };
603 
604 /* mixed with KEY_LINEAR but define here since only curve supports */
605 #define KEY_CU_EASE 3
606 
607 /* indicates point has been seen during surface duplication */
608 #define SURF_SEEN 4
609 
610 #ifdef __cplusplus
611 }
612 #endif
ID and Library types, which are fundamental for sdna.
@ CU_BEV_MODE_OBJECT
@ CU_BEV_MODE_ROUND
@ CU_BEV_MODE_CURVE_PROFILE
@ CU_PRIM_SPHERE
@ CU_PRIM_CURVE
@ CU_BEZIER
@ CU_PRIMITIVE
@ CU_TYPE
@ CU_POLY
@ CU_PRIM_DONUT
@ CU_PRIM_TUBE
@ CU_PRIM_CIRCLE
@ CU_NURBS
@ CU_PRIM_PATCH
@ CU_PRIM_PATH
@ CU_AUTOSPACE
@ CU_AUTOSPACE_EVALUATED
struct BevList BevList
struct CharInfo CharInfo
struct BevPoint BevPoint
@ CU_ALIGN_X_FLUSH
@ CU_ALIGN_X_MIDDLE
@ CU_ALIGN_X_LEFT
@ CU_ALIGN_X_JUSTIFY
@ CU_ALIGN_X_RIGHT
@ CU_SMOOTH
struct BPoint BPoint
@ CU_BEVFAC_MAP_SPLINE
@ CU_BEVFAC_MAP_RESOLU
@ CU_BEVFAC_MAP_SEGMENT
@ CU_NURB_CYCLIC
@ CU_NURB_ENDPOINT
@ CU_NURB_BEZIER
@ CU_TAPER_RADIUS_OVERRIDE
@ CU_TAPER_RADIUS_MULTIPLY
@ CU_TAPER_RADIUS_ADD
@ CU_ALIGN_Y_TOP
@ CU_ALIGN_Y_BOTTOM_BASELINE
@ CU_ALIGN_Y_CENTER
@ CU_ALIGN_Y_BOTTOM
@ CU_ALIGN_Y_TOP_BASELINE
eBezTriple_Handle
@ HD_AUTO_ANIM
@ HD_VECT
@ HD_FREE
@ HD_AUTO
@ HD_ALIGN_DOUBLESIDE
@ HD_ALIGN
@ CU_CHINFO_WRAP
@ CU_CHINFO_UNDERLINE
@ CU_CHINFO_BOLD
@ CU_CHINFO_ITALIC
@ CU_CHINFO_SMALLCAPS_CHECK
@ CU_CHINFO_SMALLCAPS
@ CU_CHINFO_OVERFLOW
eBezTriple_Auto_Type
@ HD_AUTOTYPE_NORMAL
@ HD_AUTOTYPE_LOCKED_FINAL
struct TextBox TextBox
struct BezTriple BezTriple
@ CU_TWIST_MINIMUM
@ CU_TWIST_TANGENT
@ CU_TWIST_Z_UP
eBezTriple_Interpolation
@ BEZT_IPO_ELASTIC
@ BEZT_IPO_CIRC
@ BEZT_IPO_QUART
@ BEZT_IPO_BACK
@ BEZT_IPO_BOUNCE
@ BEZT_IPO_CUBIC
@ BEZT_IPO_EXPO
@ BEZT_IPO_CONST
@ BEZT_IPO_BEZ
@ BEZT_IPO_LIN
@ BEZT_IPO_SINE
@ BEZT_IPO_QUAD
@ BEZT_IPO_QUINT
eBezTriple_Easing
@ BEZT_IPO_EASE_OUT
@ BEZT_IPO_EASE_AUTO
@ BEZT_IPO_EASE_IN
@ BEZT_IPO_EASE_IN_OUT
@ CU_OVERFLOW_SCALE
@ CU_OVERFLOW_TRUNCATE
@ CU_OVERFLOW_NONE
eBezTriple_Flag
@ BEZT_FLAG_TEMP_TAG
@ BEZT_FLAG_IGNORE_TAG
@ CU_FILL_CAPS
@ CU_FAST
@ CU_3D
@ CU_FRONT
@ CU_FOLLOW
@ CU_PATH
@ CU_STRETCH
@ CU_DS_EXPAND
@ CU_PATH_RADIUS
@ CU_PATH_CLAMP
@ CU_MAP_TAPER
@ CU_BACK
@ CU_DEFORM_BOUNDS_OFF
eBezTriple_KeyframeType
@ BEZT_KEYTYPE_EXTREME
@ BEZT_KEYTYPE_JITTER
@ BEZT_KEYTYPE_BREAKDOWN
@ BEZT_KEYTYPE_MOVEHOLD
@ BEZT_KEYTYPE_KEYFRAME
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition: DNA_defs.h:64
#define DNA_DEPRECATED
Definition: DNA_defs.h:21
These structs are the foundation for all linked lists in the library system.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
int len
Definition: draw_manager.c:108
#define str(s)
uint pos
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
unsigned char uint8_t
Definition: stdint.h:78
short hide
char _pad1[1]
char _pad[4]
float weight
uint8_t f1
float vec[4]
float radius
float tilt
struct BevList * next
float * seglen
BevPoint * bevpoints
int * segbevcount
struct BevList * prev
short dupe_tag
float offset
float radius
float dir[3]
float tan[3]
float quat[4]
float weight
float vec[3]
char auto_handle_type
uint8_t h1
uint8_t f3
float vec[3][3]
uint8_t f1
char _pad[3]
uint8_t f2
uint8_t h2
Definition: DNA_ID.h:368
short flagu
short orderu
struct Nurb * next
short orderv
float * knotsu
int charidx
short flag
short tilt_interp
short type
float * knotsv
BezTriple * bezt
BPoint * bp
short resolu
struct Nurb * prev
char _pad[4]
short resolv
short radius_interp
short hide
short flagv
short mat_nr