OpenLexocad
28.0
|
#include <Vector3D.h>
Public Types | |
typedef _Precision | num_type |
typedef float_traits< num_type > | traits_type |
Public Member Functions | |
Operator | |
_Precision & | operator[] (unsigned short usIndex) |
Returns a reference to a coordinate. usIndex must be in the range [0,2]. More... | |
const _Precision & | operator[] (unsigned short usIndex) const |
Returns a const reference to a coordinate. usIndex must be in the range [0,2]. More... | |
Vector3 | operator+ (const Vector3< _Precision > &rcVct) const |
Vector addition. More... | |
Vector3 | operator& (const Vector3< _Precision > &rcVct) const |
Vector3 | operator- (const Vector3< _Precision > &rcVct) const |
Vector subtraction. More... | |
Vector3 | operator- (void) const |
Negative vector. More... | |
Vector3 & | operator+= (const Vector3< _Precision > &rcVct) |
Vector summation. More... | |
Vector3 & | operator-= (const Vector3< _Precision > &rcVct) |
Vector subtraction. More... | |
Vector3 | operator* (_Precision fScale) const |
Vector scaling. More... | |
Vector3 | operator/ (_Precision fDiv) const |
Vector3 & | operator*= (_Precision fScale) |
Vector3 & | operator/= (_Precision fDiv) |
Vector3 & | operator= (const Vector3< _Precision > &rcVct) |
Assignment. More... | |
_Precision | operator* (const Vector3< _Precision > &rcVct) const |
Scalar product. More... | |
_Precision | Dot (const Vector3< _Precision > &rcVct) const |
Scalar product. More... | |
Vector3 | operator% (const Vector3< _Precision > &rcVct) const |
Cross product. More... | |
Vector3 | Cross (const Vector3< _Precision > &rcVct) const |
Cross product. More... | |
bool | operator!= (const Vector3< _Precision > &rcVct) const |
Comparing for inequality. More... | |
bool | operator== (const Vector3< _Precision > &rcVct) const |
Comparing for equality. More... | |
bool | IsOnLineSegment (const Vector3< _Precision > &startVct, const Vector3< _Precision > &endVct) const |
Check if Vector is on a line segment. More... | |
Modification | |
void | ScaleX (_Precision f) |
void | ScaleY (_Precision f) |
void | ScaleZ (_Precision f) |
void | Scale (_Precision fX, _Precision fY, _Precision fZ) |
void | MoveX (_Precision f) |
void | MoveY (_Precision f) |
void | MoveZ (_Precision f) |
void | Move (_Precision fX, _Precision fY, _Precision fZ) |
void | RotateX (_Precision f) |
void | RotateY (_Precision f) |
void | RotateZ (_Precision f) |
void | Set (_Precision fX, _Precision fY, _Precision fZ) |
Mathematics | |
_Precision | Length (void) const |
Length of the vector. More... | |
_Precision | Sqr (void) const |
Squared length of the vector. More... | |
Vector3 & | Normalize (void) |
Set length to 1. More... | |
_Precision | GetAngle (const Vector3 &rcVect) const |
Get angle between both vectors. The returned value lies in the interval [0,pi]. More... | |
void | TransformToCoordinateSystem (const Vector3 &rclBase, const Vector3 &rclDirX, const Vector3 &rclDirY) |
bool | IsEqual (const Vector3 &rclPnt, _Precision tol) const |
IsEqual. More... | |
Vector3 & | ProjectToPlane (const Vector3 &rclBase, const Vector3 &rclNorm) |
Projects this point onto the plane given by the base rclBase and the normal rclNorm. More... | |
void | ProjectToPlane (const Vector3 &rclBase, const Vector3 &rclNorm, Vector3 &rclProj) const |
Vector3 & | ProjectToLine (const Vector3 &rclPoint, const Vector3 &rclLine) |
Projects this point onto the line given by the base rclPoint and the direction rclLine. More... | |
Vector3 | Perpendicular (const Vector3 &rclBase, const Vector3 &rclDir) const |
_Precision | DistanceToPlane (const Vector3 &rclBase, const Vector3 &rclNorm) const |
_Precision | DistanceToLine (const Vector3 &rclBase, const Vector3 &rclDirect) const |
Computes the distance from this point to the line given by rclBase and rclDirect. More... | |
Vector3 | DistanceToLineSegment (const Vector3 &rclP1, const Vector3 &rclP2) const |
Static Public Member Functions | |
static num_type | epsilon () |
Public data members | |
_Precision | x |
_Precision | y |
_Precision | z |
Vector3 (_Precision fx=0.0, _Precision fy=0.0, _Precision fz=0.0) | |
Construction. More... | |
Vector3 (const Vector3< _Precision > &rcVct) | |
Construction. More... | |
The Vector Base class.
typedef _Precision Base::Vector3< _Precision >::num_type |
typedef float_traits<num_type> Base::Vector3< _Precision >::traits_type |
|
explicit |
Construction.
Base::Vector3< _Precision >::Vector3 | ( | const Vector3< _Precision > & | rcVct | ) |
Construction.
Vector3 Base::Vector3< _Precision >::Cross | ( | const Vector3< _Precision > & | rcVct | ) | const |
Cross product.
_Precision Base::Vector3< _Precision >::DistanceToLine | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclDirect | ||
) | const |
Computes the distance from this point to the line given by rclBase and rclDirect.
Vector3 Base::Vector3< _Precision >::DistanceToLineSegment | ( | const Vector3< _Precision > & | rclP1, |
const Vector3< _Precision > & | rclP2 | ||
) | const |
Computes the vector from this point to the point on the line segment with the shortest distance. The line segment is defined by rclP1 and rclP2. Note: If the projection of this point is outside the segment then the shortest distance to rclP1 or rclP2 is computed.
_Precision Base::Vector3< _Precision >::DistanceToPlane | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclNorm | ||
) | const |
Computes the distance to the given plane. Depending on the side this point is located the distance can also be negative. The distance is positive if the point is at the same side the plane normal points to, negative otherwise.
_Precision Base::Vector3< _Precision >::Dot | ( | const Vector3< _Precision > & | rcVct | ) | const |
Scalar product.
|
inlinestatic |
_Precision Base::Vector3< _Precision >::GetAngle | ( | const Vector3< _Precision > & | rcVect | ) | const |
Get angle between both vectors. The returned value lies in the interval [0,pi].
bool Base::Vector3< _Precision >::IsEqual | ( | const Vector3< _Precision > & | rclPnt, |
_Precision | tol | ||
) | const |
IsEqual.
rclPnt | |
tol |
bool Base::Vector3< _Precision >::IsOnLineSegment | ( | const Vector3< _Precision > & | startVct, |
const Vector3< _Precision > & | endVct | ||
) | const |
Check if Vector is on a line segment.
_Precision Base::Vector3< _Precision >::Length | ( | void | ) | const |
Length of the vector.
void Base::Vector3< _Precision >::Move | ( | _Precision | fX, |
_Precision | fY, | ||
_Precision | fZ | ||
) |
void Base::Vector3< _Precision >::MoveX | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::MoveY | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::MoveZ | ( | _Precision | f | ) |
Vector3& Base::Vector3< _Precision >::Normalize | ( | void | ) |
Set length to 1.
bool Base::Vector3< _Precision >::operator!= | ( | const Vector3< _Precision > & | rcVct | ) | const |
Comparing for inequality.
Vector3 Base::Vector3< _Precision >::operator% | ( | const Vector3< _Precision > & | rcVct | ) | const |
Cross product.
Vector3 Base::Vector3< _Precision >::operator& | ( | const Vector3< _Precision > & | rcVct | ) | const |
Vector3 Base::Vector3< _Precision >::operator* | ( | _Precision | fScale | ) | const |
Vector scaling.
_Precision Base::Vector3< _Precision >::operator* | ( | const Vector3< _Precision > & | rcVct | ) | const |
Scalar product.
Vector3& Base::Vector3< _Precision >::operator*= | ( | _Precision | fScale | ) |
Vector3 Base::Vector3< _Precision >::operator+ | ( | const Vector3< _Precision > & | rcVct | ) | const |
Vector addition.
Vector3& Base::Vector3< _Precision >::operator+= | ( | const Vector3< _Precision > & | rcVct | ) |
Vector summation.
Vector3 Base::Vector3< _Precision >::operator- | ( | const Vector3< _Precision > & | rcVct | ) | const |
Vector subtraction.
Vector3 Base::Vector3< _Precision >::operator- | ( | void | ) | const |
Negative vector.
Vector3& Base::Vector3< _Precision >::operator-= | ( | const Vector3< _Precision > & | rcVct | ) |
Vector subtraction.
Vector3 Base::Vector3< _Precision >::operator/ | ( | _Precision | fDiv | ) | const |
Vector3& Base::Vector3< _Precision >::operator/= | ( | _Precision | fDiv | ) |
Vector3& Base::Vector3< _Precision >::operator= | ( | const Vector3< _Precision > & | rcVct | ) |
Assignment.
bool Base::Vector3< _Precision >::operator== | ( | const Vector3< _Precision > & | rcVct | ) | const |
Comparing for equality.
_Precision& Base::Vector3< _Precision >::operator[] | ( | unsigned short | usIndex | ) |
Returns a reference to a coordinate. usIndex must be in the range [0,2].
const _Precision& Base::Vector3< _Precision >::operator[] | ( | unsigned short | usIndex | ) | const |
Returns a const reference to a coordinate. usIndex must be in the range [0,2].
Vector3 Base::Vector3< _Precision >::Perpendicular | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclDir | ||
) | const |
Get the perpendicular of this point to the line defined by rclBase and rclDir. Note: Do not mix up this method with ProjectToLine.
Vector3& Base::Vector3< _Precision >::ProjectToLine | ( | const Vector3< _Precision > & | rclPoint, |
const Vector3< _Precision > & | rclLine | ||
) |
Projects this point onto the line given by the base rclPoint and the direction rclLine.
Projects a point rclPoint onto the line defined by the origin and the direction rclLine. The result is a vector from rclPoint to the point on the line. The length of this vector is the distance from rclPoint to the line. Note: The resulting vector does not depend on the current vector.
Vector3& Base::Vector3< _Precision >::ProjectToPlane | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclNorm | ||
) |
Projects this point onto the plane given by the base rclBase and the normal rclNorm.
void Base::Vector3< _Precision >::ProjectToPlane | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclNorm, | ||
Vector3< _Precision > & | rclProj | ||
) | const |
Projects this point onto the plane given by the base rclBase and the normal rclNorm and stores the result in rclProj.
void Base::Vector3< _Precision >::RotateX | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::RotateY | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::RotateZ | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::Scale | ( | _Precision | fX, |
_Precision | fY, | ||
_Precision | fZ | ||
) |
void Base::Vector3< _Precision >::ScaleX | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::ScaleY | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::ScaleZ | ( | _Precision | f | ) |
void Base::Vector3< _Precision >::Set | ( | _Precision | fX, |
_Precision | fY, | ||
_Precision | fZ | ||
) |
_Precision Base::Vector3< _Precision >::Sqr | ( | void | ) | const |
Squared length of the vector.
void Base::Vector3< _Precision >::TransformToCoordinateSystem | ( | const Vector3< _Precision > & | rclBase, |
const Vector3< _Precision > & | rclDirX, | ||
const Vector3< _Precision > & | rclDirY | ||
) |
Transforms this point to the coordinate system defined by origin rclBase, vector vector rclDirX and vector vector rclDirY.
_Precision Base::Vector3< _Precision >::x |
x-coordinate
_Precision Base::Vector3< _Precision >::y |
y-coordinate
_Precision Base::Vector3< _Precision >::z |
z-coordinate