LibreOffice Module basegfx (master) 1
Public Member Functions | Static Public Member Functions | List of all members
basegfx::B3DVector Class Reference

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

#include <b3dvector.hxx>

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

Public Member Functions

 B3DVector ()
 Create a 3D Vector. More...
 
 B3DVector (double fX, double fY, double fZ)
 Create a 3D Vector. More...
 
 B3DVector (const ::basegfx::B3DTuple &rTuple)
 constructor with tuple to allow copy-constructing from B3DTuple-based classes More...
 
B3DVectoroperator*= (const B3DVector &rPnt)
 *=operator to allow usage from B3DVector, too More...
 
B3DVectoroperator*= (double t)
 *=operator to allow usage from B3DVector, too More...
 
B3DVectoroperator= (const ::basegfx::B3DTuple &rVec)
 assignment operator to allow assigning the results of B3DTuple calculations More...
 
double getLength () const
 Calculate the length of this 3D Vector. More...
 
double getXZLength () const
 Calculate the length in the XZ-Plane for this 3D Vector. More...
 
double getYZLength () const
 Calculate the length in the YZ-Plane for this 3D Vector. More...
 
B3DVectorsetLength (double fLen)
 Set the length of this 3D Vector. More...
 
B3DVectornormalize ()
 Normalize this 3D Vector. More...
 
B3DVector getPerpendicular (const B3DVector &rNormalizedVec) const
 get a 3D Vector which is perpendicular to this and a given 3D Vector More...
 
double scalar (const B3DVector &rVec) const
 Calculate the Scalar product. More...
 
B3DVectoroperator*= (const B3DHomMatrix &rMat)
 Transform vector by given transformation matrix. More...
 
- Public Member Functions inherited from basegfx::B3DTuple
 B3DTuple ()
 Create a 3D Tuple. More...
 
 B3DTuple (double fX, double fY, double fZ)
 Create a 3D Tuple. More...
 
const double & operator[] (int nPos) const
 Array-access to 3D Tuple. More...
 
double & operator[] (int nPos)
 Array-access to 3D Tuple. More...
 
bool equalZero () const
 
bool equal (const B3DTuple &rTup) const
 
B3DTuple operator- (void) const
 
bool operator== (const B3DTuple &rTup) const
 
bool operator!= (const B3DTuple &rTup) const
 
void correctValues (const double fCompareValue=0.0)
 
- Public Member Functions inherited from basegfx::Tuple3D< double >
 Tuple3D (double x, double y, double z)
 Create a 3D Tuple. More...
 
double getX () const
 Get X-Coordinate of 3D Tuple. More...
 
double getY () const
 Get Y-Coordinate of 3D Tuple. More...
 
double getZ () const
 Get Z-Coordinate of 3D Tuple. More...
 
void setX (double fX)
 Set X-Coordinate of 3D Tuple. More...
 
void setY (double fY)
 Set Y-Coordinate of 3D Tuple. More...
 
void setZ (double fZ)
 Set Z-Coordinate of 3D Tuple. More...
 
Tuple3Doperator+= (const Tuple3D &rTup)
 
Tuple3Doperator-= (const Tuple3D &rTup)
 
Tuple3Doperator/= (const Tuple3D &rTup)
 
Tuple3Doperator/= (double t)
 
Tuple3Doperator*= (const Tuple3D &rTup)
 
Tuple3Doperator*= (double t)
 
bool operator== (const Tuple3D &rTup) const
 
bool operator!= (const Tuple3D &rTup) const
 

Static Public Member Functions

static const B3DVectorgetEmptyVector ()
 
- Static Public Member Functions inherited from basegfx::B3DTuple
static const B3DTuplegetEmptyTuple ()
 

Additional Inherited Members

- Public Attributes inherited from basegfx::Tuple3D< double >
double mnX
 
double mnY
 
double mnZ
 
double mfX
 
double mfY
 
double mfZ
 
- Protected Attributes inherited from basegfx::Tuple3D< double >
union {
   struct {
      TYPE   mnX
 
      TYPE   mnY
 
      TYPE   mnZ
 
   } 
 
   struct {
      TYPE   mfX
 
      TYPE   mfY
 
      TYPE   mfZ
 
   } 
 
}; 
 

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 37 of file b3dvector.hxx.

Constructor & Destructor Documentation

◆ B3DVector() [1/3]

basegfx::B3DVector::B3DVector ( )
inline

Create a 3D Vector.

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

Definition at line 44 of file b3dvector.hxx.

◆ B3DVector() [2/3]

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

Create a 3D Vector.

Parameters
fXThis parameter is used to initialize the X-coordinate of the 3D Vector.
fYThis parameter is used to initialize the Y-coordinate of the 3D Vector.
fZThis parameter is used to initialize the Z-coordinate of the 3D Vector.

Definition at line 61 of file b3dvector.hxx.

◆ B3DVector() [3/3]

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

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

Definition at line 68 of file b3dvector.hxx.

Member Function Documentation

◆ getEmptyVector()

static const B3DVector & basegfx::B3DVector::getEmptyVector ( )
inlinestatic

Definition at line 207 of file b3dvector.hxx.

References basegfx::B3DTuple::getEmptyTuple().

Referenced by ImplB3DPolygon::insert().

◆ getLength()

double basegfx::B3DVector::getLength ( ) const
inline

Calculate the length of this 3D Vector.

Returns
The Length of the 3D Vector

Definition at line 107 of file b3dvector.hxx.

Referenced by basegfx::B3DHomMatrix::decompose(), and basegfx::utils::getLength().

◆ getPerpendicular()

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

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

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

Definition at line 46 of file b3dvector.cxx.

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

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

◆ getXZLength()

double basegfx::B3DVector::getXZLength ( ) 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 119 of file b3dvector.hxx.

References mfX.

Referenced by basegfx::utils::applyDefaultTextureCoordinatesSphere().

◆ getYZLength()

double basegfx::B3DVector::getYZLength ( ) 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 131 of file b3dvector.hxx.

References mfY.

◆ normalize()

B3DVector & basegfx::B3DVector::normalize ( )

◆ operator*=() [1/3]

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.

◆ operator*=() [2/3]

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

*=operator to allow usage from B3DVector, too

Definition at line 74 of file b3dvector.hxx.

References mfX, basegfx::Tuple3D< TYPE >::mfX, mfY, basegfx::Tuple3D< TYPE >::mfY, and basegfx::Tuple3D< TYPE >::mfZ.

◆ operator*=() [3/3]

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

*=operator to allow usage from B3DVector, too

Definition at line 84 of file b3dvector.hxx.

References mfX, mfY, and t.

◆ operator=()

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

assignment operator to allow assigning the results of B3DTuple calculations

Definition at line 95 of file b3dvector.hxx.

References mfX, and mfY.

◆ scalar()

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
rVecA second 3D Vector.
Returns
The Scalar Product of two 3D Vectors

Definition at line 195 of file b3dvector.hxx.

References mfX, basegfx::Tuple3D< TYPE >::mfX, mfY, basegfx::Tuple3D< TYPE >::mfY, and basegfx::Tuple3D< TYPE >::mfZ.

Referenced by basegfx::B3DHomMatrix::decompose(), basegfx::utils::getCutBetweenLineAndPlane(), and normalize().

◆ setLength()

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

Set the length of this 3D Vector.

Parameters
fLenThe to be achieved length of the 3D Vector

Definition at line 144 of file b3dvector.hxx.

References basegfx::fTools::equalZero(), mfX, and mfY.


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