Blender V2.61 - r43446
Classes | Typedefs | Functions

BKE_mball.h File Reference

Go to the source code of this file.

Classes

struct  point
struct  vertex
struct  vertices
struct  corner
struct  cube
struct  cubes
struct  centerlist
struct  edgelist
struct  intlist
struct  intlists
struct  process
struct  ml_pointer
struct  octal_node
struct  octal_tree
struct  pgn_elements

Typedefs

typedef struct point MB_POINT
typedef struct vertex VERTEX
typedef struct vertices VERTICES
typedef struct corner CORNER
typedef struct cube CUBE
typedef struct cubes CUBES
typedef struct centerlist CENTERLIST
typedef struct edgelist EDGELIST
typedef struct intlist INTLIST
typedef struct intlists INTLISTS
typedef struct process PROCESS
typedef struct ml_pointer ml_pointer
typedef struct octal_node octal_node
typedef struct octal_tree octal_tree

Functions

octal_nodefind_metaball_octal_node (octal_node *node, float x, float y, float z, short depth)
void freepolygonize (PROCESS *p)
void docube (CUBE *cube, PROCESS *p, struct MetaBall *mb)
void testface (int i, int j, int k, CUBE *old, int bit, int c1, int c2, int c3, int c4, PROCESS *p)
CORNERsetcorner (PROCESS *p, int i, int j, int k)
int vertid (CORNER *c1, CORNER *c2, PROCESS *p, struct MetaBall *mb)
int setcenter (CENTERLIST *table[], int i, int j, int k)
int otherface (int edge, int face)
void makecubetable (void)
void setedge (EDGELIST *table[], int i1, int j1, int k1, int i2, int j2, int k2, int vid)
int getedge (EDGELIST *table[], int i1, int j1, int k1, int i2, int j2, int k2)
void addtovertices (VERTICES *vertices, VERTEX v)
void vnormal (MB_POINT *point, PROCESS *p, MB_POINT *v)
void converge (MB_POINT *p1, MB_POINT *p2, float v1, float v2, float(*function)(float, float, float), MB_POINT *p, struct MetaBall *mb, int f)
void add_cube (PROCESS *mbproc, int i, int j, int k, int count)
void find_first_points (PROCESS *mbproc, struct MetaBall *mb, int a)
void fill_metaball_octal_node (octal_node *node, struct MetaElem *ml, short i)
void subdivide_metaball_octal_node (octal_node *node, float size_x, float size_y, float size_z, short depth)
void free_metaball_octal_node (octal_node *node)
void init_metaball_octal_tree (int depth)
void polygonize (PROCESS *mbproc, struct MetaBall *mb)
float init_meta (struct Scene *scene, struct Object *ob)
void unlink_mball (struct MetaBall *mb)
void free_mball (struct MetaBall *mb)
struct MetaBalladd_mball (const char *name)
struct MetaBallcopy_mball (struct MetaBall *mb)
void make_local_mball (struct MetaBall *mb)
struct MetaElemadd_metaball_element (struct MetaBall *mb, const int type)
void tex_space_mball (struct Object *ob)
float * make_orco_mball (struct Object *ob, struct ListBase *dispbase)
void copy_mball_properties (struct Scene *scene, struct Object *active_object)
struct Objectfind_basis_mball (struct Scene *scene, struct Object *ob)
 This function finds basic MetaBall.
int is_basis_mball (struct Object *ob)
 Test, if Object *ob is basic MetaBall.
int is_mball_basis_for (struct Object *ob1, struct Object *ob2)
void metaball_polygonize (struct Scene *scene, struct Object *ob, struct ListBase *dispbase)
void calc_mballco (struct MetaElem *ml, float *vec)
float densfunc (struct MetaElem *ball, float x, float y, float z)
float metaball (float x, float y, float z)
void accum_mballfaces (int i1, int i2, int i3, int i4)
void * new_pgn_element (int size)
int nextcwedge (int edge, int face)
void BKE_freecubetable (void)

Detailed Description

