basegfx::B3DVector Class Reference

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

#include <b3dvector.hxx>

Inheritance diagram for basegfx::B3DVector:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 B3DVector ()
 Create a 3D Vector.
 B3DVector (double fX, double fY, double fZ)
 Create a 3D Vector.
 B3DVector (const B3DVector &rVec)
 Create a copy of a 3D Vector.
 B3DVector (const ::basegfx::B3DTuple &rTuple)
 constructor with tuple to allow copy-constructing from B3DTuple-based classes
 ~B3DVector ()
B3DVectoroperator*= (const B3DVector &rPnt)
 *=operator to allow usage from B3DVector, too
B3DVectoroperator*= (double t)
 *=operator to allow usage from B3DVector, too
B3DVectoroperator= (const ::basegfx::B3DTuple &rVec)
 assignment operator to allow assigning the results of B3DTuple calculations
double getLength (void) const
 Calculate the length of this 3D Vector.
double getXYLength (void) const
 Calculate the length in the XY-Plane for this 3D Vector.
double getXZLength (void) const
 Calculate the length in the XZ-Plane for this 3D Vector.
double getYZLength (void) const
 Calculate the length in the YZ-Plane for this 3D Vector.
B3DVectorsetLength (double fLen)
 Set the length of this 3D Vector.
B3DVectornormalize ()
 Normalize this 3D Vector.
bool isNormalized () const
 Test if this 3D Vector is normalized.
B3DVector getPerpendicular (const B3DVector &rNormalizedVec) const
 get a 3D Vector which is perpendicular to this and a given 3D Vector
B3DVector getProjectionOnPlane (const B3DVector &rNormalizedPlane) const
 get the projection of this Vector on the given Plane
double scalar (const B3DVector &rVec) const
 Calculate the Scalar product.
B3DVectoroperator*= (const B3DHomMatrix &rMat)
 Transform vector by given transformation matrix.

Static Public Member Functions

static const B3DVectorgetEmptyVector ()


Detailed Description

Base Point class with three double values.

This class derives all operators and common handling for a 3D data class from B3DTuple. All necessary extensions which are special for 3D Vectors are added here.

See also:
B3DTuple

Definition at line 48 of file b3dvector.hxx.


Constructor & Destructor Documentation

basegfx::B3DVector::B3DVector (  )  [inline]

Create a 3D Vector.

The vector is initialized to (0.0, 0.0, 0.0)

Definition at line 55 of file b3dvector.hxx.

basegfx::B3DVector::B3DVector ( double  fX,
double  fY,
double  fZ 
) [inline]

Create a 3D Vector.

Parameters:
fX This parameter is used to initialize the X-coordinate of the 3D Vector.
fY This parameter is used to initialize the Y-coordinate of the 3D Vector.
fZ This parameter is used to initialize the Z-coordinate of the 3D Vector.

Definition at line 73 of file b3dvector.hxx.

basegfx::B3DVector::B3DVector ( const B3DVector rVec  )  [inline]

Create a copy of a 3D Vector.

Parameters:
rVec The 3D Vector which will be copied.

Definition at line 82 of file b3dvector.hxx.

basegfx::B3DVector::B3DVector ( const ::basegfx::B3DTuple rTuple  )  [inline]

constructor with tuple to allow copy-constructing from B3DTuple-based classes

Definition at line 89 of file b3dvector.hxx.

basegfx::B3DVector::~B3DVector (  )  [inline]

Definition at line 93 of file b3dvector.hxx.


Member Function Documentation

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

*=operator to allow usage from B3DVector, too

Definition at line 98 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

B3DVector& basegfx::B3DVector::operator*= ( double  t  )  [inline]

*=operator to allow usage from B3DVector, too

Reimplemented from basegfx::B3DTuple.

Definition at line 108 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

B3DVector& basegfx::B3DVector::operator= ( const ::basegfx::B3DTuple rVec  )  [inline]

assignment operator to allow assigning the results of B3DTuple calculations

Definition at line 119 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

double basegfx::B3DVector::getLength ( void   )  const [inline]

Calculate the length of this 3D Vector.

Returns:
The Length of the 3D Vector

Definition at line 131 of file b3dvector.hxx.

References scalar().

double basegfx::B3DVector::getXYLength ( void   )  const [inline]

Calculate the length in the XY-Plane for this 3D Vector.

Returns:
The XY-Plane Length of the 3D Vector

Definition at line 143 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, and basegfx::B3DTuple::mfY.

Referenced by basegfx::tools::clipPolygonOnPlane(), and basegfx::tools::clipPolyPolygonOnPlane().

double basegfx::B3DVector::getXZLength ( void   )  const [inline]

Calculate the length in the XZ-Plane for this 3D Vector.

Returns:
The XZ-Plane Length of the 3D Vector

Definition at line 155 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, and basegfx::B3DTuple::mfZ.

double basegfx::B3DVector::getYZLength ( void   )  const [inline]

Calculate the length in the YZ-Plane for this 3D Vector.

Returns:
The YZ-Plane Length of the 3D Vector

Definition at line 167 of file b3dvector.hxx.

References basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

B3DVector& basegfx::B3DVector::setLength ( double  fLen  )  [inline]

Set the length of this 3D Vector.

Parameters:
fLen The to be achieved length of the 3D Vector

Definition at line 180 of file b3dvector.hxx.

References basegfx::fTools::equal(), basegfx::fTools::equalZero(), basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, basegfx::B3DTuple::mfZ, and scalar().

B3DVector & basegfx::B3DVector::normalize (  ) 

Normalize this 3D Vector.

The length of the 3D Vector is set to 1.0

Definition at line 37 of file b3dvector.cxx.

References basegfx::fTools::equal(), basegfx::fTools::equalZero(), basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, basegfx::B3DTuple::mfZ, and scalar().

Referenced by getPerpendicular(), and basegfx::B3DHomMatrix::orientation().

bool basegfx::B3DVector::isNormalized (  )  const [inline]

Test if this 3D Vector is normalized.

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

Definition at line 213 of file b3dvector.hxx.

References basegfx::fTools::equal(), and scalar().

B3DVector basegfx::B3DVector::getPerpendicular ( const B3DVector rNormalizedVec  )  const

get a 3D Vector which is perpendicular to this and a given 3D Vector

Attention:
This only works if this and the given 3D Vector are both normalized.
Parameters:
rNormalizedVec A normalized 3D Vector.
Returns:
A 3D Vector perpendicular to this and the given one

Definition at line 61 of file b3dvector.cxx.

References basegfx::cross(), and normalize().

Referenced by basegfx::B3DHomMatrix::orientation().

B3DVector basegfx::B3DVector::getProjectionOnPlane ( const B3DVector rNormalizedPlane  )  const

get the projection of this Vector on the given Plane

Attention:
This only works if the given 3D Vector defining the Plane is normalized.
Parameters:
rNormalizedPlane A normalized 3D Vector defining a Plane.
Returns:
The projected 3D Vector

Definition at line 69 of file b3dvector.cxx.

References basegfx::cross(), basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

double basegfx::B3DVector::scalar ( const B3DVector rVec  )  const [inline]

Calculate the Scalar product.

This method calculates the Scalar product between this and the given 3D Vector.

Parameters:
rVec A second 3D Vector.
Returns:
The Scalar Product of two 3D Vectors

Definition at line 258 of file b3dvector.hxx.

References basegfx::B3DTuple::mfX, basegfx::B3DTuple::mfY, and basegfx::B3DTuple::mfZ.

Referenced by basegfx::tools::getCutBetweenLineAndPlane(), getLength(), basegfx::tools::isInEpsilonRange(), isNormalized(), normalize(), and setLength().

B3DVector& basegfx::B3DVector::operator*= ( const B3DHomMatrix rMat  ) 

Transform vector by given transformation matrix.

Since this is a vector, translational components of the matrix are disregarded.

static const B3DVector& basegfx::B3DVector::getEmptyVector (  )  [inline, 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