#include <b2dvector.hxx>


Public Member Functions | |
| B2DVector () | |
| Create a 2D Vector. | |
| B2DVector (double fX, double fY) | |
| Create a 2D Vector. | |
| B2DVector (const B2DVector &rVec) | |
| Create a copy of a 2D Vector. | |
| B2DVector (const ::basegfx::B2IVector &rVec) | |
| Create a copy of a 2D Vector. | |
| B2DVector (const ::basegfx::B2DTuple &rTuple) | |
| constructor with tuple to allow copy-constructing from B2DTuple-based classes | |
| ~B2DVector () | |
| B2DVector & | operator*= (const B2DVector &rPnt) |
| *=operator to allow usage from B2DVector, too | |
| B2DVector & | operator*= (double t) |
| *=operator to allow usage from B2DVector, too | |
| B2DVector & | operator= (const ::basegfx::B2DTuple &rVec) |
| assignment operator to allow assigning the results of B2DTuple calculations | |
| double | getLength () const |
| Calculate the length of this 2D Vector. | |
| B2DVector & | setLength (double fLen) |
| Set the length of this 2D Vector. | |
| B2DVector & | normalize () |
| Normalize this 2D Vector. | |
| bool | isNormalized () const |
| Test if this 2D Vector is normalized. | |
| double | scalar (const B2DVector &rVec) const |
| Calculate the Scalar with another 2D Vector. | |
| double | cross (const B2DVector &rVec) const |
| Calculate the length of the cross product with another 2D Vector. | |
| double | angle (const B2DVector &rVec) const |
| Calculate the Angle with another 2D Vector. | |
| B2DVector & | operator*= (const B2DHomMatrix &rMat) |
| Transform vector by given transformation matrix. | |
Static Public Member Functions | |
| static const B2DVector & | getEmptyVector () |
This class derives all operators and common handling for a 2D data class from B2DTuple. All necessary extensions which are special for 2D Vectors are added here.
Definition at line 48 of file b2dvector.hxx.
| basegfx::B2DVector::B2DVector | ( | ) | [inline] |
Create a 2D Vector.
The vector is initialized to (0.0, 0.0)
Definition at line 55 of file b2dvector.hxx.
| basegfx::B2DVector::B2DVector | ( | double | fX, | |
| double | fY | |||
| ) | [inline] |
Create a 2D Vector.
| fX | This parameter is used to initialize the X-coordinate of the 2D Vector. | |
| fY | This parameter is used to initialize the Y-coordinate of the 2D Vector. |
Definition at line 69 of file b2dvector.hxx.
| basegfx::B2DVector::B2DVector | ( | const B2DVector & | rVec | ) | [inline] |
Create a copy of a 2D Vector.
| rVec | The 2D Vector which will be copied. |
Definition at line 78 of file b2dvector.hxx.
| basegfx::B2DVector::B2DVector | ( | const ::basegfx::B2IVector & | rVec | ) | [inline] |
Create a copy of a 2D Vector.
| rVec | The 2D Vector which will be copied. |
Definition at line 87 of file b2dvector.hxx.
| basegfx::B2DVector::B2DVector | ( | const ::basegfx::B2DTuple & | rTuple | ) | [inline] |
constructor with tuple to allow copy-constructing from B2DTuple-based classes
Definition at line 94 of file b2dvector.hxx.
| basegfx::B2DVector::~B2DVector | ( | ) | [inline] |
Definition at line 98 of file b2dvector.hxx.
*=operator to allow usage from B2DVector, too
Definition at line 103 of file b2dvector.hxx.
References basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
| B2DVector& basegfx::B2DVector::operator*= | ( | double | t | ) | [inline] |
*=operator to allow usage from B2DVector, too
Reimplemented from basegfx::B2DTuple.
Definition at line 112 of file b2dvector.hxx.
References basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
| B2DVector& basegfx::B2DVector::operator= | ( | const ::basegfx::B2DTuple & | rVec | ) |
assignment operator to allow assigning the results of B2DTuple calculations
| double basegfx::B2DVector::getLength | ( | ) | const |
Calculate the length of this 2D Vector.
Definition at line 72 of file b2dvector.cxx.
References basegfx::fTools::equalZero(), basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
Referenced by basegfx::B2DHomMatrix::decompose(), basegfx::B2DCubicBezier::getControlPolygonLength(), basegfx::tools::getDistancePointToEndlessRay(), basegfx::B2DCubicBezier::getEdgeLength(), basegfx::tools::getSmallestDistancePointToEdge(), and basegfx::B2DCubicBezier::testAndSolveTrivialBezier().
| B2DVector & basegfx::B2DVector::setLength | ( | double | fLen | ) |
Set the length of this 2D Vector.
| fLen | The to be achieved length of the 2D Vector |
Definition at line 119 of file b2dvector.cxx.
References basegfx::fTools::equal(), basegfx::fTools::equalZero(), basegfx::B2DTuple::mfX, basegfx::B2DTuple::mfY, and scalar().
| B2DVector & basegfx::B2DVector::normalize | ( | ) |
Normalize this 2D Vector.
The length of the 2D Vector is set to 1.0
Definition at line 36 of file b2dvector.cxx.
References basegfx::fTools::equal(), basegfx::fTools::equalZero(), basegfx::B2DTuple::mfX, basegfx::B2DTuple::mfY, and scalar().
Referenced by basegfx::findTouchesOnEdge(), basegfx::getNormalizedPerpendicular(), and basegfx::tools::growInNormalDirection().
| bool basegfx::B2DVector::isNormalized | ( | ) | const |
Test if this 2D Vector is normalized.
Definition at line 139 of file b2dvector.cxx.
References basegfx::tools::equal(), and scalar().
| double basegfx::B2DVector::scalar | ( | const B2DVector & | rVec | ) | const |
Calculate the Scalar with another 2D Vector.
| rVec | The second 2D Vector |
Definition at line 86 of file b2dvector.cxx.
References basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
Referenced by basegfx::B2DHomMatrix::decompose(), basegfx::getContinuity(), basegfx::tools::isInEpsilonRange(), isNormalized(), normalize(), and setLength().
| double basegfx::B2DVector::cross | ( | const B2DVector & | rVec | ) | const |
Calculate the length of the cross product with another 2D Vector.
In 2D, returning an actual vector does not make much sense here. The magnitude, although, can be readily used for tasks such as angle calculations, since for the returned value, the following equation holds: retVal = getLength(this)*getLength(rVec)*sin(theta), with theta being the angle between the two vectors.
| rVec | The second 2D Vector |
Definition at line 91 of file b2dvector.cxx.
References basegfx::B2DTuple::getX(), basegfx::B2DTuple::getY(), basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
Referenced by basegfx::tools::arePointsOnSameSideOfLine(), basegfx::B2DHomMatrix::decompose(), basegfx::findCutsAndTouchesAndCommonForBezier(), basegfx::findEdgeCutsTwoEdges(), and basegfx::B2DCubicBezier::testAndSolveTrivialBezier().
| double basegfx::B2DVector::angle | ( | const B2DVector & | rVec | ) | const |
Calculate the Angle with another 2D Vector.
| rVec | The second 2D Vector |
Definition at line 96 of file b2dvector.cxx.
References basegfx::B2DTuple::getX(), basegfx::B2DTuple::getY(), basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
Referenced by basegfx::createAreaGeometryForJoin(), basegfx::ImpSubDivAngle(), and basegfx::ImpSubDivAngleStart().
| B2DVector & basegfx::B2DVector::operator*= | ( | const B2DHomMatrix & | rMat | ) |
Transform vector by given transformation matrix.
Since this is a vector, translational components of the matrix are disregarded.
Definition at line 107 of file b2dvector.cxx.
References basegfx::B2DHomMatrix::get(), basegfx::B2DTuple::mfX, and basegfx::B2DTuple::mfY.
| const B2DVector & basegfx::B2DVector::getEmptyVector | ( | ) | [static] |
Definition at line 102 of file b2dvector.cxx.
References basegfx::B2DTuple::getEmptyTuple().
Referenced by basegfx::B2DPolygon::appendBezierSegment(), ImplB2DPolygon::getNextControlVector(), ImplB2DPolygon::getPrevControlVector(), ImplB2DPolygon::resetControlVectors(), basegfx::B2DPolygon::resetNextControlPoint(), basegfx::B2DPolygon::resetPrevControlPoint(), ControlVectorArray2D::setNextVector(), and ControlVectorArray2D::setPrevVector().
1.5.6