Since:
March 2001
Author:
nzc

Definition in file BKE_mball.h.


Typedef Documentation

typedef struct centerlist CENTERLIST
typedef struct corner CORNER
typedef struct cube CUBE
typedef struct cubes CUBES
typedef struct edgelist EDGELIST
typedef struct intlist INTLIST
typedef struct intlists INTLISTS
typedef struct point MB_POINT
typedef struct ml_pointer ml_pointer
typedef struct octal_node octal_node
typedef struct octal_tree octal_tree
typedef struct process PROCESS
typedef struct vertex VERTEX
typedef struct vertices VERTICES

Function Documentation

void accum_mballfaces ( int  i1,
int  i2,
int  i3,
int  i4 
)

Definition at line 716 of file mball.c.

References curindex, indices, MEM_freeN(), MEM_mallocN(), and totindex.

Referenced by docube().

void add_cube ( PROCESS mbproc,
int  i,
int  j,
int  k,
int  count 
)
struct MetaBall* add_mball ( const char *  name) [read]
struct MetaElem* add_metaball_element ( struct MetaBall mb,
const int  type 
) [read]
void addtovertices ( VERTICES vertices,
VERTEX  v 
)

Definition at line 1202 of file mball.c.

References vertices::count, i, if(), vertices::max, MEM_callocN(), MEM_freeN(), NULL, and vertices::ptr.

Referenced by vertid().

void BKE_freecubetable ( void  )

Definition at line 1073 of file mball.c.

References i, intlists::list, MEM_freeN(), intlist::next, intlists::next, and NULL.

Referenced by WM_exit_ext().

void calc_mballco ( struct MetaElem ml,
float *  vec 
)

Definition at line 525 of file mball.c.

References MetaElem::mat, and mul_m4_v3().

Referenced by find_first_points(), and init_meta().

void converge ( MB_POINT p1,
MB_POINT p2,
float  v1,
float  v2,
float(*)(float, float, float)  function,
MB_POINT p,
struct MetaBall mb,
int  f 
)

Definition at line 1299 of file mball.c.

References i, RES, MetaBall::thresh, point::x, point::y, and point::z.

Referenced by vertid().

struct MetaBall* copy_mball ( struct MetaBall mb) [read]
void copy_mball_properties ( struct Scene scene,
struct Object active_object 
)
float densfunc ( struct MetaElem ball,
float  x,
float  y,
float  z 
)
void docube ( CUBE cube,
PROCESS p,
struct MetaBall mb 
)
void fill_metaball_octal_node ( octal_node node,
struct MetaElem ml,
short  i 
)
struct Object* find_basis_mball ( Scene scene,
Object basis 
) [read]

This function finds basic MetaBall.

Basic MetaBall doesn't include any number at the end of its name. All MetaBalls with same base of name can be blended. MetaBalls with different basic name can't be blended.

warning!, is_basis_mball() can fail on returned object, see long note above.

Definition at line 419 of file mball.c.

References BLI_split_name_num(), Object::data, MetaBall::editelems, MetaBall::elems, F_ERROR, ListBase::first, MetaElem::flag, Object::flag, Object::id, MAX_ID_NAME, MB_HIDE, ID::name, MetaElem::next, next_object(), NULL, OB_FROMDUPLI, OB_MBALL, totelem, and Object::type.

Referenced by allow_render_object(), build_dag_object(), convert_exec(), init_render_mball(), and makeDispListMBall().

void find_first_points ( PROCESS mbproc,
struct MetaBall mb,
int  a 
)
octal_node* find_metaball_octal_node ( octal_node node,
float  x,
float  y,
float  z,
short  depth 
)

Definition at line 608 of file mball.c.

References find_metaball_octal_node(), and octal_node::nodes.

Referenced by find_metaball_octal_node(), and metaball().

