Open CASCADE Technology  7.6.0.dev
Public Member Functions

gp_XYZ Class Reference

This class describes a cartesian coordinate entity in 3D space {X,Y,Z}. This entity is used for algebraic calculation. This entity can be transformed with a "Trsf" or a "GTrsf" from package "gp". It is used in vectorial computations or for holding this type of information in data structures. More...

#include <gp_XYZ.hxx>

Inheritance diagram for gp_XYZ:
Inheritance graph
[legend]

Public Member Functions

 gp_XYZ ()
 Creates an XYZ object with zero coordinates (0,0,0) More...
 
 gp_XYZ (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
 creates an XYZ with given coordinates More...
 
void SetCoord (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
 For this XYZ object, assigns the values theX, theY and theZ to its three coordinates. More...
 
void SetCoord (const Standard_Integer theIndex, const Standard_Real theXi)
 modifies the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified theIndex = 3 => Z is modified Raises OutOfRange if theIndex != {1, 2, 3}. More...
 
void SetX (const Standard_Real theX)
 Assigns the given value to the X coordinate. More...
 
void SetY (const Standard_Real theY)
 Assigns the given value to the Y coordinate. More...
 
void SetZ (const Standard_Real theZ)
 Assigns the given value to the Z coordinate. More...
 
Standard_Real Coord (const Standard_Integer theIndex) const
 returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned theIndex = 3 => Z is returned More...
 
Standard_RealChangeCoord (const Standard_Integer theIndex)
 
void Coord (Standard_Real &theX, Standard_Real &theY, Standard_Real &theZ) const
 
const Standard_RealGetData () const
 Returns a const ptr to coordinates location. Is useful for algorithms, but DOES NOT PERFORM ANY CHECKS! More...
 
Standard_RealChangeData ()
 Returns a ptr to coordinates location. Is useful for algorithms, but DOES NOT PERFORM ANY CHECKS! More...
 
Standard_Real X () const
 Returns the X coordinate. More...
 
Standard_Real Y () const
 Returns the Y coordinate. More...
 
Standard_Real Z () const
 Returns the Z coordinate. More...
 
Standard_Real Modulus () const
 computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object. More...
 
Standard_Real SquareModulus () const
 Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object. More...
 
Standard_Boolean IsEqual (const gp_XYZ &theOther, const Standard_Real theTolerance) const
 Returns True if he coordinates of this XYZ object are equal to the respective coordinates Other, within the specified tolerance theTolerance. I.e.: abs(<me>.X() - theOther.X()) <= theTolerance and abs(<me>.Y() - theOther.Y()) <= theTolerance and abs(<me>.Z() - theOther.Z()) <= theTolerance. More...
 
void Add (const gp_XYZ &theOther)
 
void operator+= (const gp_XYZ &theOther)
 
gp_XYZ Added (const gp_XYZ &theOther) const
 
gp_XYZ operator+ (const gp_XYZ &theOther) const
 
void Cross (const gp_XYZ &theOther)
 
void operator^= (const gp_XYZ &theOther)
 
gp_XYZ Crossed (const gp_XYZ &theOther) const
 
gp_XYZ operator^ (const gp_XYZ &theOther) const
 
Standard_Real CrossMagnitude (const gp_XYZ &theRight) const
 Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||. More...
 
Standard_Real CrossSquareMagnitude (const gp_XYZ &theRight) const
 Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2. More...
 
void CrossCross (const gp_XYZ &theCoord1, const gp_XYZ &theCoord2)
 Triple vector product Computes <me> = <me>.Cross(theCoord1.Cross(theCoord2)) More...
 
gp_XYZ CrossCrossed (const gp_XYZ &theCoord1, const gp_XYZ &theCoord2) const
 Triple vector product computes New = <me>.Cross(theCoord1.Cross(theCoord2)) More...
 
void Divide (const Standard_Real theScalar)
 divides <me> by a real. More...
 
void operator/= (const Standard_Real theScalar)
 
gp_XYZ Divided (const Standard_Real theScalar) const
 divides <me> by a real. More...
 
gp_XYZ operator/ (const Standard_Real theScalar) const
 
Standard_Real Dot (const gp_XYZ &theOther) const
 computes the scalar product between <me> and theOther More...
 
Standard_Real operator* (const gp_XYZ &theOther) const
 
Standard_Real DotCross (const gp_XYZ &theCoord1, const gp_XYZ &theCoord2) const
 computes the triple scalar product More...
 
void Multiply (const Standard_Real theScalar)
 
void operator*= (const Standard_Real theScalar)
 
void Multiply (const gp_XYZ &theOther)
 
void operator*= (const gp_XYZ &theOther)
 
void Multiply (const gp_Mat &theMatrix)
 <me> = theMatrix * <me> More...
 
void operator*= (const gp_Mat &theMatrix)
 
gp_XYZ Multiplied (const Standard_Real theScalar) const
 
gp_XYZ operator* (const Standard_Real theScalar) const
 
gp_XYZ Multiplied (const gp_XYZ &theOther) const
 
gp_XYZ Multiplied (const gp_Mat &theMatrix) const
 New = theMatrix * <me> . More...
 
gp_XYZ operator* (const gp_Mat &theMatrix) const
 
void Normalize ()
 
gp_XYZ Normalized () const
 
void Reverse ()
 
gp_XYZ Reversed () const
 
void Subtract (const gp_XYZ &theOther)
 
void operator-= (const gp_XYZ &theOther)
 
gp_XYZ Subtracted (const gp_XYZ &theOther) const
 
gp_XYZ operator- (const gp_XYZ &theOther) const
 
void SetLinearForm (const Standard_Real theA1, const gp_XYZ &theXYZ1, const Standard_Real theA2, const gp_XYZ &theXYZ2, const Standard_Real theA3, const gp_XYZ &theXYZ3, const gp_XYZ &theXYZ4)
 <me> is set to the following linear form : More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XYZ &theXYZ1, const Standard_Real theA2, const gp_XYZ &theXYZ2, const Standard_Real theA3, const gp_XYZ &theXYZ3)
 <me> is set to the following linear form : More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XYZ &theXYZ1, const Standard_Real theA2, const gp_XYZ &theXYZ2, const gp_XYZ &theXYZ3)
 <me> is set to the following linear form : More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XYZ &theXYZ1, const Standard_Real theA2, const gp_XYZ &theXYZ2)
 <me> is set to the following linear form : More...
 
void SetLinearForm (const Standard_Real theA1, const gp_XYZ &theXYZ1, const gp_XYZ &theXYZ2)
 <me> is set to the following linear form : More...
 
void SetLinearForm (const gp_XYZ &theXYZ1, const gp_XYZ &theXYZ2)
 <me> is set to the following linear form : More...
 
void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 
Standard_Boolean InitFromJson (const Standard_SStream &theSStream, Standard_Integer &theStreamPos)
 Inits the content of me from the stream. More...
 

Detailed Description

This class describes a cartesian coordinate entity in 3D space {X,Y,Z}. This entity is used for algebraic calculation. This entity can be transformed with a "Trsf" or a "GTrsf" from package "gp". It is used in vectorial computations or for holding this type of information in data structures.

Constructor & Destructor Documentation

◆ gp_XYZ() [1/2]

gp_XYZ::gp_XYZ ( )
inline

Creates an XYZ object with zero coordinates (0,0,0)

◆ gp_XYZ() [2/2]

gp_XYZ::gp_XYZ ( const Standard_Real  theX,
const Standard_Real  theY,
const Standard_Real  theZ 
)
inline

creates an XYZ with given coordinates

Member Function Documentation

◆ Add()

void gp_XYZ::Add ( const gp_XYZ theOther)
inline
<me>.X() = <me>.X() + theOther.X()
<me>.Y() = <me>.Y() + theOther.Y()
<me>.Z() = <me>.Z() + theOther.Z()

◆ Added()

gp_XYZ gp_XYZ::Added ( const gp_XYZ theOther) const
inline
new.X() = <me>.X() + theOther.X()
new.Y() = <me>.Y() + theOther.Y()
new.Z() = <me>.Z() + theOther.Z()

◆ ChangeCoord()

Standard_Real& gp_XYZ::ChangeCoord ( const Standard_Integer  theIndex)
inline

◆ ChangeData()

Standard_Real* gp_XYZ::ChangeData ( )
inline

Returns a ptr to coordinates location. Is useful for algorithms, but DOES NOT PERFORM ANY CHECKS!

◆ Coord() [1/2]

Standard_Real gp_XYZ::Coord ( const Standard_Integer  theIndex) const
inline

returns the coordinate of range theIndex : theIndex = 1 => X is returned theIndex = 2 => Y is returned theIndex = 3 => Z is returned

Raises OutOfRange if theIndex != {1, 2, 3}.

◆ Coord() [2/2]

void gp_XYZ::Coord ( Standard_Real theX,
Standard_Real theY,
Standard_Real theZ 
) const
inline

◆ Cross()

void gp_XYZ::Cross ( const gp_XYZ theOther)
inline
<me>.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
<me>.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
<me>.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()

◆ CrossCross()

void gp_XYZ::CrossCross ( const gp_XYZ theCoord1,
const gp_XYZ theCoord2 
)
inline

Triple vector product Computes <me> = <me>.Cross(theCoord1.Cross(theCoord2))

◆ CrossCrossed()

gp_XYZ gp_XYZ::CrossCrossed ( const gp_XYZ theCoord1,
const gp_XYZ theCoord2 
) const
inline

Triple vector product computes New = <me>.Cross(theCoord1.Cross(theCoord2))

◆ Crossed()

gp_XYZ gp_XYZ::Crossed ( const gp_XYZ theOther) const
inline
new.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
new.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
new.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()

◆ CrossMagnitude()

Standard_Real gp_XYZ::CrossMagnitude ( const gp_XYZ theRight) const
inline

Computes the magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||.

◆ CrossSquareMagnitude()

Standard_Real gp_XYZ::CrossSquareMagnitude ( const gp_XYZ theRight) const
inline

Computes the square magnitude of the cross product between <me> and theRight. Returns || <me> ^ theRight ||**2.

◆ Divide()

void gp_XYZ::Divide ( const Standard_Real  theScalar)
inline

divides <me> by a real.

◆ Divided()

gp_XYZ gp_XYZ::Divided ( const Standard_Real  theScalar) const
inline

divides <me> by a real.

◆ Dot()

Standard_Real gp_XYZ::Dot ( const gp_XYZ theOther) const
inline

computes the scalar product between <me> and theOther

◆ DotCross()

Standard_Real gp_XYZ::DotCross ( const gp_XYZ theCoord1,
const gp_XYZ theCoord2 
) const
inline

computes the triple scalar product

◆ DumpJson()

void gp_XYZ::DumpJson ( Standard_OStream theOStream,
Standard_Integer  theDepth = -1 
) const

Dumps the content of me into the stream.

◆ GetData()

const Standard_Real* gp_XYZ::GetData ( ) const
inline

Returns a const ptr to coordinates location. Is useful for algorithms, but DOES NOT PERFORM ANY CHECKS!

◆ InitFromJson()

Standard_Boolean gp_XYZ::InitFromJson ( const Standard_SStream theSStream,
Standard_Integer theStreamPos 
)

Inits the content of me from the stream.

◆ IsEqual()

Standard_Boolean gp_XYZ::IsEqual ( const gp_XYZ theOther,
const Standard_Real  theTolerance 
) const

Returns True if he coordinates of this XYZ object are equal to the respective coordinates Other, within the specified tolerance theTolerance. I.e.: abs(<me>.X() - theOther.X()) <= theTolerance and abs(<me>.Y() - theOther.Y()) <= theTolerance and abs(<me>.Z() - theOther.Z()) <= theTolerance.

◆ Modulus()

Standard_Real gp_XYZ::Modulus ( ) const
inline

computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object.

◆ Multiplied() [1/3]

gp_XYZ gp_XYZ::Multiplied ( const gp_Mat theMatrix) const
inline

