C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Extended point with homogeneous coordinates in the three-dimensional space. More...

#include <mb_homogeneous3d.h>

+ Collaboration diagram for MbHomogeneous3D:

Public Member Functions

 MbHomogeneous3D ()
 Default constructor.
 
 MbHomogeneous3D (const MbVector3D &v, double ww)
 The constructor by a point and a weight.
 
 MbHomogeneous3D (const MbHomogeneous3D &v)
 Copy constructor.
 
 MbHomogeneous3D (double initX, double initY, double initZ, double initW)
 The constructor by point components and weight.
 
void Init (double xx, double yy, double zz, double ww)
 The initialization by point components and weight.
 
void Init (const MbCartPoint3D &pnt, double weight)
 The initialization by point components and weight.
 
void SetZero ()
 Set a vector with null length.
 
MbHomogeneous3DDuplicate () const
 Create a copy of the element.
 
void Transform (const MbMatrix3D &matr)
 Transform element according to the matrix.
 
double GetWeight () const
 Get a point weight.
 
void GetCartPoint (MbCartPoint3D &pnt) const
 Calculate cartesian coordinates as point.
 
void GetVector (MbVector3D &vect) const
 Calculate cartesian coordinates as vector.
 
void Set (const MbCartPoint3D &pnt)
 Transform a point to homogeneous coordinates.
 
void Set (const MbCartPoint3D &pnt, double weight)
 Transform a point to homogeneous coordinates.
 
void Set (const MbVector3D &vect, double weight)
 Transform a vector to homogeneous coordinates.
 
void Set (const MbCartPoint3D &pnt1, double weight1, const MbCartPoint3D &pnt2, double weight2)
 Set by points. More...
 
void Add (const MbCartPoint3D &pnt, double weight)
 Add a point. More...
 
void Add (const MbCartPoint3D &pnt1, double weight1, const MbCartPoint3D &pnt2, double weight2)
 Add points. More...
 
void Dec (const MbHomogeneous3D &p1, const MbHomogeneous3D &p2, double kk)
 Subtract p2 - p1 multiple by kk.
 
void Set (const MbHomogeneous3D &v1, double t1)
 Equate coordinates of vector with coordinates of point v1 multiplied by t1. More...
 
void Set (const MbHomogeneous3D &v1, double t1, const MbHomogeneous3D &v2, double t2)
 Equate vector coordinates with sum of points v1 and v2 multiplied with t1 and t2 correspondingly.
 
void Set (const MbHomogeneous3D &v1, double t1, const MbHomogeneous3D &v2, double t2, const MbHomogeneous3D &v3, double t3)
 Equate vector coordinates with coordinates of sum of vectors v1, v2 and v3 multiplied with t1, t2 and t3 correspondingly.
 
void Set (const MbHomogeneous3D &v1, double t1, const MbHomogeneous3D &v2, double t2, const MbHomogeneous3D &v3, double t3, const MbHomogeneous3D &v4, double t4)
 Equate vector coordinates with coordinates of sum of points v1, v2, v3 and v4 multiplied with t1, t2, t3 and t4 correspondingly.
 
void Set (const MbHomogeneous3D &v1, double t1, const MbHomogeneous3D &v2, double t2, const MbHomogeneous3D &v3, double t3, const MbHomogeneous3D &v4, double t4, const MbHomogeneous3D &v5, double t5)
 Equate vector coordinates with coordinates of sum of points v1, v2, v3 and v4 multiplied with t1, t2, t3, t4, t5 correspondingly.
 
void Add (const MbHomogeneous3D &v, double t)
 Add vector p multiplied by kk.
 
Overload of arithmetic operations.
MbHomogeneous3D operator+ (const MbHomogeneous3D &with) const
 Add two points.
 
MbHomogeneous3D operator- (const MbHomogeneous3D &with) const
 Subtract a point from the point.
 
MbHomogeneous3D operator/ (double factor) const
 Divide point coordinates by a number.
 
void operator= (const MbHomogeneous3D &)
 Assign a value.
 
void operator*= (double factor)
 Multiply point coordinates by a number.
 
void operator/= (double factor)
 Divide point coordinates by a number.
 
void operator+= (const MbHomogeneous3D &with)
 Add coordinates of the point.
 
bool operator== (const MbHomogeneous3D &) const
 Check for equality.
 
bool operator!= (const MbHomogeneous3D &) const
 Check for inequality.
 
bool IsSame (const MbHomogeneous3D &other, double accuracy) const
 Are the objects equal? More...
 

Public Attributes

double x
 A first point coordinate.
 
double y
 A second point coordinate.
 
double z
 A third point coordinate.
 
double w
 A point weight.
 

Static Public Attributes

static const MbHomogeneous3D zero
 Zero point.
 

Friends

readeroperator>> (reader &in, MbHomogeneous3D &ref)
 Reading function by reference.
 
writeroperator<< (writer &out, const MbHomogeneous3D &ref)
 Writing function by reference.
 
writeroperator<< (writer &out, MbHomogeneous3D &ref)
 Writing function by reference.
 

Detailed Description

Extended point with homogeneous coordinates in the three-dimensional space.

Extended point with homogeneous coordinates in the three-dimensional space. Additional coordinate of a point (weight) is introduced for the convenience of working with non-uniform rational splines.
Operations of transformation of a point and a vector in homogeneous coordinates are defined. Various arithmetic operations of a homogeneous point with a number, a cartesian point and a homogeneous point are defined.

Member Function Documentation

◆ Set() [1/2]

void MbHomogeneous3D::Set ( const MbCartPoint3D pnt1,
double  weight1,
const MbCartPoint3D pnt2,
double  weight2 
)
inline

Set by points.

Coordinates of a point are equal to the sum of homogeneous coordinates of initial points, and weight is equal to the sum of the weights.

Parameters
[in]pnt1,pnt2- Initial points.
[in]weight1,weight2- Weights of points.

◆ Add() [1/2]

void MbHomogeneous3D::Add ( const MbCartPoint3D pnt,
double  weight 
)
inline

Add a point.

Increase coordinates by values of homogeneous coordinates of a point.

Parameters
[in]pnt- The initial point.
[in]weight- A point weight.

◆ Add() [2/2]

void MbHomogeneous3D::Add ( const MbCartPoint3D pnt1,
double  weight1,
const MbCartPoint3D pnt2,
double  weight2 
)
inline

Add points.

Increase coordinates by values of the homogeneous coordinates of two initial points.

Parameters
[in]pnt1,pnt2- Initial points.
[in]weight1,weight2- Weights of points. Add points. Subtract p2 - p1 multiple by kk.

◆ Set() [2/2]

void MbHomogeneous3D::Set ( const MbHomogeneous3D v1,
double  t1 
)
inline

Equate coordinates of vector with coordinates of point v1 multiplied by t1.

Equate vector with vector p multiplied by k.

◆ IsSame()

bool MbHomogeneous3D::IsSame ( const MbHomogeneous3D 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: