Revision: 50652
          http://brlcad.svn.sourceforge.net/brlcad/?rev=50652&view=rev
Author:   d_rossberg
Date:     2012-05-24 13:22:17 +0000 (Thu, 24 May 2012)
Log Message:
-----------
apply sourceforge parch 3527658 (libbn_refactor_tolerance.diff) from kane_: 
"refactor and manage libbn tolerance uses by providing an interface default 
(e.g., an init macro) and making everyone use that where it is hardcoded to 
0.0005 presently"

Modified Paths:
--------------
    brlcad/trunk/include/bn.h
    brlcad/trunk/src/libbn/bntester.c
    brlcad/trunk/src/libbn/plane.c
    brlcad/trunk/src/libbn/tcl.c

Modified: brlcad/trunk/include/bn.h
===================================================================
--- brlcad/trunk/include/bn.h   2012-05-24 12:12:41 UTC (rev 50651)
+++ brlcad/trunk/include/bn.h   2012-05-24 13:22:17 UTC (rev 50652)
@@ -137,6 +137,11 @@
 #define BN_TOL_IS_INITIALIZED(_p) (((struct bn_tol *)(_p) != (struct bn_tol 
*)0) && LIKELY((_p)->magic == BN_TOL_MAGIC))
 
 /**
+ * replaces the hard coded tolerance value
+ */
+#define BN_TOL_DIST 0.0005
+
+/**
  * returns truthfully whether a given dot-product of two unspecified
  * vectors are within a specified parallel tolerance.
  */

Modified: brlcad/trunk/src/libbn/bntester.c
===================================================================
--- brlcad/trunk/src/libbn/bntester.c   2012-05-24 12:12:41 UTC (rev 50651)
+++ brlcad/trunk/src/libbn/bntester.c   2012-05-24 13:22:17 UTC (rev 50652)
@@ -180,7 +180,7 @@
 
     /* set initial values in tol structure */
     tol.magic = BN_TOL_MAGIC;
-    tol.dist = 0.0005;
+    tol.dist = BN_TOL_DIST;
     tol.dist_sq = tol.dist * tol.dist;
     tol.perp = 1e-6;
     tol.para = 1.0 - tol.perp;

Modified: brlcad/trunk/src/libbn/plane.c
===================================================================
--- brlcad/trunk/src/libbn/plane.c      2012-05-24 12:12:41 UTC (rev 50651)
+++ brlcad/trunk/src/libbn/plane.c      2012-05-24 13:22:17 UTC (rev 50652)
@@ -549,7 +549,7 @@
     if (tol->dist > 0.0)
        tol_dist = tol->dist;
     else
-       tol_dist = 0.0005;
+       tol_dist = BN_TOL_DIST;
 
     if (tol->dist_sq > 0.0)
        tol_dist_sq = tol->dist_sq;

Modified: brlcad/trunk/src/libbn/tcl.c
===================================================================
--- brlcad/trunk/src/libbn/tcl.c        2012-05-24 12:12:41 UTC (rev 50651)
+++ brlcad/trunk/src/libbn/tcl.c        2012-05-24 13:22:17 UTC (rev 50652)
@@ -574,7 +574,7 @@
        vect_t dir, c;
        int i;
        static const struct bn_tol tol = {
-           BN_TOL_MAGIC, 0.0005, 0.0005*0.0005, 1e-6, 1-1e-6
+           BN_TOL_MAGIC, BN_TOL_DIST, BN_TOL_DIST*BN_TOL_DIST, 1e-6, 1-1e-6
        };
        if (argc != 5) {
            bu_vls_printf(&result,
@@ -614,7 +614,7 @@
        vect_t dir, c;
        int i;
        static const struct bn_tol tol = {
-           BN_TOL_MAGIC, 0.0005, 0.0005*0.0005, 1e-6, 1-1e-6
+           BN_TOL_MAGIC, BN_TOL_DIST, BN_TOL_DIST*BN_TOL_DIST, 1e-6, 1-1e-6
        };
 
        if (argc != 5) {

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to