basegfx::B2DVector Class Reference

Base Point class with two double values. More...

#include <b2dvector.hxx>

Inheritance diagram for basegfx::B2DVector:

Inheritance graph
[legend]
Collaboration diagram for basegfx::B2DVector:

Collaboration graph
[legend]

List of all members.

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 ()
B2DVectoroperator*= (const B2DVector &rPnt)
 *=operator to allow usage from B2DVector, too
B2DVectoroperator*= (double t)
 *=operator to allow usage from B2DVector, too
B2DVectoroperator= (const ::basegfx::B2DTuple &rVec)
 assignment operator to allow assigning the results of B2DTuple calculations
double getLength () const
 Calculate the length of this 2D Vector.
B2DVectorsetLength (double fLen)
 Set the length of this 2D Vector.
B2DVectornormalize ()
 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.
B2DVectoroperator*= (const B2DHomMatrix &rMat)
 Transform vector by given transformation matrix.

Static Public Member Functions

static const B2DVectorgetEmptyVector ()


Detailed Description

Base Point class with two double values.

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.

See also:
B2DTuple

Definition at line 48 of file b2dvector.hxx.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.


Member Function Documentation

B2DVector& basegfx::B2DVector::operator*= ( const B2DVector rPnt  )  [inline]

*=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

B2DVector & basegfx::B2DVector::setLength ( double  fLen  ) 

Set the length of this 2D Vector.

Parameters:
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 (  ) 

bool basegfx::B2DVector::isNormalized (  )  const

Test if this 2D Vector is normalized.

Returns:
true if lenth of vector is equal to 1.0 false else

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.

Parameters:
rVec The second 2D Vector
Returns:
The Scalar value of the two involved 2D Vectors

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.

Parameters:
rVec The second 2D Vector
Returns:
The length of the cross product of the two involved 2D Vectors

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.

Parameters:
rVec The second 2D Vector
Returns:
The Angle value of the two involved 2D Vectors in -pi/2 < return < pi/2

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]


The documentation for this class was generated from the following files:

Generated on Thu Apr 29 13:57:21 2010 for ooo-build Module basegfx (ooo/OOO320_m15) by  doxygen 1.5.6