Revision: 56554
http://sourceforge.net/p/brlcad/code/56554
Author: brlcad
Date: 2013-08-05 04:20:33 +0000 (Mon, 05 Aug 2013)
Log Message:
-----------
normally might convert this to some #ifdev USE_* or DEBUG_* wrapping, but it's
really a substantial amount of debug printing code... can revert if this is
actively being used.
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/brep/brep.cpp
brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp
Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2013-08-05 04:10:34 UTC
(rev 56553)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2013-08-05 04:20:33 UTC
(rev 56554)
@@ -1209,27 +1209,7 @@
}
curr++;
}
-#if 0
- bu_log("**** After Pass1 Hits: %d\n", hits.size());
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != hits.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
-#endif
// check for crack hits between adjacent faces
curr = hits.begin();
while (curr != hits.end()) {
@@ -1283,31 +1263,7 @@
}
curr++;
}
-#if 0
- //debugging print
- bu_log("**** After Pass2 Hits: %d\n", hits.size());
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != hits.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
-
- bu_log("\n**********************\n");
-#endif
if ((hits.size() > 0) && ((hits.size() % 2) != 0)) {
brep_hit &curr_hit = hits.back();
if (curr_hit.hit == brep_hit::NEAR_MISS) {
@@ -1395,63 +1351,8 @@
}
curr++;
}
- // bu_log("**** After Pass2 Hits: %d\n", hits.size());
-#if 0
-// haven't checked for duplicate points so let's not do this yet
- if ((hits.size() > 0) && ((hits.size() % 2) != 0)) {
- brep_hit &curr_hit = hits.back();
- if (curr_hit.hit == brep_hit::NEAR_HIT) {
- hits.pop_back();
- }
- }
-#endif
}
-#if 0
- bu_log("**** After Pass3 Hits: %zu\n", hits.size());
-
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != hits.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
- bu_log("\n**** Orig Hits: %zu\n", orig.size());
-
- for (HitList::iterator i = orig.begin(); i != orig.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != orig.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
-
- bu_log("\n**********************\n");
-#endif
-
all_hits.clear();
all_hits = hits;
@@ -1557,214 +1458,9 @@
}
}
-#if 0
- if (hits.size() > 1 && (hits.size() % 2) != 0) {
- bu_log("**** ERROR odd number of hits: %d\n", hits.size());
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- brep_hit&out = *i;
- bu_log("(");
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("H");
- if ((out.hit == brep_hit::NEAR_HIT) || (out.hit ==
brep_hit::NEAR_MISS)) bu_log("c");
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- bu_log(")");
- }
- bu_log("\n");
-
- bu_log("xyz %g %g %g \n", rp->r_pt[0], rp->r_pt[1], rp->r_pt[2]);
- bu_log("dir %g %g %g \n", rp->r_dir[0], rp->r_dir[1], rp->r_dir[2]);
- if ((hits.size() % 2) != 0) {
- bu_log("**** Current Hits: %d\n", hits.size());
-
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != hits.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
- bu_log("\n**** Orig Hits: %d\n", orig.size());
-
- for (HitList::iterator i = orig.begin(); i != orig.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != orig.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- //bu_log("<%d>", out.sbv->m_face->m_bRev);
- VMOVE(prev, out.point);
- bu_log(")");
- }
-
- bu_log("\n**********************\n");
-
- }
- }
- point_t last_point;
- int hitCount = 0;
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- if (hitCount == 0) {
- TRACE2("point: " << i->point[0] << ", " << i->point[1] << ", " <<
i->point[2] << " dist_to_ray: " << DIST_PT_PT(i->point, rp->r_pt));
- } else {
- TRACE2("point: " << i->point[0] << ", " << i->point[1] << ", " <<
i->point[2] << " dist_to_ray: " << DIST_PT_PT(i->point, rp->r_pt) << "
dist_to_last_point: " << DIST_PT_PT(i->point, last_point));
- }
- VMOVE(last_point, i->point);
- hitCount += 1;
- }
-#ifdef PLOTTING
- pcount++;
- if (pcount > -1) {
- point_t ray;
- point_t vscaled;
- VSCALE(vscaled, rp->r_dir, 100);
- VADD2(ray, rp->r_pt, vscaled);
- COLOR_PLOT(200, 200, 200);
- LINE_PLOT(rp->r_pt, ray);
- }
-#endif
- all_hits.clear();
- all_hits = hits;
-
- num = 0;
- MissList::iterator m = misses.begin();
- for (HitList::iterator i = all_hits.begin(); i != all_hits.end(); ++i) {
-
-#ifdef PLOTTING
- if (pcount > -1) {
- // set the color of point and normal
- if (i->trimmed && i->closeToEdge) {
- COLOR_PLOT(0, 0, 255); // blue is trimmed but close to edge
- } else if (i->trimmed) {
- COLOR_PLOT(255, 255, 0); // yellow trimmed
- } else if (i->oob) {
- COLOR_PLOT(255, 0, 0); // red is oob
- } else if (NEAR_ZERO(VDOT(i->normal, rp->r_dir), RT_DOT_TOL)) {
- COLOR_PLOT(0, 255, 255); // purple is grazing
- } else {
- COLOR_PLOT(0, 255, 0); // green is regular surface
- }
-
- // draw normal
- point_t v;
- VADD2(v, i->point, i->normal);
- LINE_PLOT(i->point, v);
-
- // draw intersection
- PT_PLOT(i->point);
-
- // draw bounding box
- BB_PLOT(i->sbv->m_node.m_min, i->sbv->m_node.m_max);
- }
-#endif
-
- TRACE("hit " << num << ": " << ON_PRINT3(i->point) << " [" << dot <<
"]");
- while ((m != misses.end()) && (m->first == num)) {
- static int reasons = 0;
- if (reasons < 100) {
- reasons++;
- TRACE("miss " << num << ": " <<
BREP_INTERSECT_REASON(m->second));
- } else {
- static int quelled = 0;
- if (!quelled) {
- TRACE("Too many reasons. Suppressing further output." <<
std::endl);
- quelled = 1;
- }
- }
- ++m;
- }
- num++;
- }
- while (m != misses.end()) {
- static int reasons = 0;
- if (reasons < 100) {
- reasons++;
- TRACE("miss " << BREP_INTERSECT_REASON(m->second));
- } else {
- static int quelled = 0;
- if (!quelled) {
- TRACE("Too many reasons. Suppressing further output." <<
std::endl);
- quelled = 1;
- }
- }
- ++m;
- }
-#endif
-
bool hit = false;
if (hits.size() > 1) {
-#if 0
- if (false) {
- //TRACE2("screen xy: " << ap->a_x << ", " << ap->a_y);
- bu_log("**** ERROR odd number of hits: %d\n", hits.size());
- bu_log("xyz %g %g %g \n", rp->r_pt[0], rp->r_pt[1], rp->r_pt[2]);
- bu_log("dir %g %g %g \n", rp->r_dir[0], rp->r_dir[1], rp->r_dir[2]);
- bu_log("**** Current Hits: %d\n", hits.size());
-
- for (HitList::iterator i = hits.begin(); i != hits.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != hits.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- VMOVE(prev, out.point);
- bu_log(")");
- }
- bu_log("\n**** Orig Hits: %d\n", orig.size());
-
- for (HitList::iterator i = orig.begin(); i != orig.end(); ++i) {
- point_t prev;
-
- brep_hit &out = *i;
-
- if (i != orig.begin()) {
- bu_log("<%g>", DIST_PT_PT(out.point, prev));
- }
- bu_log("(");
- if (out.hit == brep_hit::CRACK_HIT) bu_log("_CRACK_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::CLEAN_HIT) bu_log("_CH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_HIT) bu_log("_NH_(%d)",
out.face.m_face_index);
- if (out.hit == brep_hit::NEAR_MISS) bu_log("_NM_(%d)",
out.face.m_face_index);
- if (out.direction == brep_hit::ENTERING) bu_log("+");
- if (out.direction == brep_hit::LEAVING) bu_log("-");
- bu_log("<%d>", out.sbv->m_face->m_bRev);
- VMOVE(prev, out.point);
- bu_log(")");
- }
-
- bu_log("\n**********************\n");
- }
-#endif
-
//#define KODDHIT
#ifdef KODDHIT //ugly debugging hack to raytrace single surface and not worry
about odd hits
static fastf_t diststep = 0.0;
Modified: brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp 2013-08-05
04:10:34 UTC (rev 56553)
+++ brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp 2013-08-05
04:20:33 UTC (rev 56554)
@@ -2098,8 +2098,6 @@
if (node->m_trimmed) {
return; // nothing to do node is trimmed
} else if (node->m_checkTrim) { // node may contain trim check all
corners
-
-#if 1
fastf_t u = node->m_u[0];
fastf_t v = node->m_v[0];
fastf_t from = u;
@@ -2114,7 +2112,7 @@
drawisoVCheckForTrim(st, vbp, from, to, u, 3); //left
u = node->m_u[1];
drawisoVCheckForTrim(st, vbp, from, to, u, 3); //right
-#endif
+
return;
} else { // fully untrimmed just draw bottom and right edges
fastf_t u = node->m_u[0];
@@ -2162,12 +2160,8 @@
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
SurfaceTree* st = new SurfaceTree(&face, true, 0);
-#if 0
- plotFace(st, vbp, plotres, plotres);
-#else
plottrim(face, vbp, plotres, true);
plotFaceFromSurfaceTree(st, vbp, plotres, plotres);
-#endif
delete st;
}
} else if (index < brep->m_F.Count()) {
@@ -2175,12 +2169,8 @@
if (index < faces.Count()) {
ON_BrepFace& face = faces[index];
SurfaceTree* st = new SurfaceTree(&face, true, 0);
-#if 0
- plotFace(st, vbp, plotres, plotres);
-#else
plottrim(face, vbp, plotres, true);
plotFaceFromSurfaceTree(st, vbp, plotres, plotres);
-#endif
delete st;
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits