summaryrefslogtreecommitdiff
path: root/basegfx/inc/basegfx/numeric
diff options
context:
space:
mode:
Diffstat (limited to 'basegfx/inc/basegfx/numeric')
-rw-r--r--basegfx/inc/basegfx/numeric/ftools.hxx145
1 files changed, 71 insertions, 74 deletions
diff --git a/basegfx/inc/basegfx/numeric/ftools.hxx b/basegfx/inc/basegfx/numeric/ftools.hxx
index 4a8287ff164c..9ae52843cfe0 100644
--- a/basegfx/inc/basegfx/numeric/ftools.hxx
+++ b/basegfx/inc/basegfx/numeric/ftools.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftools.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2003-11-26 14:39:52 $
+ * last change: $Author: aw $ $Date: 2003-11-28 11:17:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,80 +100,77 @@
namespace basegfx
{
- namespace numeric
+ class fTools
{
- class fTools
+ static double mfSmallValue;
+
+ public:
+ static double getSmallValue() { return mfSmallValue; }
+ static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; }
+
+
+ static sal_Bool equalZero(const double& rfVal)
+ {
+ return (fabs(rfVal) <= getSmallValue());
+ }
+
+ static sal_Bool equalZero(const double& rfVal, const double& rfSmallValue)
+ {
+ return (fabs(rfVal) <= rfSmallValue);
+ }
+
+
+ static sal_Bool equal(const double& rfValA, const double& rfValB)
+ {
+ return (fabs(rfValB - rfValA) <= getSmallValue());
+ }
+
+ static sal_Bool less(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA < rfValB && !equal(rfValA, rfValB));
+ }
+
+ static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA < rfValB || equal(rfValA, rfValB));
+ }
+
+ static sal_Bool more(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA > rfValB && !equal(rfValA, rfValB));
+ }
+
+ static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB)
+ {
+ return (rfValA > rfValB || equal(rfValA, rfValB));
+ }
+
+
+ static sal_Bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ {
+ return (fabs(rfValB - rfValA) <= rfSmallValue);
+ }
+
+ static sal_Bool less(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ {
+ return (rfValA < rfValB && !equal(rfValA, rfValB, rfSmallValue));
+ }
+
+ static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ {
+ return (rfValA < rfValB || equal(rfValA, rfValB, rfSmallValue));
+ }
+
+ static sal_Bool more(const double& rfValA, const double& rfValB, const double& rfSmallValue)
+ {
+ return (rfValA > rfValB && !equal(rfValA, rfValB, rfSmallValue));
+ }
+
+ static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
{
- static double mfSmallValue;
-
- public:
- static double getSmallValue() { return mfSmallValue; }
- static void setSmallValue(const double& rfNew) { mfSmallValue = rfNew; }
-
-
- static sal_Bool equalZero(const double& rfVal)
- {
- return (fabs(rfVal) <= getSmallValue());
- }
-
- static sal_Bool equalZero(const double& rfVal, const double& rfSmallValue)
- {
- return (fabs(rfVal) <= rfSmallValue);
- }
-
-
- static sal_Bool equal(const double& rfValA, const double& rfValB)
- {
- return (fabs(rfValB - rfValA) <= getSmallValue());
- }
-
- static sal_Bool less(const double& rfValA, const double& rfValB)
- {
- return (rfValA < rfValB && !equal(rfValA, rfValB));
- }
-
- static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB)
- {
- return (rfValA < rfValB || equal(rfValA, rfValB));
- }
-
- static sal_Bool more(const double& rfValA, const double& rfValB)
- {
- return (rfValA > rfValB && !equal(rfValA, rfValB));
- }
-
- static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB)
- {
- return (rfValA > rfValB || equal(rfValA, rfValB));
- }
-
-
- static sal_Bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue)
- {
- return (fabs(rfValB - rfValA) <= rfSmallValue);
- }
-
- static sal_Bool less(const double& rfValA, const double& rfValB, const double& rfSmallValue)
- {
- return (rfValA < rfValB && !equal(rfValA, rfValB, rfSmallValue));
- }
-
- static sal_Bool lessOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
- {
- return (rfValA < rfValB || equal(rfValA, rfValB, rfSmallValue));
- }
-
- static sal_Bool more(const double& rfValA, const double& rfValB, const double& rfSmallValue)
- {
- return (rfValA > rfValB && !equal(rfValA, rfValB, rfSmallValue));
- }
-
- static sal_Bool moreOrEqual(const double& rfValA, const double& rfValB, const double& rfSmallValue)
- {
- return (rfValA > rfValB || equal(rfValA, rfValB, rfSmallValue));
- }
- };
- } // end of namespace numeric
+ return (rfValA > rfValB || equal(rfValA, rfValB, rfSmallValue));
+ }
+ };
} // end of namespace basegfx
#endif _BGFX_NUMERIC_FTOOLS_HXX