void free_mball ( struct MetaBall mb)
void free_metaball_octal_node ( octal_node node)
void freepolygonize ( PROCESS p)
int getedge ( EDGELIST table[],
int  i1,
int  j1,
int  k1,
int  i2,
int  j2,
int  k2 
)
float init_meta ( struct Scene scene,
struct Object ob 
)
void init_metaball_octal_tree ( int  depth)
int is_basis_mball ( Object ob)

Test, if Object *ob is basic MetaBall.

It test last character of Object ID name. If last character is digit it return 0, else it return 1.

Definition at line 345 of file mball.c.

References Object::id, len(), ID::name, and strlen().

Referenced by draw_bounding_volume(), drawDispList(), drawObjectSelect(), drawWireExtra(), and is_mball_basis_for().

int is_mball_basis_for ( struct Object ob1,
struct Object ob2 
)

Definition at line 356 of file mball.c.

References BLI_split_name_num(), Object::id, is_basis_mball(), MAX_ID_NAME, and ID::name.

Referenced by unlink_object().

void make_local_mball ( struct MetaBall mb)
float* make_orco_mball ( struct Object ob,
struct ListBase dispbase 
)

Definition at line 293 of file mball.c.

References Object::bb, data, ListBase::first, MEM_mallocN(), DispList::nr, size(), BoundBox::vec, and DispList::verts.

Referenced by init_render_mball().

void makecubetable ( void  )
float metaball ( float  x,
float  y,
float  z 
)
void metaball_polygonize ( struct Scene scene,
struct Object ob,
struct ListBase dispbase 
)
void* new_pgn_element ( int  size)
int nextcwedge ( int  edge,
int  face 
)

Definition at line 989 of file mball.c.

References B, BF, BN, L, LB, LF, LN, LT, R, RB, RF, RN, RT, T, TF, and TN.

Referenced by makecubetable().

int otherface ( int  edge,
int  face 
)

Definition at line 1023 of file mball.c.

References leftface, and rightface.

Referenced by makecubetable().

void polygonize ( PROCESS mbproc,
struct MetaBall mb 
)
int setcenter ( CENTERLIST table[],
int  i,
int  j,
int  k 
)

Definition at line 1103 of file mball.c.

References HASH, centerlist::i, i, centerlist::j, centerlist::k, new_pgn_element(), centerlist::next, and NULL.

Referenced by add_cube(), and testface().

CORNER* setcorner ( PROCESS p,
int  i,
int  j,
int  k 
)
void setedge ( EDGELIST table[],
int  i1,
int  j1,
int  k1,
int  i2,
int  j2,
int  k2,
int  vid 
)
void subdivide_metaball_octal_node ( octal_node node,
float  size_x,
float  size_y,
float  size_z,
short  depth 
)
void testface ( int  i,
int  j,
int  k,
CUBE old,
int  bit,
int  c1,
int  c2,
int  c3,
int  c4,
PROCESS p 
)
void tex_space_mball ( Object ob)

Compute bounding box of all MetaElems/MetaBalls.

Bounding box is computed from polygonized surface. Object *ob is basic MetaBall (usually with name Meta). All other MetaBalls (with names Meta.001, Meta.002, etc) are included in this Bounding Box.

Definition at line 249 of file mball.c.

References Object::bb, boundbox_set_from_min_max(), data, Object::disp, DO_MINMAX, ListBase::first, max, MEM_callocN(), min, DispList::next, DispList::nr, NULL, and DispList::verts.

Referenced by copy_texture_space(), makeDispListMBall(), and makeDispListMBall_forRender().

void unlink_mball ( struct MetaBall mb)

Definition at line 76 of file mball.c.

References Material::id, MetaBall::mat, NULL, MetaBall::totcol, and ID::us.

Referenced by free_mball(), and free_object().

int vertid ( CORNER c1,
CORNER c2,
PROCESS p,
struct MetaBall mb 
)
void vnormal ( MB_POINT point,
PROCESS p,
MB_POINT v 
)

Definition at line 1220 of file mball.c.

References process::delta, FALSE, process::function, sqrtf, point::x, point::y, and point::z.

Referenced by MeshManager::device_update_mesh(), and vertid().