LibreOffice Module basegfx (master) 1
|
Base Point class with three double values. More...
#include <b3dvector.hxx>
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... | |
B3DVector & | operator*= (const B3DVector &rPnt) |
*=operator to allow usage from B3DVector, too More... | |
B3DVector & | operator*= (double t) |
*=operator to allow usage from B3DVector, too More... | |
B3DVector & | operator= (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... | |
B3DVector & | setLength (double fLen) |
Set the length of this 3D Vector. More... | |
B3DVector & | normalize () |
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... | |
B3DVector & | operator*= (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... | |
Tuple3D & | operator+= (const Tuple3D &rTup) |
Tuple3D & | operator-= (const Tuple3D &rTup) |
Tuple3D & | operator/= (const Tuple3D &rTup) |
Tuple3D & | operator/= (double t) |
Tuple3D & | operator*= (const Tuple3D &rTup) |
Tuple3D & | operator*= (double t) |
bool | operator== (const Tuple3D &rTup) const |
bool | operator!= (const Tuple3D &rTup) const |
Static Public Member Functions | |
static const B3DVector & | getEmptyVector () |
Static Public Member Functions inherited from basegfx::B3DTuple | |
static const B3DTuple & | getEmptyTuple () |
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 | |
} | |
}; | |
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.
Definition at line 37 of file b3dvector.hxx.
|
inline |
Create a 3D Vector.
The vector is initialized to (0.0, 0.0, 0.0)
Definition at line 44 of file b3dvector.hxx.
|
inline |
Create a 3D Vector.
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 61 of file b3dvector.hxx.
|
inline |
constructor with tuple to allow copy-constructing from B3DTuple-based classes
Definition at line 68 of file b3dvector.hxx.
|
inlinestatic |
Definition at line 207 of file b3dvector.hxx.
References basegfx::B3DTuple::getEmptyTuple().
Referenced by ImplB3DPolygon::insert().
|
inline |
Calculate the length of this 3D Vector.
Definition at line 107 of file b3dvector.hxx.
Referenced by basegfx::B3DHomMatrix::decompose(), and basegfx::utils::getLength().
get a 3D Vector which is perpendicular to this and a given 3D Vector
rNormalizedVec | A normalized 3D Vector. |
Definition at line 46 of file b3dvector.cxx.
References basegfx::cross(), and normalize().
Referenced by basegfx::B3DHomMatrix::decompose(), and basegfx::B3DHomMatrix::orientation().
|
inline |
Calculate the length in the XZ-Plane for this 3D Vector.
Definition at line 119 of file b3dvector.hxx.
References mfX.
Referenced by basegfx::utils::applyDefaultTextureCoordinatesSphere().
|
inline |
Calculate the length in the YZ-Plane for this 3D Vector.
Definition at line 131 of file b3dvector.hxx.
References mfY.
B3DVector & basegfx::B3DVector::normalize | ( | ) |
Normalize this 3D Vector.
The length of the 3D Vector is set to 1.0
Definition at line 25 of file b3dvector.cxx.
References basegfx::fTools::equalZero(), basegfx::Tuple3D< double >::mfX, basegfx::Tuple3D< double >::mfY, basegfx::Tuple3D< double >::mfZ, and scalar().
Referenced by basegfx::utils::applyDefaultNormalsSphere(), basegfx::B3DHomMatrix::decompose(), getPerpendicular(), and basegfx::B3DHomMatrix::orientation().
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 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.
|
inline |
|
inline |
assignment operator to allow assigning the results of B3DTuple calculations
Definition at line 95 of file b3dvector.hxx.
|
inline |
Calculate the Scalar product.
This method calculates the Scalar product between this and the given 3D Vector.
rVec | A second 3D Vector. |
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().
|
inline |
Set the length of this 3D Vector.
fLen | The to be achieved length of the 3D Vector |
Definition at line 144 of file b3dvector.hxx.
References basegfx::fTools::equalZero(), mfX, and mfY.