style cleanup: picky edits

This commit is contained in:
2012-03-07 15:10:21 +00:00
parent 9f742303a7
commit b41b19025e

View File

@@ -378,7 +378,8 @@ static KnifeVert *knife_split_edge(knifetool_opdata *kcd, KnifeEdge *kfe, float
l12 = len_v3v3(kfe->v1->co, kfe->v2->co); l12 = len_v3v3(kfe->v1->co, kfe->v2->co);
if (l12 < FLT_EPSILON * 80) { if (l12 < FLT_EPSILON * 80) {
copy_v3_v3(cageco, kfe->v1->cageco); copy_v3_v3(cageco, kfe->v1->cageco);
} else { }
else {
perc = len_v3v3(co, kfe->v1->co) / l12; perc = len_v3v3(co, kfe->v1->co) / l12;
interp_v3_v3v3(cageco, kfe->v1->cageco, kfe->v2->cageco, perc); interp_v3_v3v3(cageco, kfe->v1->cageco, kfe->v2->cageco, perc);
} }
@@ -420,9 +421,11 @@ static void knife_add_single_cut(knifetool_opdata *kcd)
if (kcd->prevvert) { if (kcd->prevvert) {
kfe->v1 = kcd->prevvert; kfe->v1 = kcd->prevvert;
} else if (kcd->prevedge) { }
else if (kcd->prevedge) {
kfe->v1 = knife_split_edge(kcd, kcd->prevedge, kcd->prevco, &kfe2); kfe->v1 = knife_split_edge(kcd, kcd->prevedge, kcd->prevco, &kfe2);
} else { }
else {
kfe->v1 = new_knife_vert(kcd, kcd->prevco, kcd->prevco); kfe->v1 = new_knife_vert(kcd, kcd->prevco, kcd->prevco);
kfe->v1->draw = kfe->draw = !kcd->prev_is_space; kfe->v1->draw = kfe->draw = !kcd->prev_is_space;
kfe->v1->inspace = kcd->prev_is_space; kfe->v1->inspace = kcd->prev_is_space;
@@ -432,10 +435,12 @@ static void knife_add_single_cut(knifetool_opdata *kcd)
if (kcd->curvert) { if (kcd->curvert) {
kfe->v2 = kcd->curvert; kfe->v2 = kcd->curvert;
} else if (kcd->curedge) { }
else if (kcd->curedge) {
kfe->v2 = knife_split_edge(kcd, kcd->curedge, kcd->vertco, &kfe3); kfe->v2 = knife_split_edge(kcd, kcd->curedge, kcd->vertco, &kfe3);
kcd->curvert = kfe->v2; kcd->curvert = kfe->v2;
} else { }
else {
kfe->v2 = new_knife_vert(kcd, kcd->vertco, kcd->vertco); kfe->v2 = new_knife_vert(kcd, kcd->vertco, kcd->vertco);
kfe->v2->draw = !kcd->is_space; kfe->v2->draw = !kcd->is_space;
kfe->v2->isface = 1; kfe->v2->isface = 1;
@@ -661,7 +666,8 @@ static void knife_add_cut(knifetool_opdata *kcd)
if (kcd->cut_through) { if (kcd->cut_through) {
knife_cut_through(kcd); knife_cut_through(kcd);
} else if (kcd->linehits) { }
else if (kcd->linehits) {
BMEdgeHit *lh, *lastlh, *firstlh; BMEdgeHit *lh, *lastlh, *firstlh;
int i; int i;
@@ -676,7 +682,8 @@ static void knife_add_cut(knifetool_opdata *kcd)
if (!firstlh) if (!firstlh)
firstlh = lastlh; firstlh = lastlh;
continue; continue;
} else if (lastlh && firstlh) { }
else if (lastlh && firstlh) {
if (firstlh->v || lastlh->v) { if (firstlh->v || lastlh->v) {
KnifeVert *kfv = firstlh->v ? firstlh->v : lastlh->v; KnifeVert *kfv = firstlh->v ? firstlh->v : lastlh->v;
@@ -721,7 +728,8 @@ static void knife_add_cut(knifetool_opdata *kcd)
copy_v3_v3(kcd->prevco, oldkcd.vertco); copy_v3_v3(kcd->prevco, oldkcd.vertco);
copy_v3_v3(kcd->prevcage, oldkcd.vertcage); copy_v3_v3(kcd->prevcage, oldkcd.vertcage);
kcd->prev_is_space = oldkcd.is_space; kcd->prev_is_space = oldkcd.is_space;
} else { }
else {
kcd->curbmface = oldkcd.curbmface; kcd->curbmface = oldkcd.curbmface;
kcd->curvert = oldkcd.curvert; kcd->curvert = oldkcd.curvert;
kcd->curedge = oldkcd.curedge; kcd->curedge = oldkcd.curedge;
@@ -1936,11 +1944,13 @@ static float frac_along(const float a[3], const float b[3], const float v[3]) {
float lab; float lab;
lab = len_v3v3(a, b); lab = len_v3v3(a, b);
if (lab == 0.0f) if (lab == 0.0f) {
return 0.0f; return 0.0f;
else }
else {
return len_v3v3(a, v) / lab; return len_v3v3(a, v) / lab;
} }
}
/* sort list of kverts by fraction along edge e */ /* sort list of kverts by fraction along edge e */
static void sort_by_frac_along(ListBase *lst, BMEdge *e) { static void sort_by_frac_along(ListBase *lst, BMEdge *e) {
@@ -2019,7 +2029,8 @@ static ListBase * find_chain_from_vertex(knifetool_opdata *kcd, KnifeEdge *kfe,
if (kfe->v1->v == v) { if (kfe->v1->v == v) {
BLI_smallhash_insert(visited, (uintptr_t)(kfe->v1), NULL); BLI_smallhash_insert(visited, (uintptr_t)(kfe->v1), NULL);
found = find_chain_search(kcd, kfe->v2, fedges, visited, ans); found = find_chain_search(kcd, kfe->v2, fedges, visited, ans);
} else { }
else {
BLI_assert(kfe->v2->v == v); BLI_assert(kfe->v2->v == v);
BLI_smallhash_insert(visited, (uintptr_t)(kfe->v2), NULL); BLI_smallhash_insert(visited, (uintptr_t)(kfe->v2), NULL);
found = find_chain_search(kcd, kfe->v1, fedges, visited, ans); found = find_chain_search(kcd, kfe->v1, fedges, visited, ans);
@@ -2137,7 +2148,8 @@ static ListBase *find_hole(knifetool_opdata *kcd, ListBase *fedges) {
BLI_remlink(fedges, ref); BLI_remlink(fedges, ref);
} }
return ans; return ans;
} else { }
else {
return NULL; return NULL;
} }
} }
@@ -2270,7 +2282,8 @@ static int find_hole_chains(knifetool_opdata *kcd, ListBase *hole, BMFace *f,
*sidechain = chain; *sidechain = chain;
return TRUE; return TRUE;
} else { }
else {
return FALSE; return FALSE;
} }
} }
@@ -2404,10 +2417,12 @@ static void knife_make_face_cuts(knifetool_opdata *kcd, BMFace *f, ListBase *kfe
if (knife_edge_in_face(kcd, kfe, f)) { if (knife_edge_in_face(kcd, kfe, f)) {
knife_make_chain_cut(kcd, f, sidechain, &fnew2); knife_make_chain_cut(kcd, f, sidechain, &fnew2);
fhole = f; fhole = f;
} else if (knife_edge_in_face(kcd, kfe, fnew)) { }
else if (knife_edge_in_face(kcd, kfe, fnew)) {
knife_make_chain_cut(kcd, fnew, sidechain, &fnew2); knife_make_chain_cut(kcd, fnew, sidechain, &fnew2);
fhole = fnew2; fhole = fnew2;
} else { }
else {
/* shouldn't happen */ /* shouldn't happen */
BLI_assert(0); BLI_assert(0);
} }
@@ -2423,7 +2438,8 @@ static void knife_make_face_cuts(knifetool_opdata *kcd, BMFace *f, ListBase *kfe
BLI_remlink(kfedges, ref); BLI_remlink(kfedges, ref);
kfe->basef = fnew; kfe->basef = fnew;
knife_append_list(kcd, fnew_kfedges, kfe); knife_append_list(kcd, fnew_kfedges, kfe);
} else if (knife_edge_in_face(kcd, kfe, fnew2)) { }
else if (knife_edge_in_face(kcd, kfe, fnew2)) {
BLI_remlink(kfedges, ref); BLI_remlink(kfedges, ref);
kfe->basef = fnew2; kfe->basef = fnew2;
knife_append_list(kcd, fnew2_kfedges, kfe); knife_append_list(kcd, fnew2_kfedges, kfe);