diff options
author | Armin Weiss <aw@openoffice.org> | 2003-11-26 13:40:18 +0000 |
---|---|---|
committer | Armin Weiss <aw@openoffice.org> | 2003-11-26 13:40:18 +0000 |
commit | 56f2ab808ec8b0ce9aed1acd042123b87006ad60 (patch) | |
tree | 647130c86bd40c589a4a555ea24aac497ca7029a /basegfx/inc | |
parent | c4068e1d9c41fb4a08498c6318684226076bc56c (diff) |
Added support for B3DPolyPOlygon, moved BDRange from source/inc to range namespace and the directories
Diffstat (limited to 'basegfx/inc')
-rw-r--r-- | basegfx/inc/basegfx/numeric/ftools.hxx | 32 | ||||
-rw-r--r-- | basegfx/inc/basegfx/point/b2dpoint.hxx | 22 | ||||
-rw-r--r-- | basegfx/inc/basegfx/point/b3dpoint.hxx | 37 | ||||
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolygon.hxx | 12 | ||||
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolygontools.hxx | 18 | ||||
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx | 16 | ||||
-rw-r--r-- | basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx | 24 | ||||
-rw-r--r-- | basegfx/inc/basegfx/range/b1drange.hxx | 15 | ||||
-rw-r--r-- | basegfx/inc/basegfx/range/b2drange.hxx | 20 | ||||
-rw-r--r-- | basegfx/inc/basegfx/range/b3drange.hxx | 23 | ||||
-rw-r--r-- | basegfx/inc/basegfx/tuple/b3dtuple.hxx | 20 | ||||
-rw-r--r-- | basegfx/inc/basegfx/vector/b2dvector.hxx | 22 | ||||
-rw-r--r-- | basegfx/inc/basegfx/vector/b3dvector.hxx | 44 |
13 files changed, 245 insertions, 60 deletions
diff --git a/basegfx/inc/basegfx/numeric/ftools.hxx b/basegfx/inc/basegfx/numeric/ftools.hxx index 9e657b91179f..4a8287ff164c 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.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-05 12:25:38 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,34 @@ #include <math.h> #endif +////////////////////////////////////////////////////////////////////////////// +// standard PI defines from solar.h, but we do not want to link against tools + +#ifndef F_PI +#define F_PI 3.14159265358979323846 +#endif +#ifndef F_PI2 +#define F_PI2 1.57079632679489661923 +#endif +#ifndef F_PI4 +#define F_PI4 0.785398163397448309616 +#endif +#ifndef F_PI180 +#define F_PI180 0.01745329251994 +#endif +#ifndef F_PI1800 +#define F_PI1800 0.001745329251994 +#endif +#ifndef F_PI18000 +#define F_PI18000 0.0001745329251994 +#endif +#ifndef F_2PI +#define F_2PI 6.28318530717958647694 +#endif + +////////////////////////////////////////////////////////////////////////////// +// fTools defines + namespace basegfx { namespace numeric diff --git a/basegfx/inc/basegfx/point/b2dpoint.hxx b/basegfx/inc/basegfx/point/b2dpoint.hxx index 297bada3ba56..eb5f042f69e8 100644 --- a/basegfx/inc/basegfx/point/b2dpoint.hxx +++ b/basegfx/inc/basegfx/point/b2dpoint.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpoint.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:23 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -130,6 +130,24 @@ namespace basegfx ~B2DPoint() {} + /** *=operator to allow usage from B2DPoint, too + */ + B2DPoint& operator*=( const B2DPoint& rPnt ) + { + mfX *= rPnt.mfX; + mfY *= rPnt.mfY; + return *this; + } + + /** *=operator to allow usage from B2DPoint, too + */ + B2DPoint& operator*=(double t) + { + mfX *= t; + mfY *= t; + return *this; + } + /** assignment operator to allow assigning the results of B2DTuple calculations */ diff --git a/basegfx/inc/basegfx/point/b3dpoint.hxx b/basegfx/inc/basegfx/point/b3dpoint.hxx index 65047e6c26cf..7f444b850234 100644 --- a/basegfx/inc/basegfx/point/b3dpoint.hxx +++ b/basegfx/inc/basegfx/point/b3dpoint.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dpoint.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:24 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,12 @@ namespace basegfx { + namespace matrix + { + // predeclaration + class B3DHomMatrix; + } // end of namespace matrix; + namespace point { /** Base Point class with three double values @@ -128,6 +134,26 @@ namespace basegfx ~B3DPoint() {} + /** *=operator to allow usage from B3DPoint, too + */ + B3DPoint& operator*=( const B3DPoint& rPnt ) + { + mfX *= rPnt.mfX; + mfY *= rPnt.mfY; + mfZ *= rPnt.mfZ; + return *this; + } + + /** *=operator to allow usage from B3DPoint, too + */ + B3DPoint& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; + } + /** assignment operator to allow assigning the results of B3DTuple calculations */ @@ -139,6 +165,13 @@ namespace basegfx return *this; } + /** Transform point by given transformation matrix. + + The translational components of the matrix are, in + contrast to B3DVector, applied. + */ + B3DPoint& operator*=( const ::basegfx::matrix::B3DHomMatrix& rMat ); + static const B3DPoint& getEmptyPoint() { return (const B3DPoint&) ::basegfx::tuple::B3DTuple::getEmptyTuple(); diff --git a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx index 3ce8fff7bf8c..c58be040d447 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygon.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolygon.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2003-11-10 11:45:47 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,11 @@ namespace basegfx { class B2DVector; } // end of namespace vector + + namespace matrix + { + class B2DHomMatrix; + } // end of namespace matrix } // end of namespace basegfx ////////////////////////////////////////////////////////////////////////////// @@ -157,6 +162,9 @@ namespace basegfx // remove double points, at the begin/end and follow-ups, too void removeDoublePoints(); + + // apply transformation given in matrix form to the polygon + void transform(const ::basegfx::matrix::B2DHomMatrix& rMatrix); }; } // end of namespace polygon } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx index efc77e678d21..b2fc5f9c16e5 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolygontools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolygontools.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2003-11-11 09:48:12 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,20 +70,17 @@ #include <basegfx/vector/b2dvector.hxx> #endif -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif - ////////////////////////////////////////////////////////////////////////////// namespace basegfx { + // predefinitions namespace polygon { - // predefinitions class B2DPolygon; } // end of namespace polygon + // predefinitions namespace range { class B2DRange; @@ -125,7 +122,7 @@ namespace basegfx sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::point::B2DPoint& rPoint, sal_Bool bWithBorder = sal_False); sal_Bool isInside(const ::basegfx::polygon::B2DPolygon& rCandidate, const ::basegfx::polygon::B2DPolygon& rPolygon, sal_Bool bWithBorder = sal_False); - // get size of polygon + // get size of polygon. Control vectors are included in that ranges. ::basegfx::range::B2DRange getRange(const ::basegfx::polygon::B2DPolygon& rCandidate); // get area of polygon @@ -154,7 +151,10 @@ namespace basegfx ::basegfx::vector::B2DVectorContinuity getContinuityInPoint(const ::basegfx::polygon::B2DPolygon& rCandidate, sal_uInt32 nIndex); // Subdivide all contained curves. Use distanceBound value if given. - ::basegfx::polygon::B2DPolygon adaptiveSubdivide(const ::basegfx::polygon::B2DPolygon& rCandidate, double fDistanceBound = 0.0); + ::basegfx::polygon::B2DPolygon adaptiveSubdivideByDistance(const ::basegfx::polygon::B2DPolygon& rCandidate, double fDistanceBound = 0.0); + + // Subdivide all contained curves. Use distanceBound value if given. + ::basegfx::polygon::B2DPolygon adaptiveSubdivideByAngle(const ::basegfx::polygon::B2DPolygon& rCandidate, double fAngleBound = 5.0); // Definitions for the cut flags used from the findCut methods typedef sal_uInt16 CutFlagValue; diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx index acd385099ebe..89e6b68b4072 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygon.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygon.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: aw $ $Date: 2003-11-10 11:45:48 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,6 +75,11 @@ namespace basegfx { class B2DPolygon; } // end of namespace polygon + + namespace matrix + { + class B2DHomMatrix; + } // end of namespace matrix } // end of namespace basegfx ////////////////////////////////////////////////////////////////////////////// @@ -107,8 +112,8 @@ namespace basegfx // polygon interface sal_uInt32 count() const; - B2DPolygon getPolygon(sal_uInt32 nIndex) const; - void setPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon); + B2DPolygon getB2DPolygon(sal_uInt32 nIndex) const; + void setB2DPolygon(sal_uInt32 nIndex, const B2DPolygon& rPolygon); // test for curve sal_Bool areControlPointsUsed() const; @@ -139,6 +144,9 @@ namespace basegfx // remove double points, at the begin/end and follow-ups, too void removeDoublePoints(); + + // apply transformation given in matrix form to the polygon + void transform(const ::basegfx::matrix::B2DHomMatrix& rMatrix); }; } // end of namespace polygon } // end of namespace basegfx diff --git a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx index 926fa918035a..5165ef6a37ed 100644 --- a/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx +++ b/basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dpolypolygontools.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-11 09:48:13 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:39:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,20 +70,22 @@ #include <basegfx/vector/b2dvector.hxx> #endif -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif - ////////////////////////////////////////////////////////////////////////////// namespace basegfx { + // predefinitions namespace polygon { - // predefinitions class B2DPolyPolygon; } // end of namespace polygon + // predefinitions + namespace range + { + class B2DRange; + } // end of namespace range + namespace polygon { namespace tools @@ -108,7 +110,13 @@ namespace basegfx sal_Bool bForceOrientation = sal_True, sal_Bool bInvertRemove = sal_False); // Subdivide all contained curves. Use distanceBound value if given. - ::basegfx::polygon::B2DPolyPolygon adaptiveSubdivide(const ::basegfx::polygon::B2DPolyPolygon& rCandidate, double fDistanceBound = 0.0); + ::basegfx::polygon::B2DPolyPolygon adaptiveSubdivideByDistance(const ::basegfx::polygon::B2DPolyPolygon& rCandidate, double fDistanceBound = 0.0); + + // Subdivide all contained curves. Use distanceBound value if given. + ::basegfx::polygon::B2DPolyPolygon adaptiveSubdivideByAngle(const ::basegfx::polygon::B2DPolyPolygon& rCandidate, double fAngleBound = 5.0); + + // get size of PolyPolygon. Control vectors are included in that ranges. + ::basegfx::range::B2DRange getRange(const ::basegfx::polygon::B2DPolyPolygon& rCandidate); } // end of namespace tools } // end of namespace polygon diff --git a/basegfx/inc/basegfx/range/b1drange.hxx b/basegfx/inc/basegfx/range/b1drange.hxx index 3acab7da4a20..e2fd154b5e11 100644 --- a/basegfx/inc/basegfx/range/b1drange.hxx +++ b/basegfx/inc/basegfx/range/b1drange.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b1drange.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:25 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,8 +62,8 @@ #ifndef _BGFX_RANGE_B1DRANGE_HXX #define _BGFX_RANGE_B1DRANGE_HXX -#ifndef _BDRANGE_HXX -#include <BDRange.hxx> +#ifndef _BGFX_RANGE_BASICRANGE_HXX +#include <basegfx/range/basicrange.hxx> #endif namespace basegfx @@ -72,7 +72,7 @@ namespace basegfx { class B1DRange { - BDRange maRange; + ::basegfx::range::BasicRange maRange; public: B1DRange() @@ -119,6 +119,11 @@ namespace basegfx return maRange.getRange(); } + double getCenter() const + { + return maRange.getCenter(); + } + sal_Bool isInside(double fValue) const { return maRange.isInside(fValue); diff --git a/basegfx/inc/basegfx/range/b2drange.hxx b/basegfx/inc/basegfx/range/b2drange.hxx index 85002f6c8956..10f14abe9fd7 100644 --- a/basegfx/inc/basegfx/range/b2drange.hxx +++ b/basegfx/inc/basegfx/range/b2drange.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2drange.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:26 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,8 +66,8 @@ #include <basegfx/tuple/b2dtuple.hxx> #endif -#ifndef _BDRANGE_HXX -#include <BDRange.hxx> +#ifndef _BGFX_RANGE_BASICRANGE_HXX +#include <basegfx/range/basicrange.hxx> #endif namespace basegfx @@ -76,8 +76,8 @@ namespace basegfx { class B2DRange { - BDRange maRangeX; - BDRange maRangeY; + ::basegfx::range::BasicRange maRangeX; + ::basegfx::range::BasicRange maRangeY; public: B2DRange() @@ -140,6 +140,14 @@ namespace basegfx ); } + tuple::B2DTuple getCenter() const + { + return tuple::B2DTuple( + maRangeX.getCenter(), + maRangeY.getCenter() + ); + } + sal_Bool isInside(const tuple::B2DTuple& rTuple) const { return ( diff --git a/basegfx/inc/basegfx/range/b3drange.hxx b/basegfx/inc/basegfx/range/b3drange.hxx index 2da5e2c3e1af..3d6c3c958d1a 100644 --- a/basegfx/inc/basegfx/range/b3drange.hxx +++ b/basegfx/inc/basegfx/range/b3drange.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b3drange.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:26 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,8 +66,8 @@ #include <basegfx/tuple/b3dtuple.hxx> #endif -#ifndef _BDRANGE_HXX -#include <BDRange.hxx> +#ifndef _BGFX_RANGE_BASICRANGE_HXX +#include <basegfx/range/basicrange.hxx> #endif namespace basegfx @@ -76,9 +76,9 @@ namespace basegfx { class B3DRange { - BDRange maRangeX; - BDRange maRangeY; - BDRange maRangeZ; + ::basegfx::range::BasicRange maRangeX; + ::basegfx::range::BasicRange maRangeY; + ::basegfx::range::BasicRange maRangeZ; public: B3DRange() @@ -149,6 +149,15 @@ namespace basegfx ); } + tuple::B3DTuple getCenter() const + { + return tuple::B3DTuple( + maRangeX.getCenter(), + maRangeY.getCenter(), + maRangeZ.getCenter() + ); + } + sal_Bool isInside(const tuple::B3DTuple& rTuple) const { return ( diff --git a/basegfx/inc/basegfx/tuple/b3dtuple.hxx b/basegfx/inc/basegfx/tuple/b3dtuple.hxx index 24ab97aad569..48f1fde48a24 100644 --- a/basegfx/inc/basegfx/tuple/b3dtuple.hxx +++ b/basegfx/inc/basegfx/tuple/b3dtuple.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dtuple.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-10 11:45:49 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -192,13 +192,15 @@ namespace basegfx // comparators with tolerance ////////////////////////////////////////////////////////////////////// - sal_Bool EqualZero() const + sal_Bool equalZero() const { return (this == &maEmptyTuple || - (::basegfx::numeric::fTools::equalZero(mfX) && ::basegfx::numeric::fTools::equalZero(mfY) && ::basegfx::numeric::fTools::equalZero(mfZ))); + (::basegfx::numeric::fTools::equalZero(mfX) + && ::basegfx::numeric::fTools::equalZero(mfY) + && ::basegfx::numeric::fTools::equalZero(mfZ))); } - sal_Bool EqualZero(const double& rfSmallValue) const + sal_Bool equalZero(const double& rfSmallValue) const { return (this == &maEmptyTuple || (::basegfx::numeric::fTools::equalZero(mfX, rfSmallValue) @@ -206,7 +208,7 @@ namespace basegfx && ::basegfx::numeric::fTools::equalZero(mfZ, rfSmallValue))); } - sal_Bool Equal(const B3DTuple& rTup) const + sal_Bool equal(const B3DTuple& rTup) const { return ( ::basegfx::numeric::fTools::equal(mfX, rTup.mfX) && @@ -214,7 +216,7 @@ namespace basegfx ::basegfx::numeric::fTools::equal(mfZ, rTup.mfZ)); } - sal_Bool Equal(const B3DTuple& rTup, const double& rfSmallValue) const + sal_Bool equal(const B3DTuple& rTup, const double& rfSmallValue) const { return ( ::basegfx::numeric::fTools::equal(mfX, rTup.mfX, rfSmallValue) && @@ -281,12 +283,12 @@ namespace basegfx sal_Bool operator==( const B3DTuple& rTup ) const { - return Equal(rTup); + return equal(rTup); } sal_Bool operator!=( const B3DTuple& rTup ) const { - return !Equal(rTup); + return !equal(rTup); } B3DTuple& operator=( const B3DTuple& rTup ) diff --git a/basegfx/inc/basegfx/vector/b2dvector.hxx b/basegfx/inc/basegfx/vector/b2dvector.hxx index 0a3a896733a0..f35c38bb3236 100644 --- a/basegfx/inc/basegfx/vector/b2dvector.hxx +++ b/basegfx/inc/basegfx/vector/b2dvector.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dvector.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: thb $ $Date: 2003-11-12 12:09:51 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -158,6 +158,24 @@ namespace basegfx ~B2DVector() {} + /** *=operator to allow usage from B2DVector, too + */ + B2DVector& operator*=( const B2DVector& rPnt ) + { + mfX *= rPnt.mfX; + mfY *= rPnt.mfY; + return *this; + } + + /** *=operator to allow usage from B2DVector, too + */ + B2DVector& operator*=(double t) + { + mfX *= t; + mfY *= t; + return *this; + } + /** assignment operator to allow assigning the results of B2DTuple calculations */ diff --git a/basegfx/inc/basegfx/vector/b3dvector.hxx b/basegfx/inc/basegfx/vector/b3dvector.hxx index bd118592ec96..855abb7f71e8 100644 --- a/basegfx/inc/basegfx/vector/b3dvector.hxx +++ b/basegfx/inc/basegfx/vector/b3dvector.hxx @@ -2,9 +2,9 @@ * * $RCSfile: b3dvector.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: aw $ $Date: 2003-11-06 16:30:26 $ + * last change: $Author: aw $ $Date: 2003-11-26 14:40:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,12 @@ namespace basegfx { + namespace matrix + { + // predeclaration + class B3DHomMatrix; + } // end of namespace matrix; + namespace vector { /** Base Point class with three double values @@ -128,6 +134,26 @@ namespace basegfx ~B3DVector() {} + /** *=operator to allow usage from B3DVector, too + */ + B3DVector& operator*=( const B3DVector& rPnt ) + { + mfX *= rPnt.mfX; + mfY *= rPnt.mfY; + mfZ *= rPnt.mfZ; + return *this; + } + + /** *=operator to allow usage from B3DVector, too + */ + B3DVector& operator*=(double t) + { + mfX *= t; + mfY *= t; + mfZ *= t; + return *this; + } + /** assignment operator to allow assigning the results of B3DTuple calculations */ @@ -275,6 +301,13 @@ namespace basegfx return ((mfX * rVec.mfX) + (mfY * rVec.mfY) + (mfZ * rVec.mfZ)); } + /** Transform vector by given transformation matrix. + + Since this is a vector, translational components of the + matrix are disregarded. + */ + B3DVector& operator*=( const matrix::B3DHomMatrix& rMat ); + static const B3DVector& getEmptyVector() { return (const B3DVector&) ::basegfx::tuple::B3DTuple::getEmptyTuple(); @@ -301,6 +334,13 @@ namespace basegfx return aPerpendicular; } + /** Transform vector by given transformation matrix. + + Since this is a vector, translational components of the + matrix are disregarded. + */ + B3DVector operator*( const matrix::B3DHomMatrix& rMat, const B3DVector& rVec ); + /** Calculate the Cross Product of two 3D Vectors @param rVecA |