Revision: 69076
          http://sourceforge.net/p/brlcad/code/69076
Author:   starseeker
Date:     2016-10-16 15:00:44 +0000 (Sun, 16 Oct 2016)
Log Message:
-----------
We're going to need an adapter layer if we want to separate this - it looks 
like nmg_isect_ray_model is probably the best point.

Modified Paths:
--------------
    brlcad/trunk/include/nmg.h
    brlcad/trunk/include/rt/nmg.h
    brlcad/trunk/src/librt/primitives/nmg/nmg.c

Modified: brlcad/trunk/include/nmg.h
===================================================================
--- brlcad/trunk/include/nmg.h  2016-10-16 14:28:31 UTC (rev 69075)
+++ brlcad/trunk/include/nmg.h  2016-10-16 15:00:44 UTC (rev 69076)
@@ -2406,8 +2406,10 @@
                                        struct model *m2);
 RT_EXPORT extern long nmg_find_max_index(const struct model *m);
 
+/* From nmg_rt_isect.c */
+RT_EXPORT extern const char * nmg_rt_inout_str(int code);
+
 #if 0
-/* From nmg_rt_isect.c */
 RT_EXPORT extern void nmg_rt_print_hitlist(struct bu_list *hd);
 
 RT_EXPORT extern void nmg_rt_print_hitmiss(struct nmg_hitmiss *a_hit);

Modified: brlcad/trunk/include/rt/nmg.h
===================================================================
--- brlcad/trunk/include/rt/nmg.h       2016-10-16 14:28:31 UTC (rev 69075)
+++ brlcad/trunk/include/rt/nmg.h       2016-10-16 15:00:44 UTC (rev 69076)
@@ -211,7 +211,7 @@
         BU_LIST_INIT(&rd->rd_hit); \
         BU_LIST_INIT(&rd->rd_miss); \
         nmg_debug |= DEBUG_NMGRT; \
-        nmg_isect_ray_model(rd,vlfree); \
+        rt_isect_ray_model(rd,vlfree); \
         (void) nmg_ray_segs(rd,vlfree); \
         bu_bomb("Should have bombed before this\n"); \
     }
@@ -224,17 +224,17 @@
 
 
 /* From nmg_rt_isect.c */
-RT_EXPORT extern void nmg_rt_print_hitlist(struct bu_list *hd);
+RT_EXPORT extern void rt_nmg_print_hitlist(struct bu_list *hd);
+RT_EXPORT extern void rt_nmg_print_hitmiss(struct hitmiss *a_hit);
+RT_EXPORT extern void rt_isect_ray_model(struct ray_data *rd, struct bu_list 
*vlfree);
 
-RT_EXPORT extern void nmg_rt_print_hitmiss(struct hitmiss *a_hit);
-
+RT_EXPORT extern void nmg_isect_ray_model(struct ray_data *rd, struct bu_list 
*vlfree);
 RT_EXPORT extern int nmg_class_ray_vs_shell(struct xray *rp,
-                                            const struct shell *s,
-                                            const int in_or_out_only,
-                                           struct bu_list *vlfree,
-                                            const struct bn_tol *tol);
+       const struct shell *s,
+       const int in_or_out_only,
+       struct bu_list *vlfree,
+       const struct bn_tol *tol);
 
-RT_EXPORT extern void nmg_isect_ray_model(struct ray_data *rd, struct bu_list 
*vlfree);
 
 /************************************************************************
  *                                                                      *

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg.c 2016-10-16 14:28:31 UTC (rev 
69075)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg.c 2016-10-16 15:00:44 UTC (rev 
69076)
@@ -363,10 +363,10 @@
     for (BU_LIST_FOR(hm, hitmiss, hd)) {
        if (hm == next_hit) {
            bu_log("======= ======\n");
-           nmg_rt_print_hitmiss(hm);
+           rt_nmg_print_hitmiss(hm);
            bu_log("================\n");
        } else
-           nmg_rt_print_hitmiss(hm);
+           rt_nmg_print_hitmiss(hm);
     }
 
     bu_log("topo table A\n");
@@ -411,7 +411,7 @@
     if (((a_hit->in_out & 0x0f0) >> 4) != NMG_RAY_STATE_OUTSIDE ||
        nmg_debug & DEBUG_RT_SEGS) {
        bu_log("check_hitstate()\n");
-       nmg_rt_print_hitlist(hd);
+       rt_nmg_print_hitlist(hd);
 
        bu_log("Ray: pt:(%g %g %g) dir:(%g %g %g)\n",
               V3ARGS(rd->rp->r_pt), V3ARGS(rd->rp->r_dir));
@@ -1187,10 +1187,10 @@
            for (BU_LIST_FOR(hm, hitmiss, &rd->rd_hit)) {
                if (hm == a_hit) {
                    bu_log("======= State %d ======\n", ray_state);
-                   nmg_rt_print_hitmiss(hm);
+                   rt_nmg_print_hitmiss(hm);
                    bu_log("================\n");
                } else
-                   nmg_rt_print_hitmiss(hm);
+                   rt_nmg_print_hitmiss(hm);
            }
 
            /* Now bomb off */
@@ -1275,7 +1275,7 @@
        bu_log("\n\nnmg_ray_segs(rd)\nsorted nmg/ray hit list\n");
 
        for (BU_LIST_FOR(a_hit, hitmiss, &rd->rd_hit))
-           nmg_rt_print_hitmiss(a_hit);
+           rt_nmg_print_hitmiss(a_hit);
     }
 
     last_miss = 0;
@@ -1289,7 +1289,7 @@
     if (nmg_debug & DEBUG_RT_SEGS) {
        bu_log("----------morphed nmg/ray hit list---------\n");
        for (BU_LIST_FOR(a_hit, hitmiss, &rd->rd_hit))
-           nmg_rt_print_hitmiss(a_hit);
+           rt_nmg_print_hitmiss(a_hit);
 
        pl_ray(rd);
     }
@@ -5873,6 +5873,49 @@
     return bot;
 }
 
+
+void
+rt_nmg_print_hitmiss(struct hitmiss *a_hit)
+{
+    NMG_CK_HITMISS(a_hit);
+
+    bu_log("   dist:%12g pt=(%f %f %f) %s=%p\n",
+          a_hit->hit.hit_dist,
+          a_hit->hit.hit_point[0],
+          a_hit->hit.hit_point[1],
+          a_hit->hit.hit_point[2],
+          bu_identify_magic(*(uint32_t *)a_hit->hit.hit_private),
+          (void *)a_hit->hit.hit_private
+       );
+    bu_log("\tstate:%s", nmg_rt_inout_str(a_hit->in_out));
+
+    switch (a_hit->start_stop) {
+       case NMG_HITMISS_SEG_IN:        bu_log(" SEG_START"); break;
+       case NMG_HITMISS_SEG_OUT:       bu_log(" SEG_STOP"); break;
+    }
+
+    VPRINT("\n\tin_normal", a_hit->inbound_norm);
+    VPRINT("\tout_normal", a_hit->outbound_norm);
+}
+void
+rt_nmg_print_hitlist(struct bu_list *hd)
+{
+    struct hitmiss *a_hit;
+
+    bu_log("nmg/ray hit list:\n");
+
+    for (BU_LIST_FOR(a_hit, hitmiss, hd)) {
+       rt_nmg_print_hitmiss(a_hit);
+    }
+}
+
+void
+rt_isect_ray_model(struct ray_data *rd, struct bu_list *vlfree)
+{
+    /* TODO - struct ray_data to struct nmg_ray_data, then back */
+    nmg_isect_ray_model(rd, vlfree);
+}
+
 /*
  * Local Variables:
  * mode: C

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