Revision: 54154
http://brlcad.svn.sourceforge.net/brlcad/?rev=54154&view=rev
Author: starseeker
Date: 2013-01-11 03:55:02 +0000 (Fri, 11 Jan 2013)
Log Message:
-----------
Need to be able to run brep on invalid geometry, for debugging - don't bail if
it isn't valid, just print the message.
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-01-11 03:27:23 UTC
(rev 54153)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2013-01-11 03:55:02 UTC
(rev 54154)
@@ -2973,7 +2973,7 @@
//archive.Dump3dmChunk(dump);
model.Read(archive, &dump);
- if (model.IsValid(&dump)) {
+ //if (model.IsValid(&dump)) {
ONX_Model_Object mo = model.m_object_table[0];
// XXX does openNURBS force us to copy? it seems the answer is
// YES due to the const-ness
@@ -2994,9 +2994,9 @@
}
}
return 0;
- } else {
- return -1;
- }
+ //} else {
+ // return -1;
+ //}
}
Modified: brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp 2013-01-11
03:27:23 UTC (rev 54153)
+++ brlcad/trunk/src/librt/primitives/brep/brep_debug.cpp 2013-01-11
03:55:02 UTC (rev 54154)
@@ -788,9 +788,11 @@
ON_wString wonstr;
ON_TextLog info_output(wonstr);
ON_Brep *brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&info_output)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&info_output)) {
bu_log("brep is NOT valid");
- return -1;
}
if ((si >= 0) && (si < brep->m_S.Count())) {
const ON_Surface* srf = brep->m_S[si];
@@ -830,10 +832,13 @@
ON_wString wonstr;
ON_TextLog info_output(wonstr);
ON_Brep *brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&info_output)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&info_output)) {
bu_log("brep is NOT valid");
- return -1;
}
+
if ((si >= 0) && (si < brep->m_S.Count())) {
const ON_Surface* srf = brep->m_S[si];
if (srf) {
@@ -894,10 +899,13 @@
ON_wString s;
ON_TextLog dump(s);
ON_Brep *brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&dump)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&dump)) {
bu_log("brep is NOT valid");
- return -1;
}
+
if (!((fi >= 0) && (fi < brep->m_F.Count())))
return 0;
//ON_wString s;
@@ -1035,10 +1043,13 @@
ON_Brep* brep = bs->brep;
ON_wString wstr;
ON_TextLog dump(wstr);
- if (brep == NULL || !brep->IsValid(&dump)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&dump)) {
bu_log("brep is NOT valid");
- return -1;
- } else {
+ }
+
if (!((ti >= 0) && (ti < brep->m_T.Count())))
return 0;
const ON_BrepTrim &trim = brep->m_T[ti];
@@ -1120,7 +1131,7 @@
dump.Print("NURBS form of 2d_curve(trim)\n");
nc2->Dump(dump);
delete nc2;
- }
+
ON_String ss = wstr;
bu_vls_printf(vls, "%s\n", ss.Array());
return 0;
@@ -1133,10 +1144,13 @@
ON_Brep* brep = bs->brep;
ON_wString wstr;
ON_TextLog dump(wstr);
- if (brep == NULL || !brep->IsValid(&dump)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&dump)) {
bu_log("brep is NOT valid");
- return -1;
- } else {
+ }
+
if (!((ti >= 0) && (ti < brep->m_T.Count())))
return 0;
const ON_BrepTrim &trim = brep->m_T[ti];
@@ -1162,7 +1176,6 @@
delete bezier;
}
delete nc2;
- }
ON_String ss = wstr;
bu_vls_printf(vls, "%s\n", ss.Array());
return 0;
@@ -1175,10 +1188,13 @@
ON_Brep* brep = bs->brep;
ON_wString wstr;
ON_TextLog dump(wstr);
- if (brep == NULL || !brep->IsValid(&dump)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&dump)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (!((ei >= 0) && (ei < brep->m_E.Count())))
return 0;
const ON_BrepEdge &edge = brep->m_E[ei];
@@ -1205,7 +1221,7 @@
dump.Print("NURBS form of 3d_curve(edge) \n");
nc3->Dump(dump);
delete nc3;
- }
+
ON_String ss = wstr;
bu_vls_printf(vls, "%s\n", ss.Array());
return 0;
@@ -1219,10 +1235,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
@@ -1242,7 +1261,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1254,10 +1272,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
@@ -1273,7 +1294,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1285,10 +1305,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_S.Count(); index++) {
ON_Surface *surf = brep->m_S[index];
@@ -1301,7 +1324,7 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
+
return 0;
}
@@ -1313,10 +1336,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_S.Count(); index++) {
ON_Surface *surf = brep->m_S[index];
@@ -1331,7 +1357,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1343,10 +1368,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_S.Count(); index++) {
ON_Surface *surf = brep->m_S[index];
@@ -1359,7 +1387,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1371,10 +1398,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
int num_curves = brep->m_C3.Count();
for (index = 0; index < num_curves; index++) {
@@ -1388,7 +1418,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1400,10 +1429,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
int num_trims = brep->m_T.Count();
for (index = 0; index < num_trims; index++) {
@@ -1416,7 +1448,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -1428,10 +1459,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_S.Count(); index++) {
ON_Surface *surf = brep->m_S[index];
@@ -1507,7 +1541,6 @@
}
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -2020,10 +2053,12 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
if (index == -1) {
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
@@ -2052,7 +2087,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -2064,10 +2098,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
@@ -2084,7 +2121,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
@@ -2096,10 +2132,13 @@
ON_TextLog tl(wstr);
ON_Brep* brep = bs->brep;
- if (brep == NULL || !brep->IsValid(&tl)) {
+ if (brep == NULL) {
+ return -1;
+ }
+ if (!brep->IsValid(&tl)) {
bu_log("brep is NOT valid");
- //return -1;
- } else {
+ }
+
if (index == -1) {
for (index = 0; index < brep->m_F.Count(); index++) {
ON_BrepFace& face = brep->m_F[index];
@@ -2116,7 +2155,6 @@
}
bu_vls_printf(vls, ON_String(wstr).Array());
- }
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits