Revision: 78159
http://sourceforge.net/p/brlcad/code/78159
Author: starseeker
Date: 2021-02-01 15:59:45 +0000 (Mon, 01 Feb 2021)
Log Message:
-----------
Sort by matrices first, then check apply_solid
Modified Paths:
--------------
brlcad/trunk/src/libged/npush/npush.cpp
Modified: brlcad/trunk/src/libged/npush/npush.cpp
===================================================================
--- brlcad/trunk/src/libged/npush/npush.cpp 2021-02-01 15:25:58 UTC (rev
78158)
+++ brlcad/trunk/src/libged/npush/npush.cpp 2021-02-01 15:59:45 UTC (rev
78159)
@@ -100,28 +100,13 @@
if (dp < o.dp) return true;
if (o.dp < dp) return false;
- // The application of the matrix to the solid may matter
- // when distinguishing dp_i instances, but only if one
- // of the matrices involved is non-IDN - otherwise, the
- // matrix applications are no-ops and we don't want them
- // to prompt multiple instances of objects.
- if (!(dp->d_flags & RT_DIR_COMB)) {
- if (apply_to_solid != o.apply_to_solid) {
- if (!bn_mat_is_equal(mat, bn_mat_identity, ts_tol) ||
- !bn_mat_is_equal(o.mat, bn_mat_identity, ts_tol)) {
- if (apply_to_solid && !o.apply_to_solid)
- return true;
- }
- }
- }
-
- /* If the dp doesn't tell us and the solid application doesn't tell
- * us, check the matrix. */
+ /* If the dp doesn't tell us, check the matrix. */
+ int tidn, oidn;
if (!bn_mat_is_equal(mat, o.mat, ts_tol)) {
// We want IDN matrices to be less than any others, regardless
// of the numerics.
- int tidn = bn_mat_is_equal(mat, bn_mat_identity, ts_tol);
- int oidn = bn_mat_is_equal(o.mat, bn_mat_identity, ts_tol);
+ tidn = bn_mat_is_equal(mat, bn_mat_identity, ts_tol);
+ oidn = bn_mat_is_equal(o.mat, bn_mat_identity, ts_tol);
if (tidn && !oidn) return true;
if (oidn && !tidn) return false;
@@ -137,6 +122,16 @@
}
}
+ // The application of the matrix to the solid may matter
+ // when distinguishing dp_i instances, but only if one
+ // of the matrices involved is non-IDN - otherwise, the
+ // matrix applications are no-ops and we don't want them
+ // to prompt multiple instances of objects.
+ if (!(dp->d_flags & RT_DIR_COMB)) {
+ if ((!tidn || !oidn) && (apply_to_solid && !o.apply_to_solid))
+ return true;
+ }
+
/* All attempt to find non-equalities failed */
return false;
}
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