Revision: 41306
http://brlcad.svn.sourceforge.net/brlcad/?rev=41306&view=rev
Author: brlcad
Date: 2010-11-09 19:57:26 +0000 (Tue, 09 Nov 2010)
Log Message:
-----------
undo code that is carelessly being too careful. NMG_CK_HITMISS_LISTS() is a
linear walk over the hit and miss lists that was being called all over the
place up and down the call stack, often very redundantly. this is causing
certain objects that need to fire rays to evaluate the nmg surface to run
absurdly slower (order or more) than they need to. roll up the
NMG_CK_HITMISS_LISTS() calls up the stack to the top caller, still checking
before and after to make sure memory is clean, but not during every little
recursive processing step. performance gains uncertain as there are still
dominant O() problems elsewhere too.
Modified Paths:
--------------
brlcad/trunk/NEWS
brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS 2010-11-09 16:10:50 UTC (rev 41305)
+++ brlcad/trunk/NEWS 2010-11-09 19:57:26 UTC (rev 41306)
@@ -20,6 +20,7 @@
easy-to-use interface. The new GUI grealy simplifies BoT processing
steps and can save modelers considerable time.
+* increased performance of facetization and export - Sean Morrison
* fixed NURBS raytrace bug grazing nearly flat surfaces - Keith Bowman
* fixed infinite loop bug converting to NMG and BoT - Sean Morrison
* improved Windows installer desktop shortcut creation - Bob Parker
Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2010-11-09
16:10:50 UTC (rev 41305)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2010-11-09
19:57:26 UTC (rev 41306)
@@ -341,7 +341,6 @@
/* add myhit to the list of misses */
BU_LIST_MAGIC_SET(&myhit->l, NMG_RT_MISS_MAGIC);
BU_LIST_INSERT(&rd->rd_miss, &myhit->l);
- NMG_CK_HITMISS_LISTS(rd);
return myhit;
}
@@ -1126,7 +1125,6 @@
BU_LIST_MAGIC_SET(&myhit->l, NMG_RT_HIT_SUB_MAGIC);
BU_LIST_INSERT(&rd->rd_miss, &myhit->l);
- NMG_CK_HITMISS_LISTS(rd); /* sanity check */
return;
}
@@ -1151,7 +1149,6 @@
\
BU_LIST_MAGIC_SET(&myhit->l, NMG_RT_HIT_SUB_MAGIC); \
BU_LIST_INSERT(&rd->rd_miss, &myhit->l); \
- NMG_CK_HITMISS_LISTS(rd); \
}
@@ -1178,8 +1175,6 @@
vect_t norm;
int faces_found;
- NMG_CK_HITMISS_LISTS(rd);
-
if (rt_g.NMG_debug & DEBUG_RT_ISECT) {
eu_p = BU_LIST_PNEXT_CIRC(edgeuse, eu);
bu_log("edge_hit_ray_state(%g %g %g -> %g %g %g _vs_ %g %g %g)\n",
@@ -1375,9 +1370,6 @@
bu_bomb("edge_hit_ray_state() bad edge in_out state\n");
break;
}
-
- /* sanity check */
- NMG_CK_HITMISS_LISTS(rd);
}
@@ -1391,8 +1383,6 @@
ray_miss_vertex(rd, eu_p->vu_p);
ray_miss_vertex(rd, eu_p->eumate_p->vu_p);
- NMG_CK_HITMISS_LISTS(rd);
-
if (rt_g.NMG_debug & DEBUG_RT_ISECT) bu_log("\t - HIT edge 0x%08x
(edgeuse=x%x)\n", eu_p->e_p, eu_p);
myhit = NMG_INDEX_GET(rd->hitmiss, eu_p->e_p);
@@ -1429,6 +1419,7 @@
myhit->hit.hit_private = (genptr_t) eu_p->e_p;
edge_hit_ray_state(rd, eu_p, myhit);
+
hit_ins(rd, myhit);
if (rt_g.NMG_debug & DEBUG_RT_ISECT) {
@@ -1650,8 +1641,7 @@
/* loopuse child is vertexuse */
- (void) isect_ray_vertexuse(rd,
- BU_LIST_FIRST(vertexuse, &lu_p->down_hd));
+ (void) isect_ray_vertexuse(rd, BU_LIST_FIRST(vertexuse, &lu_p->down_hd));
}
@@ -1682,7 +1672,6 @@
rd = (struct ray_data *)priv;
rd->face_subhit = 1;
- NMG_CK_HITMISS_LISTS(rd);
ray_hit_edge(rd, eu, rd->ray_dist_to_plane, pt);
}
@@ -2204,7 +2193,6 @@
/* intersect the ray with the edges/verticies of the face */
for (BU_LIST_FOR(lu_p, loopuse, &fu_p->lu_hd))
isect_ray_loopuse(rd, lu_p);
-
}
@@ -2312,7 +2300,6 @@
if (rt_g.NMG_debug & DEBUG_RT_ISECT) bu_log(" hit bounding box \n");
-
switch (*fu_p->f_p->g.magic_p) {
case NMG_FACE_G_PLANE_MAGIC:
isect_ray_planar_face(rd, fu_p);
@@ -2380,7 +2367,6 @@
struct nmgregion *r_p;
struct shell *s_p;
-
if (rt_g.NMG_debug & DEBUG_RT_ISECT)
bu_log("isect_ray_nmg: Pnt(%g %g %g) Dir(%g %g %g)\n",
rd->rp->r_pt[0],
@@ -2391,6 +2377,7 @@
rd->rp->r_dir[2]);
NMG_CK_MODEL(rd->rd_m);
+ NMG_CK_HITMISS_LISTS(rd);
/* Caller has assured us that the ray intersects the nmg model,
* check ray for intersecion with rpp's of nmgregion's
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits