diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-11-02 12:57:23 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-11-02 12:57:23 +0000 |
commit | d59d62c7e47a81433482a2e85636cc966dbd08f0 (patch) | |
tree | 9562ca9b9df9b2c05f7cbe0587cc4dd375f79097 /basegfx/source/point | |
parent | 57fedca0475ab984abcd0dcfa3d918cc3dd53055 (diff) |
INTEGRATION: CWS canvas02 (1.1.58); FILE MERGED
2005/10/08 13:18:13 thb 1.1.58.2: RESYNC: (1.1-1.2); FILE MERGED
2005/07/28 10:10:19 thb 1.1.58.1: Join from cws_src680_aw024: #i48939# and new rendering subsystem need AW's clipper changes
Diffstat (limited to 'basegfx/source/point')
-rw-r--r-- | basegfx/source/point/b3ipoint.cxx | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/basegfx/source/point/b3ipoint.cxx b/basegfx/source/point/b3ipoint.cxx index 34a6b0003758..907bc3203240 100644 --- a/basegfx/source/point/b3ipoint.cxx +++ b/basegfx/source/point/b3ipoint.cxx @@ -4,9 +4,9 @@ * * $RCSfile: b3ipoint.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:45:02 $ + * last change: $Author: kz $ $Date: 2005-11-02 13:57:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -41,24 +41,50 @@ #include <basegfx/matrix/b3dhommatrix.hxx> #endif +#ifndef _BGFX_NUMERIC_FTOOLS_HXX #include <basegfx/numeric/ftools.hxx> +#endif namespace basegfx { B3IPoint& B3IPoint::operator*=( const ::basegfx::B3DHomMatrix& rMat ) { - mnX = fround(rMat.get(0,0)*mnX + - rMat.get(0,1)*mnY + - rMat.get(0,2)*mnZ + - rMat.get(0,3)); - mnY = fround(rMat.get(1,0)*mnX + - rMat.get(1,1)*mnY + - rMat.get(1,2)*mnZ + - rMat.get(1,3)); - mnZ = fround(rMat.get(2,0)*mnX + - rMat.get(2,1)*mnY + - rMat.get(2,2)*mnZ + - rMat.get(2,3)); + double fTempX( + rMat.get(0, 0) * mnX + + rMat.get(0, 1) * mnY + + rMat.get(0, 2) * mnZ + + rMat.get(0, 3)); + double fTempY( + rMat.get(1, 0) * mnX + + rMat.get(1, 1) * mnY + + rMat.get(1, 2) * mnZ + + rMat.get(1, 3)); + double fTempZ( + rMat.get(2, 0) * mnX + + rMat.get(2, 1) * mnY + + rMat.get(2, 2) * mnZ + + rMat.get(2, 3)); + + if(!rMat.isLastLineDefault()) + { + const double fOne(1.0); + const double fTempM( + rMat.get(3, 0) * mnX + + rMat.get(3, 1) * mnY + + rMat.get(3, 2) * mnZ + + rMat.get(3, 3)); + + if(!fTools::equalZero(fTempM) && !fTools::equal(fOne, fTempM)) + { + fTempX /= fTempM; + fTempY /= fTempM; + fTempZ /= fTempM; + } + } + + mnX = fround(fTempX); + mnY = fround(fTempY); + mnZ = fround(fTempZ); return *this; } |