New = theMatrix * <me> .

◆ Multiplied() [2/3]

gp_XYZ gp_XYZ::Multiplied ( const gp_XYZ theOther) const
inline
new.X() = <me>.X() * theOther.X();
new.Y() = <me>.Y() * theOther.Y();
new.Z() = <me>.Z() * theOther.Z();

◆ Multiplied() [3/3]

gp_XYZ gp_XYZ::Multiplied ( const Standard_Real  theScalar) const
inline
New.X() = <me>.X() * theScalar;
New.Y() = <me>.Y() * theScalar;
New.Z() = <me>.Z() * theScalar;

◆ Multiply() [1/3]

void gp_XYZ::Multiply ( const gp_Mat theMatrix)
inline

<me> = theMatrix * <me>

◆ Multiply() [2/3]

void gp_XYZ::Multiply ( const gp_XYZ theOther)
inline
<me>.X() = <me>.X() * theOther.X();
<me>.Y() = <me>.Y() * theOther.Y();
<me>.Z() = <me>.Z() * theOther.Z();

◆ Multiply() [3/3]

void gp_XYZ::Multiply ( const Standard_Real  theScalar)
inline
<me>.X() = <me>.X() * theScalar;
<me>.Y() = <me>.Y() * theScalar;
<me>.Z() = <me>.Z() * theScalar;

◆ Normalize()

void gp_XYZ::Normalize ( )
inline
<me>.X() = <me>.X()/ <me>.Modulus()
<me>.Y() = <me>.Y()/ <me>.Modulus()
<me>.Z() = <me>.Z()/ <me>.Modulus()

Raised if <me>.Modulus() <= Resolution from gp

◆ Normalized()

gp_XYZ gp_XYZ::Normalized ( ) const
inline
New.X() = <me>.X()/ <me>.Modulus()
New.Y() = <me>.Y()/ <me>.Modulus()
New.Z() = <me>.Z()/ <me>.Modulus()

Raised if <me>.Modulus() <= Resolution from gp

◆ operator*() [1/3]

gp_XYZ gp_XYZ::operator* ( const gp_Mat theMatrix) const
inline

◆ operator*() [2/3]

Standard_Real gp_XYZ::operator* ( const gp_XYZ theOther) const
inline

◆ operator*() [3/3]

gp_XYZ gp_XYZ::operator* ( const Standard_Real  theScalar) const
inline

◆ operator*=() [1/3]

void gp_XYZ::operator*= ( const gp_Mat theMatrix)
inline

◆ operator*=() [2/3]

void gp_XYZ::operator*= ( const gp_XYZ theOther)
inline

◆ operator*=() [3/3]

void gp_XYZ::operator*= ( const Standard_Real  theScalar)
inline

◆ operator+()

gp_XYZ gp_XYZ::operator+ ( const gp_XYZ theOther) const
inline

◆ operator+=()

void gp_XYZ::operator+= ( const gp_XYZ theOther)
inline

◆ operator-()

gp_XYZ gp_XYZ::operator- ( const gp_XYZ theOther) const
inline

◆ operator-=()

void gp_XYZ::operator-= ( const gp_XYZ theOther)
inline

◆ operator/()

gp_XYZ gp_XYZ::operator/ ( const Standard_Real  theScalar) const
inline

◆ operator/=()

void gp_XYZ::operator/= ( const Standard_Real  theScalar)
inline

◆ operator^()

gp_XYZ gp_XYZ::operator^ ( const gp_XYZ theOther) const
inline

◆ operator^=()

void gp_XYZ::operator^= ( const gp_XYZ theOther)
inline

◆ Reverse()

void gp_XYZ::Reverse ( )
inline
<me>.X() = -<me>.X()
<me>.Y() = -<me>.Y()
<me>.Z() = -<me>.Z()

◆ Reversed()

gp_XYZ gp_XYZ::Reversed ( ) const
inline
New.X() = -<me>.X()
New.Y() = -<me>.Y()
New.Z() = -<me>.Z()

◆ SetCoord() [1/2]

