Blender V2.61 - r43446
|
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_node * | find_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) |
CORNER * | setcorner (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 MetaBall * | add_mball (const char *name) |
struct MetaBall * | copy_mball (struct MetaBall *mb) |
void | make_local_mball (struct MetaBall *mb) |
struct MetaElem * | add_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 Object * | find_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) |
Definition in file BKE_mball.h.
typedef struct centerlist CENTERLIST |
typedef struct ml_pointer ml_pointer |
typedef struct octal_node octal_node |
typedef struct octal_tree octal_tree |
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 | ||
) |
Definition at line 1399 of file mball.c.
References process::centers, cube::corners, cubes::cube, process::cubes, cube::i, cube::j, cube::k, MB_BIT, new_pgn_element(), cubes::next, setcenter(), and setcorner().
Referenced by find_first_points().
struct MetaBall* add_mball | ( | const char * | name | ) | [read] |
Definition at line 102 of file mball.c.
References alloc_libblock(), G, ID_MB, MB_AUTOSPACE, MetaBall::rendersize, MetaBall::size, MetaBall::texflag, MetaBall::thresh, and MetaBall::wiresize.
Referenced by add_obdata_from_type().
Definition at line 197 of file mball.c.
References BLI_addtail(), MetaBall::elems, MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, MB_BALL, MB_CUBE, MB_ELIPSOID, MB_PLANE, MB_SCALE_RAD, MB_TUBE, MEM_callocN(), MetaElem::quat, MetaElem::rad, MetaElem::s, MetaElem::type, and unit_qt().
Referenced by add_metaball_primitive().
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().
Definition at line 118 of file mball.c.
References MetaBall::bb, BLI_duplicatelist(), copy_libblock(), MetaBall::editelems, MetaBall::elems, MetaBall::id, id_us_plus(), MetaBall::lastelem, MetaBall::mat, MEM_dupallocN(), NULL, and MetaBall::totcol.
Referenced by id_copy(), make_local_mball(), object_add_duplicate_internal(), and single_obdata_users().
Definition at line 374 of file mball.c.
References BLI_split_name_num(), Object::data, F_ERROR, MetaBall::flag, Object::id, MAX_ID_NAME, ID::name, next_object(), NULL, OB_MBALL, MetaBall::rendersize, MetaBall::thresh, Object::type, and MetaBall::wiresize.
float densfunc | ( | struct MetaElem * | ball, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Definition at line 532 of file mball.c.
References MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, MetaElem::imat, MetaElem::len, len(), MB_BALL, MB_CUBE, MB_ELIPSOID, MB_NEGATIVE, MB_PLANE, MB_TUBE, MB_TUBEX, MB_TUBEY, MB_TUBEZ, mul_m4_v3(), MetaElem::rad2, MetaElem::s, and MetaElem::type.
Referenced by init_meta(), and metaball().
Definition at line 835 of file mball.c.
References accum_mballfaces(), corner1, corner2, cube::corners, intlist::i, i, intlists::list, intlists::next, intlist::next, corner::value, and vertid().
Referenced by polygonize().
void fill_metaball_octal_node | ( | octal_node * | node, |
struct MetaElem * | ml, | ||
short | i | ||
) |
Definition at line 1815 of file mball.c.
References BLI_addtail(), octal_node::count, octal_node::elems, MetaElem::flag, i, MB_NEGATIVE, MEM_mallocN(), ml_pointer::ml, octal_node::neg, octal_node::nodes, and octal_node::pos.
Referenced by subdivide_metaball_octal_node().
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().
Definition at line 1429 of file mball.c.
References abs(), add_cube(), calc_mballco(), MetaElem::expx, MetaElem::expy, MetaElem::expz, MetaElem::flag, process::function, i, IN, len(), MAX3(), MB_BALL, MB_CUBE, MB_ELIPSOID, MB_NEGATIVE, MB_PLANE, MB_TUBE, OUT, MetaElem::rad, MetaElem::s, process::size, sqrtf, MetaBall::thresh, MetaElem::type, point::x, point::y, and point::z.
Referenced by polygonize().
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 | ) |
Definition at line 88 of file mball.c.
References MetaBall::adt, MetaBall::bb, BKE_free_animdata(), BLI_freelistN(), MetaBall::disp, MetaBall::elems, ListBase::first, freedisplist(), MetaBall::mat, MEM_freeN(), NULL, and unlink_mball().
Referenced by free_libblock().
void free_metaball_octal_node | ( | octal_node * | node | ) |
Definition at line 2104 of file mball.c.
References BLI_freelistN(), octal_node::elems, free_metaball_octal_node(), MEM_freeN(), octal_node::nodes, and NULL.
Referenced by free_metaball_octal_node(), and metaball_polygonize().
void freepolygonize | ( | PROCESS * | p | ) |
Definition at line 792 of file mball.c.
References process::centers, process::corners, process::edges, MEM_freeN(), new_pgn_element(), vertices::ptr, and process::vertices.
Referenced by metaball_polygonize().
int getedge | ( | EDGELIST * | table[], |
int | i1, | ||
int | j1, | ||
int | k1, | ||
int | i2, | ||
int | j2, | ||
int | k2 | ||
) |
Definition at line 1164 of file mball.c.
References HASH, edgelist::i1, edgelist::i2, edgelist::j1, edgelist::j2, edgelist::k1, edgelist::k2, edgelist::next, NULL, and edgelist::vid.
Referenced by vertid().
Definition at line 1589 of file mball.c.
References Object::bb, MetaElem::bb, BLI_split_name_num(), calc_mballco(), copy_m4_m4(), Object::data, densfunc(), MetaBall::editelems, MetaBall::elems, MetaElem::expx, MetaElem::expy, MetaElem::expz, fabsf, ListBase::first, Base::flag, MetaElem::flag, i, Object::id, MetaElem::imat, invert_m4_m4(), Object::mat, MetaElem::mat, MAX_ID_NAME, MB_HIDE, mul_m4_v3(), mult_m4_m4m4(), ID::name, new_pgn_element(), MetaElem::next, next_object(), NULL, OB_FROMDUPLI, OB_MBALL, Object::obmat, Object::parent, MetaElem::quat, quat_to_mat4(), MetaElem::rad, MetaElem::rad2, MetaElem::s, Object::size, size(), thresh, totelem, Object::type, unit_m4(), BoundBox::vec, MetaElem::x, MetaElem::y, and MetaElem::z.
Referenced by metaball_polygonize().
void init_metaball_octal_tree | ( | int | depth | ) |
Definition at line 2115 of file mball.c.
References MetaElem::bb, BLI_addtail(), octal_node::count, octal_tree::depth, octal_node::elems, ListBase::first, octal_tree::first, FLT_MAX, ListBase::last, MB_NEGATIVE, MEM_mallocN(), ml_pointer::ml, octal_tree::neg, octal_node::neg, octal_node::nodes, NULL, octal_node::pos, octal_tree::pos, size(), subdivide_metaball_octal_node(), totelem, BoundBox::vec, octal_node::x_max, octal_node::x_min, octal_node::y_max, octal_node::y_min, octal_node::z_max, and octal_node::z_min.
Referenced by metaball_polygonize().
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().
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 | ) |
Definition at line 146 of file mball.c.
References BKE_id_lib_local_paths(), copy_mball(), Object::data, ELEM, extern_local_mball(), FALSE, G, MetaBall::id, Object::id, id_clear_lib_data(), ID::lib, ID::next, NULL, TRUE, and ID::us.
Referenced by id_make_local().
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 | ) |
Definition at line 1032 of file mball.c.
References corner1, corner2, credits_svn_gen::e, intlist::i, i, leftface, intlists::list, MB_BIT, MEM_callocN(), intlists::next, intlist::next, nextcwedge(), NULL, otherface(), and rightface.
Referenced by polygonize().
float metaball | ( | float | x, |
float | y, | ||
float | z | ||
) |
Definition at line 676 of file mball.c.
References densfunc(), octal_tree::depth, octal_node::elems, find_metaball_octal_node(), ListBase::first, octal_tree::first, ml_pointer::ml, octal_tree::neg, octal_node::neg, ml_pointer::next, octal_node::pos, octal_tree::pos, thresh, and totelem.
Referenced by metaball_polygonize().
Definition at line 2173 of file mball.c.
References BLI_addtail(), process::bounds, vertices::count, process::cubes, curindex, Object::data, process::delta, DL_INDEX4, octal_tree::first, MetaBall::flag, free_metaball_octal_node(), freepolygonize(), process::function, G, DispList::index, indices, init_meta(), init_metaball_octal_tree(), MB_UPDATE_FAST, MB_UPDATE_HALFRES, MB_UPDATE_NEVER, MEM_callocN(), MEM_freeN(), MEM_mallocN(), metaball(), new_pgn_element(), vertex::normal, DispList::nors, DispList::nr, NULL, DispList::parts, polygonize(), vertex::position, vertices::ptr, MetaBall::rendersize, RES, Object::size, process::size, thresh, MetaBall::thresh, totelem, totindex, DispList::type, process::vertices, DispList::verts, MetaBall::wiresize, point::x, octal_node::x_max, octal_node::x_min, point::y, octal_node::y_max, octal_node::y_min, point::z, octal_node::z_max, and octal_node::z_min.
Referenced by makeDispListMBall(), and makeDispListMBall_forRender().
void* new_pgn_element | ( | int | size | ) |
Definition at line 749 of file mball.c.
References BLI_addtail(), BLI_freelistN(), pgn_elements::data, ListBase::first, MEM_callocN(), MEM_freeN(), pgn_elements::next, NULL, offs, and size().
Referenced by add_cube(), freepolygonize(), init_meta(), metaball_polygonize(), setcenter(), setcorner(), setedge(), and testface().
int nextcwedge | ( | int | edge, |
int | face | ||
) |
int otherface | ( | int | edge, |
int | face | ||
) |
Definition at line 1023 of file mball.c.
References leftface, and rightface.
Referenced by makecubetable().
Definition at line 1549 of file mball.c.
References process::centers, process::corners, vertices::count, cubes::cube, process::cubes, docube(), process::edges, find_first_points(), HASHSIZE, cube::i, cube::j, cube::k, LBF, LBN, LTF, LTN, makecubetable(), vertices::max, MEM_callocN(), cubes::next, NULL, vertices::ptr, RBF, RBN, RTF, RTN, testface(), totelem, and process::vertices.
Referenced by metaball_polygonize().
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().
Definition at line 954 of file mball.c.
References process::corners, process::function, HASH, corner::i, i, corner::j, corner::k, new_pgn_element(), corner::next, NULL, process::size, corner::value, corner::x, corner::y, and corner::z.
Referenced by add_cube(), and testface().
void setedge | ( | EDGELIST * | table[], |
int | i1, | ||
int | j1, | ||
int | k1, | ||
int | i2, | ||
int | j2, | ||
int | k2, | ||
int | vid | ||
) |
Definition at line 1128 of file mball.c.
References HASH, edgelist::i1, edgelist::i2, edgelist::j1, edgelist::j2, edgelist::k1, edgelist::k2, new_pgn_element(), edgelist::next, and edgelist::vid.
Referenced by vertid().
void subdivide_metaball_octal_node | ( | octal_node * | node, |
float | size_x, | ||
float | size_y, | ||
float | size_z, | ||
short | depth | ||
) |
Definition at line 1847 of file mball.c.
References MetaElem::bb, BLI_freelistN(), octal_node::count, octal_node::elems, fill_metaball_octal_node(), ListBase::first, i, ListBase::last, MEM_mallocN(), ml_pointer::ml, octal_node::neg, ml_pointer::next, octal_node::nodes, NULL, octal_node::parent, octal_node::pos, subdivide_metaball_octal_node(), BoundBox::vec, octal_node::x, octal_node::x_min, octal_node::y, octal_node::y_min, octal_node::z, and octal_node::z_min.
Referenced by init_metaball_octal_tree(), and subdivide_metaball_octal_node().
void testface | ( | int | i, |
int | j, | ||
int | k, | ||
CUBE * | old, | ||
int | bit, | ||
int | c1, | ||
int | c2, | ||
int | c3, | ||
int | c4, | ||
PROCESS * | p | ||
) |
Definition at line 903 of file mball.c.
References process::centers, cube::corners, cubes::cube, process::cubes, FLIP, cube::i, i, cube::j, cube::k, new_pgn_element(), cubes::next, NULL, setcenter(), setcorner(), and corner::value.
Referenced by polygonize().
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().
Definition at line 1270 of file mball.c.
References addtovertices(), converge(), vertices::count, process::edges, process::function, getedge(), corner::i, corner::j, corner::k, vertex::normal, vertex::position, setedge(), corner::value, process::vertices, vnormal(), corner::x, point::x, corner::y, point::y, corner::z, and point::z.
Referenced by docube(), and SubdFaceRing::evaluate_stencils().
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().