Revision: 52833
http://brlcad.svn.sourceforge.net/brlcad/?rev=52833&view=rev
Author: brlcad
Date: 2012-10-05 05:03:48 +0000 (Fri, 05 Oct 2012)
Log Message:
-----------
fix slew of vmath macro mess with wrong indentation due to missing semicolon.
change instances of Readcnv to Readdbl where a double is being passed
(functions are identical)
Modified Paths:
--------------
brlcad/trunk/src/conv/iges/trimsurf.c
Modified: brlcad/trunk/src/conv/iges/trimsurf.c
===================================================================
--- brlcad/trunk/src/conv/iges/trimsurf.c 2012-10-05 05:01:18 UTC (rev
52832)
+++ brlcad/trunk/src/conv/iges/trimsurf.c 2012-10-05 05:03:48 UTC (rev
52833)
@@ -97,9 +97,9 @@
n_u = n_cols+u_order;
n_v = n_rows+v_order;
- if (!m)
+ if (!m) {
srf = rt_nurb_new_snurb(u_order, v_order, n_u, n_v, n_rows, n_cols,
pt_type, (struct resource *)NULL);
- else {
+ } else {
int pnum;
GET_FACE_G_SNURB(srf, m);
@@ -163,17 +163,17 @@
/* Read control points */
for (i = 0; i < n_cols*n_rows; i++) {
- Readcnv(&a, "");
+ Readdbl(&a, "");
if (rational)
pt[X] = a*srf->ctl_points[i*ncoords+3];
else
pt[X] = a;
- Readcnv(&a, "");
+ Readdbl(&a, "");
if (rational)
pt[Y] = a*srf->ctl_points[i*ncoords+3];
else
pt[Y] = a;
- Readcnv(&a, "");
+ Readdbl(&a, "");
if (rational)
pt[Z] = a*srf->ctl_points[i*ncoords+3];
else
@@ -210,11 +210,12 @@
ctl_points = (fastf_t *)bu_calloc(ncoords*crv->c_size, sizeof(fastf_t),
"Assign_cnurb_to_eu: ctl_points");
- for (i = 0; i < crv->c_size; i++)
- VMOVEN(&ctl_points[i*ncoords], &crv->ctl_points[i*ncoords], ncoords)
+ for (i = 0; i < crv->c_size; i++) {
+ VMOVEN(&ctl_points[i*ncoords], &crv->ctl_points[i*ncoords], ncoords);
+ }
- knots = (fastf_t *)bu_calloc(crv->k.k_size, sizeof(fastf_t),
- "Assign_cnurb_to_eu: knots");
+ knots = (fastf_t *)bu_calloc(crv->k.k_size, sizeof(fastf_t),
+ "Assign_cnurb_to_eu: knots");
for (i = 0; i < crv->k.k_size; i++)
knots[i] = crv->k.knots[i];
@@ -290,15 +291,10 @@
/* control points */
for (i = 0; i < num_pts; i++) {
- if (dir[entity_no]->status & 500) {
- Readdbl(&x, "");
- Readdbl(&y, "");
- Readdbl(&z, "");
- } else {
- Readcnv(&x, "");
- Readcnv(&y, "");
- Readcnv(&z, "");
- }
+ Readdbl(&x, "");
+ Readdbl(&y, "");
+ Readdbl(&z, "");
+
if (rational) {
pt[X] = (x + u_translation) * crv->ctl_points[i*ncoords+2];
pt[Y] = (y + v_translation) * crv->ctl_points[i*ncoords+2];
@@ -331,27 +327,27 @@
NMG_CK_VERTEXUSE(vu);
NMG_CK_SNURB(srf);
- VSETALLN(pt_on_srf, 0.0, 4)
+ VSETALLN(pt_on_srf, 0.0, 4);
- if (u < srf->u.knots[0] || v < srf->v.knots[0] ||
- u > srf->u.knots[srf->u.k_size-1] || v >
srf->v.knots[srf->v.k_size-1]) {
- bu_log("WARNING: UV point outside of domain of surface!:\n");
- bu_log("\tUV = (%g %g)\n", u, v);
- bu_log("\tsrf domain: (%g %g) <-> (%g %g)\n",
- srf->u.knots[0], srf->v.knots[0],
- srf->u.knots[srf->u.k_size-1],
srf->v.knots[srf->v.k_size-1]);
+ if (u < srf->u.knots[0] || v < srf->v.knots[0] ||
+ u > srf->u.knots[srf->u.k_size-1] || v > srf->v.knots[srf->v.k_size-1])
{
+ bu_log("WARNING: UV point outside of domain of surface!:\n");
+ bu_log("\tUV = (%g %g)\n", u, v);
+ bu_log("\tsrf domain: (%g %g) <-> (%g %g)\n",
+ srf->u.knots[0], srf->v.knots[0],
+ srf->u.knots[srf->u.k_size-1], srf->v.knots[srf->v.k_size-1]);
- if (u < srf->u.knots[0])
- u = srf->u.knots[0];
- if (v < srf->v.knots[0])
- v = srf->v.knots[0];
- if (u > srf->u.knots[srf->u.k_size-1])
- u = srf->u.knots[srf->u.k_size-1];
- if (v > srf->v.knots[srf->v.k_size-1])
- v = srf->v.knots[srf->v.k_size-1];
+ if (u < srf->u.knots[0])
+ u = srf->u.knots[0];
+ if (v < srf->v.knots[0])
+ v = srf->v.knots[0];
+ if (u > srf->u.knots[srf->u.k_size-1])
+ u = srf->u.knots[srf->u.k_size-1];
+ if (v > srf->v.knots[srf->v.k_size-1])
+ v = srf->v.knots[srf->v.k_size-1];
- moved = 1;
- }
+ moved = 1;
+ }
rt_nurb_s_eval(srf, u, v, pt_on_srf);
if (RT_NURB_IS_PT_RATIONAL(srf->pt_type)) {
@@ -426,13 +422,13 @@
Readdbl(&x, "");
Readdbl(&y, "");
Readdbl(&z, "");
- VSET(pt, x + u_translation, y + v_translation, z)
+ VSET(pt, x + u_translation, y + v_translation, z);
- /* apply transformation */
- MAT4X3PNT(pt2, *dir[entity_no]->rot, pt)
+ /* apply transformation */
+ MAT4X3PNT(pt2, *dir[entity_no]->rot, pt);
- /* Split last edge in loop */
- eu = BU_LIST_LAST(edgeuse, &lu->down_hd);
+ /* Split last edge in loop */
+ eu = BU_LIST_LAST(edgeuse, &lu->down_hd);
new_eu = nmg_eusplit((struct vertex *)NULL, eu, 0);
vp = eu->vu_p->v_p;
@@ -444,12 +440,12 @@
Readdbl(&x, "");
Readdbl(&y, "");
Readdbl(&z, "");
- VSET(pt, x + u_translation, y + v_translation, z)
+ VSET(pt, x + u_translation, y + v_translation, z);
- /* apply transformation */
- MAT4X3PNT(pt2, *dir[entity_no]->rot, pt)
+ /* apply transformation */
+ MAT4X3PNT(pt2, *dir[entity_no]->rot, pt);
- Assign_vu_geom(new_eu->vu_p, pt2[X], pt2[Y], srf);
+ Assign_vu_geom(new_eu->vu_p, pt2[X], pt2[Y], srf);
/* assign edge geometry */
nmg_edge_g_cnurb_plinear(eu);
@@ -459,28 +455,28 @@
point_t center, start, end;
/* read Arc center start and end points */
- Readcnv(&z, ""); /* common Z-coord */
- Readcnv(&x, ""); /* center */
- Readcnv(&y, ""); /* center */
- VSET(center, y+u_translation, x+v_translation, z)
+ Readdbl(&z, ""); /* common Z-coord */
+ Readdbl(&x, ""); /* center */
+ Readdbl(&y, ""); /* center */
+ VSET(center, y+u_translation, x+v_translation, z);
- Readcnv(&x, ""); /* start */
- Readcnv(&y, ""); /* start */
- VSET(start, y+u_translation, x+v_translation, z)
+ Readdbl(&x, ""); /* start */
+ Readdbl(&y, ""); /* start */
+ VSET(start, y+u_translation, x+v_translation, z);
- Readcnv(&x, ""); /* end */
- Readcnv(&y, ""); /* end */
- VSET(end, y+u_translation, x+v_translation, z)
+ Readdbl(&x, ""); /* end */
+ Readdbl(&y, ""); /* end */
+ VSET(end, y+u_translation, x+v_translation, z);
/* build edge_g_cnurb arc */
- crv = rt_arc2d_to_cnurb(center, start, end, RT_NURB_PT_UV,
&tol);
+ crv = rt_arc2d_to_cnurb(center, start, end, RT_NURB_PT_UV, &tol);
/* apply transformation to control points */
for (i = 0; i < crv->c_size; i++) {
- V2MOVE(pt2, &crv->ctl_points[i*3])
- pt2[Z] = z;
- MAT4X3PNT(pt, *dir[entity_no]->rot, pt2)
- V2MOVE(&crv->ctl_points[i*3], pt);
+ V2MOVE(pt2, &crv->ctl_points[i*3]);
+ pt2[Z] = z;
+ MAT4X3PNT(pt, *dir[entity_no]->rot, pt2);
+ V2MOVE(&crv->ctl_points[i*3], pt);
}
/* add a new edge to loop */
@@ -612,21 +608,21 @@
struct bu_list curv_hd;
/* read Arc center start and end points */
- Readcnv(&z, ""); /* common Z-coord */
- Readcnv(&x, ""); /* center */
- Readcnv(&y, ""); /* center */
- VSET(center, x+u_translation, y+v_translation, z)
+ Readdbl(&z, ""); /* common Z-coord */
+ Readdbl(&x, ""); /* center */
+ Readdbl(&y, ""); /* center */
+ VSET(center, x+u_translation, y+v_translation, z);
- Readcnv(&x, ""); /* start */
- Readcnv(&y, ""); /* start */
- VSET(start, x+u_translation, y+v_translation, z)
+ Readdbl(&x, ""); /* start */
+ Readdbl(&y, ""); /* start */
+ VSET(start, x+u_translation, y+v_translation, z);
- Readcnv(&x, ""); /* end */
- Readcnv(&y, ""); /* end */
- VSET(end, x+u_translation, y+v_translation, z)
+ Readdbl(&x, ""); /* end */
+ Readdbl(&y, ""); /* end */
+ VSET(end, x+u_translation, y+v_translation, z);
- /* build edge_g_cnurb circle */
- crv = rt_arc2d_to_cnurb(center, start, end, RT_NURB_PT_UV,
&tol);
+ /* build edge_g_cnurb circle */
+ crv = rt_arc2d_to_cnurb(center, start, end, RT_NURB_PT_UV, &tol);
/* split circle into two pieces */
BU_LIST_INIT(&curv_hd);
@@ -852,9 +848,9 @@
NMG_CK_EDGEUSE(eu);
vu = eu->vu_p;
NMG_CK_VERTEXUSE(vu);
- if (planar)
+ if (planar) {
nmg_edge_g(eu);
- else {
+ } else {
ctl_points = (fastf_t *)bu_calloc(sizeof(fastf_t), 4, "ctl_points");
switch (edge_no) {
case 0:
@@ -1176,35 +1172,38 @@
fastf_t inv_homo;
inv_homo = 1.0/homo_hit[3];
- VSCALE(myhit->pt, homo_hit, inv_homo)
- } else
- VMOVE(myhit->pt, homo_hit)
+ VSCALE(myhit->pt, homo_hit, inv_homo);
+ } else {
+ VMOVE(myhit->pt, homo_hit);
+ }
- VSUB2(to_hit, myhit->pt, mid_pt);
+ VSUB2(to_hit, myhit->pt, mid_pt);
myhit->dist = VDOT(to_hit, ray_dir);
/* get surface normal */
rt_nurb_s_norm(srf, hp->u, hp->v, myhit->norm);
/* may need to reverse it */
- if (f->flip)
- VREVERSE(myhit->norm, myhit->norm)
+ if (f->flip) {
+ VREVERSE(myhit->norm, myhit->norm);
+ }
- /* add hit to list */
- if (BU_LIST_IS_EMPTY(hit_list))
- BU_LIST_APPEND(hit_list, &myhit->l)
- else {
- struct snurb_hit *tmp;
+ /* add hit to list */
+ if (BU_LIST_IS_EMPTY(hit_list)) {
+ BU_LIST_APPEND(hit_list, &myhit->l);
+ } else {
+ struct snurb_hit *tmp;
- for (BU_LIST_FOR(tmp, snurb_hit, hit_list)) {
- if (tmp->dist >= myhit->dist) {
- BU_LIST_INSERT(&tmp->l, &myhit->l);
- break;
- }
- }
- if (myhit->l.forw == (struct bu_list *)0)
- BU_LIST_INSERT(hit_list, &myhit->l)
- }
+ for (BU_LIST_FOR(tmp, snurb_hit, hit_list)) {
+ if (tmp->dist >= myhit->dist) {
+ BU_LIST_INSERT(&tmp->l, &myhit->l);
+ break;
+ }
+ }
+ if (myhit->l.forw == (struct bu_list *)0) {
+ BU_LIST_INSERT(hit_list, &myhit->l);
+ }
+ }
bu_free((char *)hp, "nurb_uv_hit");
hp = next;
@@ -1374,18 +1373,20 @@
fastf_t inv_homo;
inv_homo = 1.0/homo_hit[3];
- VSCALE(pt, homo_hit, inv_homo)
- } else
- VMOVE(pt, homo_hit)
+ VSCALE(pt, homo_hit, inv_homo);
+ } else {
+ VMOVE(pt, homo_hit);
+ }
- /* get surface normal */
- rt_nurb_s_norm(fg, u, v, norm);
+ /* get surface normal */
+ rt_nurb_s_norm(fg, u, v, norm);
/* may need to reverse it */
- if (f->flip)
- VREVERSE(norm, norm)
+ if (f->flip) {
+ VREVERSE(norm, norm);
+ }
- return 0;
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits