Revision: 76729
          http://sourceforge.net/p/brlcad/code/76729
Author:   starseeker
Date:     2020-08-13 13:17:30 +0000 (Thu, 13 Aug 2020)
Log Message:
-----------
Losing added and removed objects with filters - rework the filtering selection.

Modified Paths:
--------------
    brlcad/trunk/src/gtools/gdiff/gdiff.c

Modified: brlcad/trunk/src/gtools/gdiff/gdiff.c
===================================================================
--- brlcad/trunk/src/gtools/gdiff/gdiff.c       2020-08-13 12:22:09 UTC (rev 
76728)
+++ brlcad/trunk/src/gtools/gdiff/gdiff.c       2020-08-13 13:17:30 UTC (rev 
76729)
@@ -55,9 +55,17 @@
        BU_PTBL_INIT(&results_filtered);
        for (i = 0; i < (int)BU_PTBL_LEN(&results); i++) {
            struct diff_result *dr = (struct diff_result 
*)BU_PTBL_GET(&results, i);
+           // Default to pass - if an object doesn't exist on one side, we 
want to pass/fail
+           // based on the object we have.
+           int lpass = 1;
+           int rpass = 1;
            // If both sides pass the filters, it's in - otherwise it's out
-           int lpass = (dr->dp_left  != RT_DIR_NULL && 
(bu_ptbl_locate(&left_dbip_filtered,  (long *)dr->dp_left ) != -1));
-           int rpass = (dr->dp_right != RT_DIR_NULL && 
(bu_ptbl_locate(&right_dbip_filtered, (long *)dr->dp_right) != -1));
+           if (dr->dp_left != RT_DIR_NULL) {
+               lpass = (bu_ptbl_locate(&left_dbip_filtered,  (long 
*)dr->dp_left ) != -1);
+           }
+           if (dr->dp_right != RT_DIR_NULL) {
+               rpass = (bu_ptbl_locate(&right_dbip_filtered, (long 
*)dr->dp_right) != -1);
+           }
            if (lpass && rpass) {
                bu_ptbl_ins(&results_filtered, (long *)dr);
                filtered_diff_state |= dr->param_state;

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to