C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
The three-dimensional point. More...
#include <mb_cart_point3d.h>
Public Member Functions | |
MbCartPoint3D () | |
Constructor without parameters. A point is located at the origin of global coordinates. | |
MbCartPoint3D (const MbCartPoint3D &p) | |
Copy-constructor. | |
MbCartPoint3D (const MbFloatPoint3D &) | |
Copy-constructor. | |
MbCartPoint3D (double xx, double yy, double zz) | |
Constructor by coordinates. | |
MbCartPoint3D (const MbCartPoint3D &p, const MbMatrix3D &matr) | |
Constructor by a point in a local coordinate system. More... | |
MbCartPoint3D (const MbCartPoint &p, const MbPlacement3D &place) | |
Constructor by a two-dimensional point. More... | |
void | Init (const MbCartPoint &p, const MbPlacement3D &place) |
The initialization by two-dimensional point. More... | |
void | Init (const MbCartPoint &p) |
The initialization by two-dimensional point. | |
template<class Point > | |
MbCartPoint3D & | Init (const Point &p) |
Initialize by another point. | |
MbCartPoint3D & | Init (double xx, double yy, double zz) |
Initialize by coordinates. | |
MbCartPoint3D & | Transform (const MbMatrix3D &) |
Transform according to the matrix. | |
MbCartPoint3D & | Move (double dx, double dy, double dz) |
Translate along a vector. | |
MbCartPoint3D & | Move (const MbVector3D &to) |
Translate along a vector. | |
MbCartPoint3D & | Rotate (const MbAxis3D &, double angle) |
Rotate around an axis. | |
double | DistanceToPoint (const MbCartPoint3D &) const |
The distance to a point. | |
void | SetZero () |
Set coordinates to zero. | |
double | DistanceToPoint2 (const MbCartPoint3D &to) const |
The squared distance between two points. More... | |
void | MoveAlongLine (const MbCartPoint3D &to, double delta) |
Translate in the direction of the "to" point on the "delta" distance. | |
void | GoNearToPoint (const MbCartPoint3D &to, double ratio) |
Translate along the direction. More... | |
void | Maximum (const MbCartPoint3D &p) |
The initialization by the maximum coordinates. More... | |
void | Minimum (const MbCartPoint3D &p) |
The initialization by the minimal coordinates. More... | |
void | Perspective (double znear) |
Increase coordinates x and y in ( znear / z ) times. More... | |
void | Mirror (const MbCartPoint3D &p0, const MbVector3D &dir) |
The specular reflection of a point relative to a plane. More... | |
void | Scale (double sx, double sy, double sz) |
Scale the coordinates. More... | |
void | Scale (double s) |
Scale the coordinates. More... | |
double | MaxFactor () const |
Get the maximum absolute coordinate | |
bool | SetRoundedValue (bool total, double eps) |
Rounded with eps tolerance. More... | |
void | GetProperties (MbProperties &) |
Get properties of the object. | |
void | SetProperties (const MbProperties &) |
Set properties of the object. | |
bool | IsSame (const MbCartPoint3D &other, double accuracy) const |
Are the objects equal? More... | |
bool | IsUndefined () const |
Is the point undefined? | |
Logical and arithmetical operations. | |
void | operator+= (const MbVector3D &) |
Add a vector. | |
void | operator-= (const MbVector3D &) |
Subtract a vector. | |
void | operator+= (const MbCartPoint3D &) |
Add point coordinates. | |
void | operator-= (const MbCartPoint3D &) |
Subtract point coordinates. | |
void | operator*= (double factor) |
Multiply coordinates by a factor. | |
void | operator/= (double factor) |
Divide coordinates by a factor. | |
bool | operator== (const MbCartPoint3D &) const |
Check for equality. | |
bool | operator!= (const MbCartPoint3D &) const |
Check for inequality. | |
bool | operator< (const MbCartPoint3D &) const |
Check for "less". | |
bool | operator> (const MbCartPoint3D &) const |
Check for "greater". | |
MbCartPoint3D & | operator= (const MbCartPoint3D &) |
Assign coordinates of another point to the point. | |
MbCartPoint3D & | operator= (const MbFloatPoint3D &) |
Assign coordinates of another point to the point. | |
MbCartPoint3D & | operator= (const MbVector3D &) |
Assign vector components to the point. | |
MbCartPoint3D & | operator= (const MbHomogeneous3D &) |
Assign values of uniform coordinates to the point. | |
MbCartPoint3D | operator+ (const MbVector3D &) const |
Add a point and vector. | |
MbCartPoint3D | operator- (const MbVector3D &) const |
Subtract a vector from the point. | |
MbVector3D | operator+ (const MbCartPoint3D &) const |
Add two points. | |
MbVector3D | operator- (const MbCartPoint3D &) const |
Subtract a point from the point. | |
MbCartPoint3D | operator- () const |
The unary minus. | |
MbCartPoint3D | operator* (const MbMatrix3D &) const |
Calculate the point as this copy transformed by the matrix. | |
double & | operator[] (size_t i) |
Access to a coordinate by an index. | |
double | operator[] (size_t i) const |
The value of a coordinate by an index. | |
The functions of addition and multiplication of points with points and vectors. | |
MbCartPoint3D & | SetAdd (const MbCartPoint3D &v1, const MbVector3D &v2) |
Equate coordinates to sum of point coordinates and vector coordinates. More... | |
MbCartPoint3D & | SetDec (const MbCartPoint3D &v1, const MbVector3D &v2) |
Equate difference between the coordinates of point and vector to coordinates. More... | |
MbCartPoint3D & | Set (const MbCartPoint3D &v1, const MbVector3D &v2, double t2) |
Equate coordinates to sum of point coordinates and vector coordinates. More... | |
MbCartPoint3D & | Set (const MbCartPoint3D &v1, const MbVector3D &v2, double t2, const MbVector3D &v3, double t3) |
Equate coordinates to sum of point coordinates and two vectors coordinates. More... | |
MbCartPoint3D & | Set (const MbVector3D &v1, double t1, const MbVector3D &v2, double t2) |
Equate sum of the components of two vectors to coordinates. More... | |
MbCartPoint3D & | Set (const MbVector3D &v1, double t1, const MbVector3D &v2, double t2, const MbVector3D &v3, double t3, const MbVector3D &v4, double t4) |
Equate coordinates to sum of the components of four vectors. More... | |
MbCartPoint3D & | Set (const MbCartPoint3D &v1, double t1, const MbCartPoint3D &v2, double t2) |
Equate coordinates to sum of two points coordinates. More... | |
MbCartPoint3D & | Set (const MbCartPoint3D &v1, double t1, const MbCartPoint3D &v2, double t2, const MbCartPoint3D &v3, double t3) |
Equate coordinates to sum of three points coordinates. More... | |
MbCartPoint3D & | Set (const MbCartPoint3D &v1, double t1, const MbCartPoint3D &v2, double t2, const MbCartPoint3D &v3, double t3, const MbCartPoint3D &v4, double t4) |
Equate coordinates to sum of four points coordinates. More... | |
void | Add (const MbVector3D &v1, double t1) |
Increase coordinates by values of vector components. More... | |
void | Add (const MbVector3D &v1, double t1, const MbVector3D &v2, double t2) |
Increase coordinates by values of two vectors components. More... | |
void | Add (const MbVector3D &v1, double t1, const MbVector3D &v2, double t2, const MbVector3D &v3, double t3) |
Increase coordinates by values of three vectors components. More... | |
void | Add (const MbVector3D &v1, double t1, const MbVector3D &v2, double t2, const MbVector3D &v3, double t3, const MbVector3D &v4, double t4) |
Increase coordinates by components values of four vectors. More... | |
void | Add (const MbCartPoint3D &v1, double t1) |
Increase coordinates by values of point coordinates. More... | |
void | Add (const MbCartPoint3D &v1, double t1, const MbCartPoint3D &v2, double t2, const MbCartPoint3D &v3, double t3) |
Increase coordinates by values of three points coordinates. More... | |
void | Add (const MbCartPoint3D &v1, double t1, const MbCartPoint3D &v2, double t2, const MbCartPoint3D &v3, double t3, const MbCartPoint3D &v4, double t4) |
Increase coordinates by values of four points coordinates. More... | |
Static Public Member Functions | |
static size_t | GetDimension () |
The number of point coordinates. | |
Public Attributes | |
double | x |
A first coordinate of point. | |
double | y |
A second coordinate of point. | |
double | z |
A third coordinate of point. | |
Static Public Attributes | |
static const MbCartPoint3D | origin |
The origin or { 0, 0, 0 }. | |
The three-dimensional point.
The three-dimensional point (cartesian point) is defined by three coordinates in a cartesian coordinate system. The point is named cartesian in honor of French scientist Rene Descartes (lat. Renatus Cartesius).
A point can be defined by radius-vector. A radius-vector describes transform which translates a start point of a cartesian coordinate system to a space point with the given coordinates in this system.
MbCartPoint3D::MbCartPoint3D | ( | const MbCartPoint3D & | p, |
const MbMatrix3D & | matr | ||
) |
Constructor by a point in a local coordinate system.
A transition matrix is given for transforming of a point to the global coordinate system from a local coordinate system.
[in] | p | - A point in the local coordinate system. |
[in] | matr | - A transition matrix from the local coordinate system to the global coordinate system. |
MbCartPoint3D::MbCartPoint3D | ( | const MbCartPoint & | p, |
const MbPlacement3D & | place | ||
) |
Constructor by a two-dimensional point.
A two-dimensional point is located in the XOY plane defined by a local coordinate system.
[in] | p | - A two-dimensional point. |
[in] | place | - The initial local coordinate system. |
void MbCartPoint3D::Init | ( | const MbCartPoint & | p, |
const MbPlacement3D & | place | ||
) |
The initialization by two-dimensional point.
A two-dimensional point is located in the XOY plane defined by a local coordinate system.
[in] | p | - A two-dimensional point. |
[in] | place | - The initial local coordinate system. |
|
inline |
The squared distance between two points.
Calculate the squared distance from point to point.
[in] | to | - A point. |
|
inline |
Translate along the direction.
The translation in the direction of point "to" to the distance which is defined by the ratio of "ratio" and the distance between points.
[in] | to | - A point. |
[in] | ratio | - A distance part. |
|
inline |
The initialization by the maximum coordinates.
A coordinate x (or y, z) of a point is initialized by maximum value which is got from comparison of corresponding coordinate of initial point and point given in function argument.
[in] | p | - A given point. |
|
inline |
The initialization by the minimal coordinates.
A coordinate x (or y, z) of a point is initialized by minimal value which is got from comparison of corresponding coordinate of initial point and point given in function argument.
[in] | p | - A given point. |
void MbCartPoint3D::Perspective | ( | double | znear | ) |
Increase coordinates x and y in ( znear / z ) times.
The increase of coordinates is produced for a perspective transformation. A point must be located in a local or view coordinate system. Z-coordinate of a point can't be equal to zero.
[in] | znear | - The value znear/z defines the scale factor. |
|
inline |
The specular reflection of a point relative to a plane.
The specular reflection of a point relative to a plane with origin "p0" and normal "dir".
[in] | p0 | - A point of plane of symmetry. |
[in] | dir | - A direction of normal of plane of symmetry. |
|
inline |
Equate coordinates to sum of point coordinates and vector coordinates.
[in] | v1 | - The initial point. |
[in] | v2 | - The initial vector. |
|
inline |
Equate difference between the coordinates of point and vector to coordinates.
[in] | v1 | - The initial point. |
[in] | v2 | - The initial vector. |
|
inline |
Equate coordinates to sum of point coordinates and vector coordinates.
Equate coordinates to sum of v1 point coordinates and v2 vector coordinates multiplied by t2.
[in] | v1 | - The initial point. |
[in] | v2 | - The initial vector. |
[in] | t2 | - Factor the coordinates of the initial vector v2 are multiplied by. |
|
inline |
Equate coordinates to sum of point coordinates and two vectors coordinates.
Equate coordinates to sum of v1 point coordinates and v2 and v3 vectors coordinates multiplied by the numbers t2 and t3 respectively.
[in] | v1 | - The initial point. |
[in] | v2,v3 | - The initial vectors. |
[in] | t2,t3 | - Coordinates of v2 and v3 vectors are multiplied by these numbers respectively. |
|
inline |
Equate sum of the components of two vectors to coordinates.
Equate coordinates to sum of v1 and v2 vectors components multiplied by the numbers t1 and t2 respectively.
[in] | v1,v2 | - The initial vectors. |
[in] | t1,t2 | - Coordinates of v1 and v2 vectors are multiplied by these numbers respectively. |
|
inline |
Equate coordinates to sum of the components of four vectors.
Equate coordinates to sum of v1, v2, v3 and v4 vectors components multiplied by the numbers t1, t2, t3 and t4 respectively.
[in] | v1,v2,v3,v4 | - The initial vectors. |
[in] | t1,t2,t3,t4 | - Coordinates of v1, v2, v3 and v4 vectors are multiplied by these numbers respectively. |
|
inline |
Equate coordinates to sum of two points coordinates.
Equate coordinates to sum of v1 and v2 points coordinates multiplied by the numbers t1 and t2 respectively.
[in] | v1,v2 | - Initial points. |
[in] | t1,t2 | - Coordinates of v1 and v2 points are multiplied by these numbers respectively. |
|
inline |
Equate coordinates to sum of three points coordinates.
Equate coordinates to sum of v1, v2 and v3 points coordinates multiplied by the numbers t1, t2 and t3 respectively.
[in] | v1,v2,v3 | - Initial points. |
[in] | t1,t2,t3 | - Coordinates of v1, v2 and v3 points are multiplied by these numbers respectively. |
|
inline |
Equate coordinates to sum of four points coordinates.
Equate coordinates to sum of v1, v2, v3 and v4 points coordinates multiplied by the numbers t1, t2, t3 and t4 respectively.
[in] | v1,v2,v3,v4 | - Initial points. |
[in] | t1,t2,t3,t4 | - Coordinates of v1, v2, v3 and v4 points are multiplied by these numbers respectively. |
|
inline |
Increase coordinates by values of vector components.
Increase coordinates by values of v1 vector components multiplied by t1.
[in] | v1 | - The initial vector. |
[in] | t1 | - Coordinates of the initial vector v1 are multiplied by this number. |
|
inline |
Increase coordinates by values of two vectors components.
Increase coordinates by values of v1 and v2 vectors components multiplied by the numbers t1 and t2 respectively.
[in] | v1,v2 | - The initial vectors. |
[in] | t1,t2 | - Coordinates of v1 and v2 vectors are multiplied by these numbers respectively. |
|
inline |
Increase coordinates by values of three vectors components.
Increase coordinates by values of v1, v2 and v3 vectors components multiplied by the numbers t1, t2 and t3 respectively.
[in] | v1,v2,v3 | - The initial vectors. |
[in] | t1,t2,t3 | - Coordinates of v1, v2 and v3 vectors are multiplied by these numbers respectively. |
|
inline |
Increase coordinates by components values of four vectors.
Increase coordinates by components values of vectors v1, v2, v3 and v4 multiplied by the numbers t1, t2, t3 and t4 respectively.
[in] | v1,v2,v3,v4 | - The initial vectors. |
[in] | t1,t2,t3,t4 | - Coordinates of v1, v2, v3 and v4 vectors are multiplied by these numbers respectively. |
|
inline |
Increase coordinates by values of point coordinates.
Increase coordinates by values of v1 point coordinates multiplied by t1.
[in] | v1 | - The initial point. |
[in] | t1 | - Coordinates of the initial point v1 are multiplied by this number. |
|
inline |
Increase coordinates by values of three points coordinates.
Increase coordinates by values of v1, v2 and v3 points coordinates multiplied by the numbers t1, t2 and t3 respectively.
[in] | v1,v2,v3 | - Initial points. |
[in] | t1,t2,t3 | - Coordinates of v1, v2 and v3 points are multiplied by these numbers respectively. |
|
inline |
Increase coordinates by values of four points coordinates.
Increase coordinates by values of v1, v2, v3 and v4 points coordinates multiplied by the numbers t1, t2, t3 and t4 respectively.
[in] | v1,v2,v3,v4 | - Initial points. |
[in] | t1,t2,t3,t4 | - Coordinates of v1, v2, v3 and v4 points are multiplied by these numbers respectively. |
|
inline |
Scale the coordinates.
[in] | sx,sy,sz | - Scale factors for x,y and z components respectively. |
|
inline |
Scale the coordinates.
[in] | s | - A scale factor. |
bool MbCartPoint3D::SetRoundedValue | ( | bool | total, |
double | eps | ||
) |
Rounded with eps tolerance.
Point coordinates are rounded with a given tolerance.
[in] | total | - If true round anyway. |
[in] | eps | - A round-off tolerance. |
|
inline |
Are the objects equal?
The objects are equal if their data are equal with a given accuracy.
[in] | other | - The object to compare. |
[in] | accuracy | - The accuracy to compare. |