Revision: 69093
          http://sourceforge.net/p/brlcad/code/69093
Author:   starseeker
Date:     2016-10-16 22:57:57 +0000 (Sun, 16 Oct 2016)
Log Message:
-----------
nmg_stash_model_to_file appears to be used for debugging, but its not viable in 
a libnmg breakout because it relies heavily on the librt db io routines.  if we 
need this in libnmg, we'll have to come up with a different solution.

Modified Paths:
--------------
    brlcad/trunk/include/nmg.h
    brlcad/trunk/include/rt/nmg.h
    brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_class.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c
    brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c

Modified: brlcad/trunk/include/nmg.h
===================================================================
--- brlcad/trunk/include/nmg.h  2016-10-16 22:48:54 UTC (rev 69092)
+++ brlcad/trunk/include/nmg.h  2016-10-16 22:57:57 UTC (rev 69093)
@@ -1718,9 +1718,6 @@
                                                 const struct bn_tol *tol);
 RT_EXPORT extern int nmg_decompose_shell(struct shell *s, struct bu_list 
*vlfree,
                                          const struct bn_tol *tol);
-RT_EXPORT extern void nmg_stash_model_to_file(const char *filename,
-                                              const struct model *m,
-                                              const char *title);
 RT_EXPORT extern int nmg_unbreak_region_edges(uint32_t *magic_p, struct 
bu_list *vlfree);
 RT_EXPORT extern void nmg_vlist_to_eu(struct bu_list *vlist,
                                       struct shell *s);

Modified: brlcad/trunk/include/rt/nmg.h
===================================================================
--- brlcad/trunk/include/rt/nmg.h       2016-10-16 22:48:54 UTC (rev 69092)
+++ brlcad/trunk/include/rt/nmg.h       2016-10-16 22:57:57 UTC (rev 69093)
@@ -198,6 +198,12 @@
                                      const struct bn_tol *tol);
 
 
+/* nmg.c */
+RT_EXPORT extern void nmg_stash_model_to_file(const char *filename,
+                                              const struct model *m,
+                                              const char *title);
+
+
 #endif
 
 __END_DECLS

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2016-10-16 22:48:54 UTC 
(rev 69092)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2016-10-16 22:57:57 UTC 
(rev 69093)
@@ -242,33 +242,6 @@
 
 
 HIDDEN void
-stash_shell(struct shell *s, char *file_name, char *title, const struct bn_tol 
*tol)
-{
-    struct model *m;
-    struct nmgregion *r;
-    struct shell *new_s;
-    struct faceuse *fu;
-    char counted_name[256];
-
-    m = nmg_mm();
-    r = nmg_mrsv(m);
-    new_s = BU_LIST_FIRST(shell, &r->s_hd);
-
-    for (BU_LIST_FOR(fu, faceuse, &s->fu_hd)) {
-       if (fu->orientation != OT_SAME)
-           continue;
-
-       (void)nmg_dup_face(fu, new_s);
-    }
-
-    nmg_rebound(m, tol);
-    snprintf(counted_name, 256, "%s%d.g", file_name, debug_file_count);
-    nmg_stash_model_to_file(counted_name, m, title);
-    nmg_km(m);
-}
-
-
-HIDDEN void
 nmg_kill_non_common_cracks(struct shell *sA, struct shell *sB)
 {
     struct faceuse *fu;
@@ -783,15 +756,12 @@
        char file_name[256];
 
        sprintf(file_name, "before%d.g", debug_file_count);
-       nmg_stash_model_to_file(file_name, m, "Before crackshells");
     }
 
     /* Perform shell/shell intersections */
     nmg_crackshells(sA, sB, vlfree, tol);
 
     if (nmg_debug & DEBUG_BOOL) {
-       stash_shell(sA, "a1_", "sA", tol);
-       stash_shell(sB, "b1_", "sB", tol);
        bu_log("Just After Crackshells:\nShell A:\n");
        nmg_pr_s_briefly(sA, 0);
        bu_log("Just After Crackshells:\nShell B:\n");
@@ -854,7 +824,6 @@
            bu_log("nmg_bool(): Dangling faces detected in model before 
classification\n");
        }
        if (dangle_error) {
-           nmg_stash_model_to_file("dangle.g", m, "After Boolean");
            bu_bomb("nmg_bool(): Dangling faces detected before 
classification\n");
        }
     }
@@ -875,7 +844,6 @@
        char file_name[256];
 
        sprintf(file_name, "notjoined%d.g", debug_file_count);
-       nmg_stash_model_to_file(file_name, m, "Before s_join_touchingloops");
     }
 
     /* Re-build bounding boxes, edge geometry, as needed. */
@@ -883,9 +851,6 @@
     nmg_shell_a(sB, tol);
 
     if (nmg_debug & DEBUG_BOOL) {
-       stash_shell(sA, "a", "sA", tol);
-       stash_shell(sB, "b", "sB", tol);
-
        bu_log("sA:\n");
        nmg_pr_s_briefly(sA, 0);
        bu_log("sB:\n");
@@ -896,7 +861,6 @@
        char file_name[256];
 
        sprintf(file_name, "after%d.g", debug_file_count);
-       nmg_stash_model_to_file(file_name, m, "After crackshells");
     }
 
     if (nmg_debug & DEBUG_BOOL) {
@@ -1042,7 +1006,6 @@
                bu_log("nmg_bool(): Dangling faces detected in m after 
boolean\n");
            }
            if (dangle_error) {
-               nmg_stash_model_to_file("dangle.g", m, "After Boolean");
                bu_bomb("nmg_bool(): Dangling faces detected after boolean\n");
            }
        } else {
@@ -1088,7 +1051,6 @@
        if (nmg_debug & DEBUG_BOOL) {
            char tmp_name[256];
            sprintf(tmp_name, "after_bool_%d.g", debug_file_count);
-           nmg_stash_model_to_file(tmp_name, m, "After Boolean");
        }
     }
 

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c      2016-10-16 22:48:54 UTC 
(rev 69092)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c      2016-10-16 22:57:57 UTC 
(rev 69093)
@@ -1309,8 +1309,6 @@
                     p[0], p[1], p[2], q[0], q[1], q[2]);
 
            snprintf(file, 128, "radial%d.g", num++);
-           nmg_stash_model_to_file(file,
-                                   nmg_find_model(&(fu->l.magic)), buf);
 
            nmg_pr_fu_around_eu(eu_orig, tol);
 

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_class.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2016-10-16 22:48:54 UTC 
(rev 69092)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2016-10-16 22:57:57 UTC 
(rev 69093)
@@ -1636,7 +1636,6 @@
                    bu_log("wrote %s\n", buf);
                }
                nmg_pr_lu(lu, "");
-               nmg_stash_model_to_file("class.g", nmg_find_model((uint32_t 
*)lu), "class_ls_vs_s: loop transits plane of shell/face?");
                bu_free((char *)b, "nmg_pl_lu flag[]");
            }
 

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c     2016-10-16 22:48:54 UTC 
(rev 69092)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c     2016-10-16 22:57:57 UTC 
(rev 69093)
@@ -3214,7 +3214,6 @@
     /* If we ever get here, we have failed to find a way to split this 
loop!!!! */
     bu_log("nmg_loop_split_at_touching_jaunt: Could not find a way to split lu 
%p\n", (void *)lu);
     nmg_pr_lu_briefly(lu, " ");
-    nmg_stash_model_to_file("jaunt.g", nmg_find_model(&lu->l.magic), "Can't 
split lu");
     bu_bomb("nmg_loop_split_at_touching_jaunt: Can't split lu\n");
 
     /* This return will never execute, but the compilers like it */

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c     2016-10-16 22:48:54 UTC 
(rev 69092)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c     2016-10-16 22:57:57 UTC 
(rev 69093)
@@ -1130,8 +1130,6 @@
            pdv_3line(fp, p2->vu_p->v_p->vg_p->coord, cut_end);
 
            (void)fclose(fp);
-           nmg_stash_model_to_file("bad_tri_cut.g",
-                                   nmg_find_model(&p1->vu_p->l.magic), buf);
 
            bu_bomb("cut_mapped_loop() goodnight 3\n");
        }
@@ -1977,7 +1975,6 @@
 
        my_m2 = nmg_find_model(lu_tmp->up.magic_p);
        NMG_CK_MODEL(my_m2);
-       nmg_stash_model_to_file("holes_removed.g", my_m2, "holes_removed");
     }
 #endif
 
@@ -2437,7 +2434,6 @@
                eu = BU_LIST_FIRST(edgeuse, 
&(current->vu_p->up.eu_p->up.lu_p->down_hd));
                nmg_plot_lu_around_eu("cut_unimonotone_infinite_loopuse", eu, 
vlfree, tol);
                m = nmg_find_model(current->vu_p->up.eu_p->up.lu_p->up.magic_p);
-               nmg_stash_model_to_file("cut_unimonotone_infinite_model.g", m, 
"cut_unimonotone_infinite_model");
                nmg_pr_lu(current->vu_p->up.eu_p->up.lu_p, 
"cut_unimonotone_loopuse");
                nmg_plot_fu("cut_unimonotone_infinite_loopuse", 
current->vu_p->up.eu_p->up.lu_p->up.fu_p, tol);
            }
@@ -3678,9 +3674,6 @@
 
     if (nmg_debug & DEBUG_TRI) {
        sprintf(db_name, "uni%d.g", iter);
-       nmg_stash_model_to_file(db_name,
-                               nmg_find_model(&fu->s_p->l.magic),
-                               "triangles and unimonotones");
     }
 
     for (BU_LIST_FOR(lu, loopuse, &fu->lu_hd))
@@ -3688,9 +3681,6 @@
 
     if (nmg_debug & DEBUG_TRI) {
        sprintf(db_name, "uni_sj%d.g", iter);
-       nmg_stash_model_to_file(db_name,
-                               nmg_find_model(&fu->s_p->l.magic),
-                               "after split_at_touching_jaunt");
     }
 
     for (BU_LIST_FOR(lu, loopuse, &fu->lu_hd))
@@ -3698,9 +3688,6 @@
 
     if (nmg_debug & DEBUG_TRI) {
        sprintf(db_name, "uni_split%d.g", iter++);
-       nmg_stash_model_to_file(db_name,
-                               nmg_find_model(&fu->s_p->l.magic),
-                               "split triangles and unimonotones");
     }
 
     /* now we're left with a face that has some triangle loops and some
@@ -3724,9 +3711,6 @@
 
                    if (nmg_debug & DEBUG_TRI) {
                        sprintf(db_name, "uni_mono%d.g", monotone++);
-                       nmg_stash_model_to_file(db_name,
-                                               
nmg_find_model(&fu->s_p->l.magic),
-                                               "newly cut unimonotone");
                    }
 
                    break;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to