C3D Toolkit  Kernel - 109696, Vision - 2.4.0.76

Three-dimensional vector. More...

#include <mesh_float_point3d.h>

Public Member Functions

 MbFloatVector3D ()
 Constructor.
 
 MbFloatVector3D (const MbCartPoint3D &)
 Constructor.
 
 MbFloatVector3D (const MbFloatPoint3D &)
 Constructor.
 
 MbFloatVector3D (const MbVector3D &)
 Constructor.
 
 MbFloatVector3D (const MbFloatVector3D &)
 Constructor.
 
 MbFloatVector3D (const MbFloatPoint3D &p1, const MbFloatPoint3D &p2)
 Constructor by difference of two points: this = p2 - p1.
 
 MbFloatVector3D (float xx, float yy, float zz)
 Constructor by coordinates.
 
 ~MbFloatVector3D ()
 Destructor.
 
Functions of vector.
void Init (float a, float b, float c)
 Initialization by coordinates.
 
void Init (const MbFloatPoint3D &p)
 Initialize by point.
 
void Init (const MbFloatPoint3D &p1, const MbFloatPoint3D &p2)
 Initialize by points.
 
void Init (const MbFloatVector3D &v)
 Initialize by vector.
 
void SetVecM (const MbFloatVector3D &vF, const MbFloatVector3D &vS)
 Set vector product of two given vectors.
 
void Set (const MbFloatVector3D &v1, float t1, const MbFloatVector3D &v2, float t2)
 Initialize by sum of vectors with coefficients.
 
void Set (const MbFloatPoint3D &v1, float t1, const MbFloatPoint3D &v2, float t2)
 Initialize by sum of points with coefficients.
 
void Transform (const MbMatrix3D &)
 Transform according to the matrix.
 
void Rotate (const MbAxis3D &, double angle)
 Rotate about an axis by an angle.
 
bool Normalize ()
 Normalize a vector.
 
void Invert ()
 Change vector direction to opposite.
 
float Length () const
 Length of vector.
 
float Length2 () const
 Squared length of vector.
 
MbFloatVector3D operator- () const
 Operator of subtraction of vectors.
 
MbFloatVector3D operator+ (const MbFloatVector3D &vector) const
 Addition of two vectors; result is vector.
 
MbFloatVector3D operator- (const MbFloatVector3D &vector) const
 Subtraction of two vectors; result is vector.
 
MbFloatVector3D operator+ (const MbFloatPoint3D &pnt) const
 Addition of vector and point.
 
MbFloatVector3D operator- (const MbFloatPoint3D &pnt) const
 Subtraction of point from vector.
 
MbFloatVector3Doperator+= (const MbFloatVector3D &vector)
 Add a vector.
 
MbFloatVector3Doperator-= (const MbFloatVector3D &vector)
 Subtract a vector.
 
MbFloatVector3Doperator*= (float f)
 Multiply by a factor.
 
MbFloatVector3Doperator/= (float f)
 Divide by a factor.
 
void operator= (const MbCartPoint3D &)
 Assign values of point.
 
void operator= (const MbVector3D &)
 Assign values of vector.
 
void operator= (const MbFloatPoint3D &)
 Assign values of point.
 
bool operator== (const MbFloatVector3D &vector) const
 
float operator* (const MbFloatVector3D &vector) const
 Dot-product of two vectors.
 
MbFloatVector3D operator| (const MbFloatVector3D &vector) const
 Vector-product of two vectors.
 
float & operator[] (size_t i)
 
float operator[] (size_t i) const
 
bool IsZero (double eps=Math::lengthEpsilon) const
 Whether vector is equal to zero with specified tolerance.
 
void GetVector (MbVector3D &p) const
 Get vector (by analogy with MbFloatPoint3D).
 
float MaxFactor () const
 Get the largest absolute value of a vector.
 
void GetProperties (MbProperties &)
 Get properties of the object.
 
void SetProperties (const MbProperties &)
 Set properties of the object.
 
bool IsSame (const MbFloatVector3D &other, double accuracy) const
 Are the objects equal? More...
 

Public Attributes

float x
 First component of vector.
 
float y
 Second component of vector.
 
float z
 Third component of vector.
 

Detailed Description

Three-dimensional vector.

Three-dimensional vector as data type is similar to MbVector3D, however based on more rough floating point number representation. It is used in such data structures as triangulation (MbGrid) for approximated representation of objects.

Member Function Documentation

◆ IsSame()

bool MbFloatVector3D::IsSame ( const MbFloatVector3D other,
double  accuracy 
) const
inline

Are the objects equal?

The objects are equal if their data are equal with a given accuracy.

Parameters
[in]other- The object to compare.
[in]accuracy- The accuracy to compare.
Returns
Whether the objects are equal.

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