Revision: 56612
          http://sourceforge.net/p/brlcad/code/56612
Author:   starseeker
Date:     2013-08-06 02:17:27 +0000 (Tue, 06 Aug 2013)
Log Message:
-----------
Take another stab at ensuring (!(a < b) && (b < a)) for the gdiam comparison 
operator...)

Modified Paths:
--------------
    brlcad/trunk/src/other/libgdiam/gdiam.cpp

Modified: brlcad/trunk/src/other/libgdiam/gdiam.cpp
===================================================================
--- brlcad/trunk/src/other/libgdiam/gdiam.cpp   2013-08-06 01:40:40 UTC (rev 
56611)
+++ brlcad/trunk/src/other/libgdiam/gdiam.cpp   2013-08-06 02:17:27 UTC (rev 
56612)
@@ -1445,6 +1445,14 @@
         len1 = base.dist( *a );
         len2 = base.dist( *b );
 
+       /* If sgn == 0 and len1 == len2, fall back on point x,y values,
+        * which thanks to the first a->equal(*b) check are not equal here.
+        * Need this to ensure that swapping a and b doesn't result
+        * in the same answer (i.e. no way to decide (!(a < b) && (b < a))
+        * for the sort) when those conditions are true. */
+       if ((sgn == 0) && (len1 == len2))
+          return  ( ( a->x > b->x )  &&  ( a->y > b->y ) );
+
         return (len1 > len2);
     }
 };

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


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to