Only output debug info in DEBUG builds

customizer
Marius Kintel 2014-01-06 02:16:33 -05:00
parent aa6fe1eb2b
commit dc8da819da
1 changed files with 12 additions and 0 deletions

View File

@ -776,9 +776,13 @@ public:
// Estimating same # of vertices as polygons (very rough) // Estimating same # of vertices as polygons (very rough)
B.begin_surface(ps.polygons.size(), ps.polygons.size()); B.begin_surface(ps.polygons.size(), ps.polygons.size());
int pidx = 0; int pidx = 0;
#ifdef DEBUG
printf("polyhedron(faces=["); printf("polyhedron(faces=[");
#endif
BOOST_FOREACH(const PolySet::Polygon &p, ps.polygons) { BOOST_FOREACH(const PolySet::Polygon &p, ps.polygons) {
#ifdef DEBUG
if (pidx++ > 0) printf(","); if (pidx++ > 0) printf(",");
#endif
indices.clear(); indices.clear();
BOOST_FOREACH(const Vector3d &v, p) { BOOST_FOREACH(const Vector3d &v, p) {
size_t s = vertices.size(); size_t s = vertices.size();
@ -794,19 +798,26 @@ public:
} }
if (!facet_is_degenerate) { if (!facet_is_degenerate) {
B.begin_facet(); B.begin_facet();
#ifdef DEBUG
printf("["); printf("[");
#endif
int fidx = 0; int fidx = 0;
std::map<int,int> fc; std::map<int,int> fc;
BOOST_REVERSE_FOREACH(size_t i, indices) { BOOST_REVERSE_FOREACH(size_t i, indices) {
B.add_vertex_to_facet(i); B.add_vertex_to_facet(i);
#ifdef DEBUG
if (fidx++ > 0) printf(","); if (fidx++ > 0) printf(",");
printf("%ld", i); printf("%ld", i);
#endif
} }
#ifdef DEBUG
printf("]"); printf("]");
#endif
B.end_facet(); B.end_facet();
} }
} }
B.end_surface(); B.end_surface();
#ifdef DEBUG
printf("],\n"); printf("],\n");
printf("points=["); printf("points=[");
@ -816,6 +827,7 @@ public:
printf("[%g,%g,%g]", v[0], v[1], v[2]); printf("[%g,%g,%g]", v[0], v[1], v[2]);
} }
printf("]);\n"); printf("]);\n");
#endif
} }
}; };