summaryrefslogtreecommitdiff
path: root/basegfx/inc/basegfx/numeric
diff options
context:
space:
mode:
authorArmin Weiss <aw@openoffice.org>2003-11-28 10:18:16 +0000
committerArmin Weiss <aw@openoffice.org>2003-11-28 10:18:16 +0000
commitd539c95155ccc7030411f7494704894a3ac610a8 (patch)
treedc3dbd283a5f501f6e48dd585d80bb158db920e3 /basegfx/inc/basegfx/numeric
parentce0ce72d1fd37f7b8e7cb4ebc372d8cd6b4ab9c0 (diff)
Removed in-between namespaces (curve, matrix, numeric, point, polygon, range, tuple, vector). Names were too common and e.g. vector leaded to problems with some defines. This is now avoided. Also some bug fixes, addition of 3d polygon tooling etc.
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