void gp_XYZ::SetCoord ( const Standard_Integer  theIndex,
const Standard_Real  theXi 
)
inline

modifies the coordinate of range theIndex theIndex = 1 => X is modified theIndex = 2 => Y is modified theIndex = 3 => Z is modified Raises OutOfRange if theIndex != {1, 2, 3}.

◆ SetCoord() [2/2]

void gp_XYZ::SetCoord ( const Standard_Real  theX,
const Standard_Real  theY,
const Standard_Real  theZ 
)
inline

For this XYZ object, assigns the values theX, theY and theZ to its three coordinates.

◆ SetLinearForm() [1/6]

void gp_XYZ::SetLinearForm ( const gp_XYZ theXYZ1,
const gp_XYZ theXYZ2 
)
inline

<me> is set to the following linear form :

theXYZ1 + theXYZ2

◆ SetLinearForm() [2/6]

void gp_XYZ::SetLinearForm ( const Standard_Real  theA1,
const gp_XYZ theXYZ1,
const gp_XYZ theXYZ2 
)
inline

<me> is set to the following linear form :

theA1 * theXYZ1 + theXYZ2

◆ SetLinearForm() [3/6]

void gp_XYZ::SetLinearForm ( const Standard_Real  theA1,
const gp_XYZ theXYZ1,
const Standard_Real  theA2,
const gp_XYZ theXYZ2 
)
inline

<me> is set to the following linear form :

theA1 * theXYZ1 + theA2 * theXYZ2

◆ SetLinearForm() [4/6]

void gp_XYZ::SetLinearForm ( const Standard_Real  theA1,
const gp_XYZ theXYZ1,
const Standard_Real  theA2,
const gp_XYZ theXYZ2,
const gp_XYZ theXYZ3 
)
inline

<me> is set to the following linear form :

theA1 * theXYZ1 + theA2 * theXYZ2 + theXYZ3

◆ SetLinearForm() [5/6]

void gp_XYZ::SetLinearForm ( const Standard_Real  theA1,
const gp_XYZ theXYZ1,
const Standard_Real  theA2,
const gp_XYZ theXYZ2,
const Standard_Real  theA3,
const gp_XYZ theXYZ3 
)
inline

<me> is set to the following linear form :

theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3

◆ SetLinearForm() [6/6]

void gp_XYZ::SetLinearForm ( const Standard_Real  theA1,
const gp_XYZ theXYZ1,
const Standard_Real  theA2,
const gp_XYZ theXYZ2,
const Standard_Real  theA3,
const gp_XYZ theXYZ3,
const gp_XYZ theXYZ4 
)
inline

<me> is set to the following linear form :

theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3 + theXYZ4

◆ SetX()

void gp_XYZ::SetX ( const Standard_Real  theX)
inline

Assigns the given value to the X coordinate.

◆ SetY()

void gp_XYZ::SetY ( const Standard_Real  theY)
inline

Assigns the given value to the Y coordinate.

◆ SetZ()

void gp_XYZ::SetZ ( const Standard_Real  theZ)
inline

Assigns the given value to the Z coordinate.

◆ SquareModulus()

Standard_Real gp_XYZ::SquareModulus ( ) const
inline

Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object.

◆ Subtract()

void gp_XYZ::Subtract ( const gp_XYZ theOther)
inline
<me>.X() = <me>.X() - theOther.X()
<me>.Y() = <me>.Y() - theOther.Y()
<me>.Z() = <me>.Z() - theOther.Z()

◆ Subtracted()

gp_XYZ gp_XYZ::Subtracted ( const gp_XYZ theOther) const
inline
new.X() = <me>.X() - theOther.X()
new.Y() = <me>.Y() - theOther.Y()
new.Z() = <me>.Z() - theOther.Z()

◆ X()

Standard_Real gp_XYZ::X ( ) const
inline

Returns the X coordinate.

◆ Y()

Standard_Real gp_XYZ::Y ( ) const
inline

Returns the Y coordinate.

◆ Z()

Standard_Real gp_XYZ::Z ( ) const
inline

Returns the Z coordinate.


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