AnyCAD Rapid SDK  2020
The Rapid CAD SDK
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GVec Class Reference

Public Member Functions

synchronized void delete ()
 
 GVec ()
 
 GVec (GDir V)
 
 GVec (GXYZ Coord)
 
 GVec (double Xv, double Yv, double Zv)
 
 GVec (GPnt P1, GPnt P2)
 
void SetCoord (int Index, double Xi)
 
void SetCoord (double Xv, double Yv, double Zv)
 
void SetX (double X)
 
void SetY (double Y)
 
void SetZ (double Z)
 
void SetXYZ (GXYZ Coord)
 
double Coord (int Index)
 
void Coord (double[] Xv, double[] Yv, double[] Zv)
 
double X ()
 
double Y ()
 
double Z ()
 
GXYZ XYZ ()
 
boolean IsEqual (GVec Other, double LinearTolerance, double AngularTolerance)
 
boolean IsNormal (GVec Other, double AngularTolerance)
 
boolean IsOpposite (GVec Other, double AngularTolerance)
 
boolean IsParallel (GVec Other, double AngularTolerance)
 
double Angle (GVec Other)
 
double AngleWithRef (GVec Other, GVec VRef)
 
double Magnitude ()
 
double SquareMagnitude ()
 
void Add (GVec Other)
 
GVec Added (GVec Other)
 
void Subtract (GVec Right)
 
GVec Subtracted (GVec Right)
 
void Multiply (double Scalar)
 
GVec Multiplied (double Scalar)
 
void Divide (double Scalar)
 
GVec Divided (double Scalar)
 
void Cross (GVec Right)
 
GVec Crossed (GVec Right)
 
double CrossMagnitude (GVec Right)
 
double CrossSquareMagnitude (GVec Right)
 
void CrossCross (GVec V1, GVec V2)
 
GVec CrossCrossed (GVec V1, GVec V2)
 
double Dot (GVec Other)
 
double DotCross (GVec V1, GVec V2)
 
void Normalize ()
 
GVec Normalized ()
 
void Reverse ()
 
GVec Reversed ()
 
void SetLinearForm (double A1, GVec V1, double A2, GVec V2, double A3, GVec V3, GVec V4)
 
void SetLinearForm (double A1, GVec V1, double A2, GVec V2, double A3, GVec V3)
 
void SetLinearForm (double A1, GVec V1, double A2, GVec V2, GVec V3)
 
void SetLinearForm (double A1, GVec V1, double A2, GVec V2)
 
void SetLinearForm (double A1, GVec V1, GVec V2)
 
void SetLinearForm (GVec V1, GVec V2)
 
void Mirror (GVec V)
 
GVec Mirrored (GVec V)
 
void Mirror (GAx1 A1)
 
GVec Mirrored (GAx1 A1)
 
void Mirror (GAx2 A2)
 
GVec Mirrored (GAx2 A2)
 
void Rotate (GAx1 A1, double Ang)
 
GVec Rotated (GAx1 A1, double Ang)
 
void Scale (double S)
 
GVec Scaled (double S)
 
void Transform (GTrsf T)
 
GVec Transformed (GTrsf T)
 

Protected Member Functions

 GVec (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (GVec obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Defines a non-persistent vector in 3D space.

Constructor & Destructor Documentation

GVec.GVec ( )

Creates a zero vector.

GVec.GVec ( GDir  V)

Creates a unitary vector from a direction V.

GVec.GVec ( GXYZ  Coord)

Creates a vector with a triplet of coordinates.

GVec.GVec ( double  Xv,
double  Yv,
double  Zv 
)

Creates a point with its three cartesian coordinates.

GVec.GVec ( GPnt  P1,
GPnt  P2 
)

Creates a vector from two points. The length of the vector is the distance between P1 and P2

Member Function Documentation

void GVec.Add ( GVec  Other)

Adds two vectors

GVec GVec.Added ( GVec  Other)

Adds two vectors

double GVec.Angle ( GVec  Other)

Computes the angular value between <me> and <Other> Returns the angle value between 0 and PI in radian. Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution from gp or Other.Magnitude() <= Resolution because the angular value is indefinite if one of the vectors has a null magnitude.

double GVec.AngleWithRef ( GVec  Other,
GVec  VRef 
)

Computes the angle, in radians, between this vector and vector Other. The result is a value between -Pi and Pi. For this, VRef defines the positive sense of rotation: the angular value is positive, if the cross product this ^ Other has the same orientation as VRef relative to the plane defined by the vectors this and Other. Otherwise, the angular value is negative. Exceptions gp_VectorWithNullMagnitude if the magnitude of this vector, the vector Other, or the vector VRef is less than or equal to gp::Resolution(). Standard_DomainError if this vector, the vector Other, and the vector VRef are coplanar, unless this vector and the vector Other are parallel.

double GVec.Coord ( int  Index)

Returns the coordinate of range Index : Index = 1 => X is returned Index = 2 => Y is returned Index = 3 => Z is returned Raised if Index != {1, 2, 3}.

void GVec.Coord ( double[]  Xv,
double[]  Yv,
double[]  Zv 
)

For this vector returns its three coordinates Xv, Yv, and Zvinline

void GVec.Cross ( GVec  Right)

computes the cross product between two vectors

void GVec.CrossCross ( GVec  V1,
GVec  V2 
)

Computes the triple vector product. <me> ^= (V1 ^ V2)

GVec GVec.CrossCrossed ( GVec  V1,
GVec  V2 
)

Computes the triple vector product. <me> ^ (V1 ^ V2)

GVec GVec.Crossed ( GVec  Right)

computes the cross product between two vectors

double GVec.CrossMagnitude ( GVec  Right)

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

double GVec.CrossSquareMagnitude ( GVec  Right)

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

void GVec.Divide ( double  Scalar)

Divides a vector by a scalar

GVec GVec.Divided ( double  Scalar)

Divides a vector by a scalar

double GVec.Dot ( GVec  Other)

computes the scalar product

double GVec.DotCross ( GVec  V1,
GVec  V2 
)

Computes the triple scalar product <me> * (V1 ^ V2).

boolean GVec.IsEqual ( GVec  Other,
double  LinearTolerance,
double  AngularTolerance 
)

Returns True if the two vectors have the same magnitude value and the same direction. The precision values are LinearTolerance for the magnitude and AngularTolerance for the direction.

boolean GVec.IsNormal ( GVec  Other,
double  AngularTolerance 
)

Returns True if abs(<me>.Angle(Other) - PI/2.) <= AngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp

boolean GVec.IsOpposite ( GVec  Other,
double  AngularTolerance 
)

Returns True if PI - <me>.Angle(Other) <= AngularTolerance Raises VectorWithNullMagnitude if <me>.Magnitude() <= Resolution or Other.Magnitude() <= Resolution from gp

boolean GVec.IsParallel ( GVec  Other,
double  AngularTolerance 
)

Returns True if Angle(<me>, Other) <= AngularTolerance or PI - Angle(<me>, Other) <= AngularTolerance 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 GVec.Magnitude ( )

Computes the magnitude of this vector.

GVec GVec.Mirrored ( GVec  V)

Performs the symmetrical transformation of a vector with respect to the vector V which is the center of the symmetry.

GVec GVec.Mirrored ( GAx1  A1)

Performs the symmetrical transformation of a vector with respect to an axis placement which is the axis of the symmetry.

GVec GVec.Mirrored ( GAx2  A2)

Performs the symmetrical transformation of a vector with respect to a plane. The axis placement A2 locates the plane of the symmetry : (Location, XDirection, YDirection).

GVec GVec.Multiplied ( double  Scalar)

Multiplies a vector by a scalar

void GVec.Multiply ( double  Scalar)

Multiplies a vector by a scalar

void GVec.Normalize ( )

normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.

GVec GVec.Normalized ( )

normalizes a vector Raises an exception if the magnitude of the vector is lower or equal to Resolution from gp.

void GVec.Reverse ( )

Reverses the direction of a vector

GVec GVec.Reversed ( )

Reverses the direction of a vector

GVec GVec.Rotated ( GAx1  A1,
double  Ang 
)

Rotates a vector. A1 is the axis of the rotation. Ang is the angular value of the rotation in radians.

GVec GVec.Scaled ( double  S)

Scales a vector. S is the scaling value.

void GVec.SetCoord ( int  Index,
double  Xi 
)

Changes the coordinate of range Index Index = 1 => X is modified Index = 2 => Y is modified Index = 3 => Z is modified Raised if Index != {1, 2, 3}.

void GVec.SetCoord ( double  Xv,
double  Yv,
double  Zv 
)

For this vector, assigns - the values Xv, Yv and Zv to its three coordinates.

void GVec.SetLinearForm ( double  A1,
GVec  V1,
double  A2,
GVec  V2,
double  A3,
GVec  V3,
GVec  V4 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2 + A3 * V3 + V4

void GVec.SetLinearForm ( double  A1,
GVec  V1,
double  A2,
GVec  V2,
double  A3,
GVec  V3 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2 + A3 * V3

void GVec.SetLinearForm ( double  A1,
GVec  V1,
double  A2,
GVec  V2,
GVec  V3 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2 + V3

void GVec.SetLinearForm ( double  A1,
GVec  V1,
double  A2,
GVec  V2 
)

<me> is set to the following linear form : A1 * V1 + A2 * V2

void GVec.SetLinearForm ( double  A1,
GVec  V1,
GVec  V2 
)

<me> is set to the following linear form : A1 * V1 + V2

void GVec.SetLinearForm ( GVec  V1,
GVec  V2 
)

<me> is set to the following linear form : V1 + V2

void GVec.SetX ( double  X)

Assigns the given value to the X coordinate of this vector.

void GVec.SetXYZ ( GXYZ  Coord)

Assigns the three coordinates of Coord to this vector.

void GVec.SetY ( double  Y)

Assigns the given value to the X coordinate of this vector.

void GVec.SetZ ( double  Z)

Assigns the given value to the X coordinate of this vector.

double GVec.SquareMagnitude ( )

Computes the square magnitude of this vector.

void GVec.Subtract ( GVec  Right)

Subtracts two vectors

GVec GVec.Subtracted ( GVec  Right)

Subtracts two vectors

void GVec.Transform ( GTrsf  T)

Transforms a vector with the transformation T.

GVec GVec.Transformed ( GTrsf  T)

Transforms a vector with the transformation T.

double GVec.X ( )

For this vector, returns its X coordinate.

GXYZ GVec.XYZ ( )

For this vector, returns - its three coordinates as a number triple

double GVec.Y ( )

For this vector, returns its Y coordinate.

double GVec.Z ( )

For this vector, returns its Z coordinate.