![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Defines a non-persistent vector in 3D space. More...
#include <gp_Vec.hxx>
Public Member Functions | |
| constexpr | gp_Vec () noexcept=default |
| Creates a zero vector. | |
| constexpr | gp_Vec (const gp_Dir &theV) |
| Creates a unitary vector from a direction theV. | |
| constexpr | gp_Vec (const gp_XYZ &theCoord) noexcept |
| Creates a vector with a triplet of coordinates. | |
| constexpr | gp_Vec (const double theXv, const double theYv, const double theZv) noexcept |
| Creates a point with its three cartesian coordinates. | |
| constexpr | gp_Vec (const gp_Pnt &theP1, const gp_Pnt &theP2) |
| Creates a vector from two points. The length of the vector is the distance between theP1 and theP2. | |
| constexpr void | SetCoord (const int theIndex, const double theXi) |
| Changes the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified theIndex = 3 => Z is modified Raised if theIndex != {1, 2, 3}. | |
| constexpr void | SetCoord (const double theXv, const double theYv, const double theZv) noexcept |
| For this vector, assigns. | |
| constexpr void | SetX (const double theX) noexcept |
| Assigns the given value to the X coordinate of this vector. | |
| constexpr void | SetY (const double theY) noexcept |
| Assigns the given value to the X coordinate of this vector. | |
| constexpr void | SetZ (const double theZ) noexcept |
| Assigns the given value to the X coordinate of this vector. | |
| constexpr void | SetXYZ (const gp_XYZ &theCoord) noexcept |
| Assigns the three coordinates of theCoord to this vector. | |
| constexpr double | Coord (const int theIndex) const |
| Returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned theIndex = 3 => Z is returned Raised if theIndex != {1, 2, 3}. | |
| constexpr void | Coord (double &theXv, double &theYv, double &theZv) const noexcept |
| For this vector returns its three coordinates theXv, theYv, and theZv inline. | |
| constexpr double | X () const noexcept |
| For this vector, returns its X coordinate. | |
| constexpr double | Y () const noexcept |
| For this vector, returns its Y coordinate. | |
| constexpr double | Z () const noexcept |
| For this vector, returns its Z coordinate. | |
| constexpr const gp_XYZ & | XYZ () const noexcept |
| For this vector, returns. | |
| bool | IsEqual (const gp_Vec &theOther, const double theLinearTolerance, const double theAngularTolerance) const |
| Returns True if the two vectors have the same magnitude value and the same direction. The precision values are theLinearTolerance for the magnitude and theAngularTolerance for the direction. | |
| bool | IsNormal (const gp_Vec &theOther, const double theAngularTolerance) const |
| Returns True if abs(<me>.Angle(theOther) - PI/2.) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp. | |
| bool | IsOpposite (const gp_Vec &theOther, const double theAngularTolerance) const |
| Returns True if PI - <me>.Angle(theOther) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp. | |
| bool | IsParallel (const gp_Vec &theOther, const double theAngularTolerance) const |
| Returns True if Angle(<me>, theOther) <= theAngularTolerance or PI - Angle(<me>, theOther) <= theAngularTolerance This definition means that two parallel vectors cannot define a plane but two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp. | |
| double | Angle (const gp_Vec &theOther) const |
| Computes the angular value between <me> and <theOther> Returns the angle value between 0 and PI in radian. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or theOther.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude. | |
| double | AngleWithRef (const gp_Vec &theOther, const gp_Vec &theVRef) const |
| Computes the angle, in radians, between this vector and vector theOther. The result is a value between -Pi and Pi. For this, theVRef defines the positive sense of rotation: the angular value is positive, if the cross product this ^ theOther has the same orientation as theVRef relative to the plane defined by the vectors this and theOther. Otherwise, the angular value is negative. Exceptions gp_VectorWithNullMagnitude if the magnitude of this vector, the vector theOther, or the vector theVRef is less than or equal to gp::Resolution(). Standard_DomainError if this vector, the vector theOther, and the vector theVRef are coplanar, unless this vector and the vector theOther are parallel. | |
| double | Magnitude () const |
| Computes the magnitude of this vector. | |
| constexpr double | SquareMagnitude () const noexcept |
| Computes the square magnitude of this vector. | |
| constexpr void | Add (const gp_Vec &theOther) noexcept |
| Adds two vectors. | |
| constexpr void | operator+= (const gp_Vec &theOther) noexcept |
| constexpr gp_Vec | Added (const gp_Vec &theOther) const noexcept |
| Adds two vectors. | |
| constexpr gp_Vec | operator+ (const gp_Vec &theOther) const noexcept |
| constexpr void | Subtract (const gp_Vec &theRight) noexcept |
| Subtracts two vectors. | |
| constexpr void | operator-= (const gp_Vec &theRight) noexcept |
| constexpr gp_Vec | Subtracted (const gp_Vec &theRight) const noexcept |
| Subtracts two vectors. | |
| constexpr gp_Vec | operator- (const gp_Vec &theRight) const noexcept |
| constexpr void | Multiply (const double theScalar) noexcept |
| Multiplies a vector by a scalar. | |
| constexpr void | operator*= (const double theScalar) noexcept |
| constexpr gp_Vec | Multiplied (const double theScalar) const noexcept |
| Multiplies a vector by a scalar. | |
| constexpr gp_Vec | operator* (const double theScalar) const noexcept |
| constexpr void | Divide (const double theScalar) |
| Divides a vector by a scalar. | |
| constexpr void | operator/= (const double theScalar) |
| constexpr gp_Vec | Divided (const double theScalar) const |
| Divides a vector by a scalar. | |
| constexpr gp_Vec | operator/ (const double theScalar) const |
| constexpr void | Cross (const gp_Vec &theRight) noexcept |
| computes the cross product between two vectors | |
| constexpr void | operator^= (const gp_Vec &theRight) noexcept |
| constexpr gp_Vec | Crossed (const gp_Vec &theRight) const noexcept |
| computes the cross product between two vectors | |
| constexpr gp_Vec | operator^ (const gp_Vec &theRight) const noexcept |
| double | CrossMagnitude (const gp_Vec &theRight) const |
| Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||. | |
| constexpr double | CrossSquareMagnitude (const gp_Vec &theRight) const noexcept |
| Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2. | |
| constexpr void | CrossCross (const gp_Vec &theV1, const gp_Vec &theV2) noexcept |
| Computes the triple vector product. <me> ^= (theV1 ^ theV2) | |
| constexpr gp_Vec | CrossCrossed (const gp_Vec &theV1, const gp_Vec &theV2) const noexcept |
| Computes the triple vector product. <me> ^ (theV1 ^ theV2) | |
| constexpr double | Dot (const gp_Vec &theOther) const noexcept |
| computes the scalar product | |
| constexpr double | operator* (const gp_Vec &theOther) const noexcept |
| constexpr double | DotCross (const gp_Vec &theV1, const gp_Vec &theV2) const noexcept |
| Computes the triple scalar product <me> * (theV1 ^ theV2). | |
| void | Normalize () |
| normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp. | |
| gp_Vec | Normalized () const |
| normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp. | |
| constexpr void | Reverse () noexcept |
| Reverses the direction of a vector. | |
| constexpr gp_Vec | Reversed () const noexcept |
| Reverses the direction of a vector. | |
| constexpr gp_Vec | operator- () const noexcept |
| constexpr void | SetLinearForm (const double theA1, const gp_Vec &theV1, const double theA2, const gp_Vec &theV2, const double theA3, const gp_Vec &theV3, const gp_Vec &theV4) noexcept |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theA3 * theV3 + theV4 | |
| constexpr void | SetLinearForm (const double theA1, const gp_Vec &theV1, const double theA2, const gp_Vec &theV2, const double theA3, const gp_Vec &theV3) noexcept |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theA3 * theV3 | |
| constexpr void | SetLinearForm (const double theA1, const gp_Vec &theV1, const double theA2, const gp_Vec &theV2, const gp_Vec &theV3) noexcept |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3 | |
| constexpr void | SetLinearForm (const double theA1, const gp_Vec &theV1, const double theA2, const gp_Vec &theV2) noexcept |
| <me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 | |
| constexpr void | SetLinearForm (const double theA1, const gp_Vec &theV1, const gp_Vec &theV2) noexcept |
| <me> is set to the following linear form : theA1 * theV1 + theV2 | |
| constexpr void | SetLinearForm (const gp_Vec &theV1, const gp_Vec &theV2) noexcept |
| <me> is set to the following linear form : theV1 + theV2 | |
| void | Mirror (const gp_Vec &theV) noexcept |
| gp_Vec | Mirrored (const gp_Vec &theV) const noexcept |
| Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry. | |
| void | Mirror (const gp_Ax1 &theA1) noexcept |
| gp_Vec | Mirrored (const gp_Ax1 &theA1) const noexcept |
| Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry. | |
| void | Mirror (const gp_Ax2 &theA2) noexcept |
| gp_Vec | Mirrored (const gp_Ax2 &theA2) const noexcept |
| Performs the symmetrical transformation of a vector with respect to a plane. The axis placement theA2 locates the plane of the symmetry : (Location, XDirection, YDirection). | |
| void | Rotate (const gp_Ax1 &theA1, const double theAng) |
| gp_Vec | Rotated (const gp_Ax1 &theA1, const double theAng) const |
| Rotates a vector. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians. | |
| constexpr void | Scale (const double theS) noexcept |
| constexpr gp_Vec | Scaled (const double theS) const noexcept |
| Scales a vector. theS is the scaling value. | |
| void | Transform (const gp_Trsf &theT) |
| Transforms a vector with the transformation theT. | |
| gp_Vec | Transformed (const gp_Trsf &theT) const |
| Transforms a vector with the transformation theT. | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const |
| Dumps the content of me into the stream. | |
Defines a non-persistent vector in 3D space.
|
constexprdefaultnoexcept |
Creates a zero vector.
Creates a unitary vector from a direction theV.
Creates a vector with a triplet of coordinates.
|
inlineconstexprnoexcept |
Creates a point with its three cartesian coordinates.
Creates a vector from two points. The length of the vector is the distance between theP1 and theP2.
Adds two vectors.
Computes the angular value between <me> and <theOther> Returns the angle value between 0 and PI in radian. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or theOther.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude.
Computes the angle, in radians, between this vector and vector theOther. The result is a value between -Pi and Pi. For this, theVRef defines the positive sense of rotation: the angular value is positive, if the cross product this ^ theOther has the same orientation as theVRef relative to the plane defined by the vectors this and theOther. Otherwise, the angular value is negative. Exceptions gp_VectorWithNullMagnitude if the magnitude of this vector, the vector theOther, or the vector theVRef is less than or equal to gp::Resolution(). Standard_DomainError if this vector, the vector theOther, and the vector theVRef are coplanar, unless this vector and the vector theOther are parallel.
Returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned theIndex = 3 => Z is returned Raised if theIndex != {1, 2, 3}.
|
inlineconstexprnoexcept |
For this vector returns its three coordinates theXv, theYv, and theZv inline.
computes the cross product between two vectors
|
inlineconstexprnoexcept |
Computes the triple vector product. <me> ^= (theV1 ^ theV2)
|
inlineconstexprnoexcept |
Computes the triple vector product. <me> ^ (theV1 ^ theV2)
computes the cross product between two vectors
Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||.
|
inlineconstexprnoexcept |
Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2.
Divides a vector by a scalar.
Divides a vector by a scalar.
computes the scalar product
|
inlineconstexprnoexcept |
Computes the triple scalar product <me> * (theV1 ^ theV2).
| void gp_Vec::DumpJson | ( | Standard_OStream & | theOStream, |
| int | theDepth = -1 ) const |
Dumps the content of me into the stream.
| bool gp_Vec::IsEqual | ( | const gp_Vec & | theOther, |
| const double | theLinearTolerance, | ||
| const double | theAngularTolerance ) const |
Returns True if the two vectors have the same magnitude value and the same direction. The precision values are theLinearTolerance for the magnitude and theAngularTolerance for the direction.
Returns True if abs(<me>.Angle(theOther) - PI/2.) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or theOther.Magnitude() <= Resolution from gp.
Returns True if PI - <me>.Angle(theOther) <= theAngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp.
Returns True if Angle(<me>, theOther) <= theAngularTolerance or PI - Angle(<me>, theOther) <= theAngularTolerance This definition means that two parallel vectors cannot define a plane but two vectors with opposite directions are considered as parallel. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp.
|
inline |
Computes the magnitude of this vector.
Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.
Performs the symmetrical transformation of a vector with respect to a plane. The axis placement theA2 locates the plane of the symmetry : (Location, XDirection, YDirection).
Performs the symmetrical transformation of a vector with respect to the vector theV which is the center of the symmetry.
Multiplies a vector by a scalar.
Multiplies a vector by a scalar.
|
inline |
normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.
|
inline |
normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.
Reverses the direction of a vector.
Rotates a vector. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.
Scales a vector. theS is the scaling value.
|
inlineconstexprnoexcept |
For this vector, assigns.
Changes the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified theIndex = 3 => Z is modified Raised if theIndex != {1, 2, 3}.
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theA3 * theV3
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theA3 * theV3 + theV4
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theA1 * theV1 + theA2 * theV2 + theV3
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theA1 * theV1 + theV2
|
inlineconstexprnoexcept |
<me> is set to the following linear form : theV1 + theV2
Assigns the given value to the X coordinate of this vector.
Assigns the three coordinates of theCoord to this vector.
Assigns the given value to the X coordinate of this vector.
Assigns the given value to the X coordinate of this vector.
Computes the square magnitude of this vector.
Subtracts two vectors.
Subtracts two vectors.
Transforms a vector with the transformation theT.
For this vector, returns its X coordinate.
For this vector, returns.
For this vector, returns its Y coordinate.
For this vector, returns its Z coordinate.