Blender V2.61 - r43446
Classes | Functions

curve.c File Reference

#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "BLI_bpath.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "DNA_curve_types.h"
#include "DNA_material_types.h"
#include "DNA_key_types.h"
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
#include "DNA_object_types.h"
#include "BKE_animsys.h"
#include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_font.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_material.h"

Go to the source code of this file.

Classes

struct  bevelsort

Functions

static int cu_isectLL (float *v1, float *v2, float *v3, float *v4, short cox, short coy, float *labda, float *mu, float *vec)
void unlink_curve (Curve *cu)
void BKE_free_editfont (Curve *cu)
void free_curve_editNurb_keyIndex (EditNurb *editnurb)
void free_curve_editNurb (Curve *cu)
void free_curve (Curve *cu)
Curveadd_curve (const char *name, int type)
Curvecopy_curve (Curve *cu)
static void extern_local_curve (Curve *cu)
void make_local_curve (Curve *cu)
ListBasecurve_editnurbs (Curve *cu)
short curve_type (Curve *cu)
void update_curve_dimension (Curve *cu)
void test_curve_type (Object *ob)
void tex_space_curve (Curve *cu)
int count_curveverts (ListBase *nurb)
int count_curveverts_without_handles (ListBase *nurb)
void freeNurb (Nurb *nu)
void freeNurblist (ListBase *lb)
NurbduplicateNurb (Nurb *nu)
void duplicateNurblist (ListBase *lb1, ListBase *lb2)
void test2DNurb (Nurb *nu)
void minmaxNurb (Nurb *nu, float *min, float *max)
void addNurbPoints (Nurb *nu, int number)
void addNurbPointsBezier (Nurb *nu, int number)
static void calcknots (float *knots, const short pnts, const short order, const short flag)
static void makecyclicknots (float *knots, short pnts, short order)
static void makeknots (Nurb *nu, short uv)
void nurbs_knot_calc_u (Nurb *nu)
void nurbs_knot_calc_v (Nurb *nu)
static void basisNurb (float t, short order, short pnts, float *knots, float *basis, int *start, int *end)
void makeNurbfaces (Nurb *nu, float *coord_array, int rowstride, int resolu, int resolv)
void makeNurbcurve (Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride)
void forward_diff_bezier (float q0, float q1, float q2, float q3, float *p, int it, int stride)
static void forward_diff_bezier_cotangent (float *p0, float *p1, float *p2, float *p3, float *p, int it, int stride)
float * make_orco_surf (Object *ob)
float * make_orco_curve (Scene *scene, Object *ob)
void makebevelcurve (Scene *scene, Object *ob, ListBase *disp, int forRender)
static short bevelinside (BevList *bl1, BevList *bl2)
static int vergxcobev (const void *a1, const void *a2)
static void calc_bevel_sin_cos (float x1, float y1, float x2, float y2, float *sina, float *cosa)
static void alfa_bezpart (BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride)
static void bevel_list_cyclic_fix_3D (BevList *bl)
static void bevel_list_calc_bisect (BevList *bl)
static void bevel_list_flip_tangents (BevList *bl)
static void bevel_list_apply_tilt (BevList *bl)
static void bevel_list_smooth (BevList *bl, int smooth_iter)
static void make_bevel_list_3D_zup (BevList *bl)
static void make_bevel_list_3D_minimum_twist (BevList *bl)
static void make_bevel_list_3D_tangent (BevList *bl)
static void make_bevel_list_3D (BevList *bl, int smooth_iter, int twist_mode)
static void make_bevel_list_segment_3D (BevList *bl)
void makeBevelList (Object *ob)
void calchandleNurb (BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
void calchandlesNurb (Nurb *nu)
void testhandlesNurb (Nurb *nu)
void autocalchandlesNurb (Nurb *nu, int flag)
void autocalchandlesNurb_all (ListBase *editnurb, int flag)
void sethandlesNurb (ListBase *editnurb, short code)
static void swapdata (void *adr1, void *adr2, int len)
void switchdirectionNurb (Nurb *nu)
float(* curve_getVertexCos (Curve *UNUSED(cu), ListBase *lb, int *numVerts_r))[3]
void curve_applyVertexCos (Curve *UNUSED(cu), ListBase *lb, float(*vertexCos)[3])
float(* curve_getKeyVertexCos (Curve *UNUSED(cu), ListBase *lb, float *key))[3]
void curve_applyKeyVertexTilts (Curve *UNUSED(cu), ListBase *lb, float *key)
int check_valid_nurb_u (struct Nurb *nu)
int check_valid_nurb_v (struct Nurb *nu)
int clamp_nurb_order_u (struct Nurb *nu)
int clamp_nurb_order_v (struct Nurb *nu)
ListBaseBKE_curve_nurbs (Curve *cu)
int minmax_curve (Curve *cu, float min[3], float max[3])
int curve_center_median (Curve *cu, float cent[3])
int curve_center_bounds (Curve *cu, float cent[3])
void curve_translate (Curve *cu, float offset[3], int do_keys)
void curve_delete_material_index (Curve *cu, int index)

Detailed Description

Definition in file curve.c.


Function Documentation

Curve* add_curve ( const char *  name,
int  type 
) [read]
void addNurbPoints ( Nurb nu,
int  number 
)

Definition at line 591 of file curve.c.

References Nurb::bp, i, MEM_freeN(), MEM_mallocN(), Nurb::pntsu, and BPoint::radius.

void addNurbPointsBezier ( Nurb nu,
int  number 
)

Definition at line 611 of file curve.c.

References Nurb::bezt, i, MEM_freeN(), MEM_mallocN(), Nurb::pntsu, and BezTriple::radius.

static void alfa_bezpart ( BezTriple prevbezt,
BezTriple bezt,
Nurb nu,
float *  tilt_array,
float *  radius_array,
float *  weight_array,
int  resolu,
int  stride 
) [static]
void autocalchandlesNurb ( Nurb nu,
int  flag 
)
void autocalchandlesNurb_all ( ListBase editnurb,
int  flag 
)

Definition at line 2814 of file curve.c.

References autocalchandlesNurb(), ListBase::first, and Nurb::next.

static void basisNurb ( float  t,
short  order,
short  pnts,
float *  knots,
float *  basis,
int *  start,
int *  end 
) [static]

Definition at line 748 of file curve.c.

References simple_enum_gen::d, credits_svn_gen::e, and i.

Referenced by makeNurbcurve(), and makeNurbfaces().

static void bevel_list_apply_tilt ( BevList bl) [static]
static void bevel_list_calc_bisect ( BevList bl) [static]
static void bevel_list_cyclic_fix_3D ( BevList bl) [static]
static void bevel_list_flip_tangents ( BevList bl) [static]

Definition at line 1753 of file curve.c.

References angle_v2v2(), negate_v3(), BevList::nr, RAD2DEGF, and BevPoint::tan.

Referenced by make_bevel_list_3D_tangent().

static void bevel_list_smooth ( BevList bl,
int  smooth_iter 
) [static]
static short bevelinside ( BevList bl1,
BevList bl2 
) [static]

Definition at line 1538 of file curve.c.

References copy_v3_v3(), cu_isectLL(), max, min, BevList::nr, and BevPoint::vec.

Referenced by makeBevelList().

ListBase* BKE_curve_nurbs ( Curve cu)
void BKE_free_editfont ( Curve cu)
static void calc_bevel_sin_cos ( float  x1,
float  y1,
float  x2,
float  y2,
float *  sina,
float *  cosa 
) [static]

Definition at line 1608 of file curve.c.

References fabs(), M_PI, saacos(), sin(), and sqrt().

Referenced by makeBevelList().

void calchandleNurb ( BezTriple bezt,
BezTriple prev,
BezTriple next,
int  mode 
)
void calchandlesNurb ( Nurb nu)
static void calcknots ( float *  knots,
const short  pnts,
const short  order,
const short  flag 
) [static]

Definition at line 634 of file curve.c.

References CU_NURB_BEZIER, CU_NURB_ENDPOINT, and floorf.

Referenced by makeknots().

int check_valid_nurb_u ( struct Nurb nu)
int check_valid_nurb_v ( struct Nurb nu)
int clamp_nurb_order_u ( struct Nurb nu)
int clamp_nurb_order_v ( struct Nurb nu)

Definition at line 3186 of file curve.c.

References CLAMP(), CU_NURB_BEZIER, CU_NURB_CYCLIC, Nurb::flagv, Nurb::orderv, and Nurb::pntsv.

Referenced by adduplicateflagNurb(), and deleteflagNurb().

Curve* copy_curve ( Curve cu) [read]
int count_curveverts ( ListBase nurb)
int count_curveverts_without_handles ( ListBase nurb)

Definition at line 428 of file curve.c.

References Nurb::bezt, Nurb::bp, ListBase::first, Nurb::next, Nurb::pntsu, and Nurb::pntsv.

static int cu_isectLL ( float *  v1,
float *  v2,
float *  v3,
float *  v4,
short  cox,
short  coy,
float *  labda,
float *  mu,
float *  vec 
) [static]

Definition at line 1504 of file curve.c.

References cox, and coy.

Referenced by bevelinside().

void curve_applyKeyVertexTilts ( Curve UNUSEDcu,
ListBase lb,
float *  key 
)
void curve_applyVertexCos ( Curve UNUSEDcu,
ListBase lb,
float(*)  vertexCos[3] 
)
int curve_center_bounds ( Curve cu,
float  cent[3] 
)

Definition at line 3259 of file curve.c.

References INIT_MINMAX, max, mid_v3_v3v3(), min, and minmax_curve().

Referenced by object_origin_set_exec().

int curve_center_median ( Curve cu,
float  cent[3] 
)
void curve_delete_material_index ( Curve cu,
int  index 
)
ListBase* curve_editnurbs ( Curve cu) [read]
float(* curve_getKeyVertexCos ( Curve UNUSEDcu,
ListBase lb,
float *  key 
) )[3]
float(* curve_getVertexCos ( Curve UNUSEDcu,
ListBase lb,
int *  numVerts_r 
) )[3]
void curve_translate ( Curve cu,
float  offset[3],
int  do_keys 
)
short curve_type ( Curve cu)
Nurb* duplicateNurb ( Nurb nu) [read]
void duplicateNurblist ( ListBase lb1,
ListBase lb2 
)

Definition at line 520 of file curve.c.

References BLI_addtail(), duplicateNurb(), ListBase::first, freeNurblist(), and Nurb::next.

Referenced by copy_curve().

static void extern_local_curve ( Curve cu) [static]
void forward_diff_bezier ( float  q0,
float  q1,
float  q2,
float  q3,
float *  p,
int  it,
int  stride 
)
static void forward_diff_bezier_cotangent ( float *  p0,
float *  p1,
float *  p2,
float *  p3,
float *  p,
int  it,
int  stride 
) [static]

Definition at line 1103 of file curve.c.

References i, and normalize_v3().

Referenced by makeBevelList().

void free_curve ( Curve cu)
void free_curve_editNurb ( Curve cu)
void free_curve_editNurb_keyIndex ( EditNurb editnurb)

Definition at line 115 of file curve.c.

References BLI_ghash_free(), EditNurb::keyindex, MEM_freeN(), and NULL.

Referenced by free_curve_editNurb(), make_editNurb(), and separate_exec().

void freeNurb ( Nurb nu)
void freeNurblist ( ListBase lb)
static void make_bevel_list_3D ( BevList bl,
int  smooth_iter,
int  twist_mode 
) [static]
static void make_bevel_list_3D_minimum_twist ( BevList bl) [static]
static void make_bevel_list_3D_tangent ( BevList bl) [static]
static void make_bevel_list_3D_zup ( BevList bl) [static]
static void make_bevel_list_segment_3D ( BevList bl) [static]
void make_local_curve ( Curve cu)
float* make_orco_curve ( Scene scene,
Object ob 
)
float* make_orco_surf ( Object ob)
void makebevelcurve ( Scene scene,
Object ob,
ListBase disp,
int  forRender 
)
void makeBevelList ( Object ob)
static void makecyclicknots ( float *  knots,
short  pnts,
short  order 
) [static]

Definition at line 678 of file curve.c.

References NULL.

Referenced by makeknots().

static void makeknots ( Nurb nu,
short  uv 
) [static]
void makeNurbcurve ( Nurb nu,
float *  coord_array,
float *  tilt_array,
float *  radius_array,
float *  weight_array,
int  resolu,
int  stride 
)
void makeNurbfaces ( Nurb nu,
float *  coord_array,
int  rowstride,
int  resolu,
int  resolv 
)
int minmax_curve ( Curve cu,
float  min[3],
float  max[3] 
)

Definition at line 3212 of file curve.c.

References BKE_curve_nurbs(), ListBase::first, minmaxNurb(), Nurb::next, and NULL.

Referenced by curve_center_bounds().

void minmaxNurb ( Nurb nu,
float *  min,
float *  max 
)

Definition at line 564 of file curve.c.

References Nurb::bezt, Nurb::bp, CU_BEZIER, DO_MINMAX, Nurb::pntsu, Nurb::pntsv, Nurb::type, BezTriple::vec, and BPoint::vec.

Referenced by minmax_curve().

void nurbs_knot_calc_u ( Nurb nu)
void nurbs_knot_calc_v ( Nurb nu)
void sethandlesNurb ( ListBase editnurb,
short  code 
)
static void swapdata ( void *  adr1,
void *  adr2,
int  len 
) [static]

Definition at line 2903 of file curve.c.

References MEM_freeN(), and MEM_mallocN().

Referenced by switchdirectionNurb().

void switchdirectionNurb ( Nurb nu)
void test2DNurb ( Nurb nu)
void test_curve_type ( Object ob)

Definition at line 348 of file curve.c.

References curve_type(), Object::data, OB_CURVE, Object::type, and update_curve_dimension().

void testhandlesNurb ( Nurb nu)
void tex_space_curve ( Curve cu)
void unlink_curve ( Curve cu)
void update_curve_dimension ( Curve cu)
static int vergxcobev ( const void *  a1,
const void *  a2 
) [static]

Definition at line 1597 of file curve.c.

References bevelsort::left.

Referenced by makeBevelList().