Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SMatrix Class Reference

Matrix with 3 lines and 4 columns to make any transformation.
This class should be used in order to apply transformations to other components. More...

#include <SMatrix.h>

Inheritance diagram for SMatrix:
SObject

Public Types

enum  ConstraintFlag {
  TRANSLATION_X , TRANSLATION_Y , TRANSLATION_Z , ROTATION_X ,
  ROTATION_Y , ROTATION_Z , ALL_MOVEMENT
}
 
enum  SequenceEnum { OrderXYZ , OrderYXZ , OrderZXY }
 
enum  UnitEnum { RADIAN , DEGREE }
 

Public Slots

Number AddToDocAsUCS (String Name, Boolean IsActivated)
 To add the matrix to the scene as an UCS with the given name. More...
 
 ApplyTransformation (SMatrix iMatrixToMul)
 To multiply a matrix by another matrix Apply the transformation on the current matrix.
it's the matrix product of the two matrix : this*_iMatrixToMul. More...
 
static Array BestFitCompute (Array< SComp > CompTable, Number ThresDist, Number BestFitType, ConstraintFlag ConstraintBitMask, SPoint FixedPoint, SVector ConstraintAxis, Boolean iAttractReversedNormals)
 Calculate the matrix that should be applied to each component of a set to make a best fit of all the components in a least squares sense. More...
 
static Array FromActiveCS ()
 Return the matrix associated to the active UCS/WCS. More...
 
static Array FromUCS (String Name)
 Search all the component with the given name. More...
 
Array GetArmCoordinateSystem (Number Index)
 Return the Matrix saved at a given index. More...
 
Array GetEuler (UnitEnum Unit)
 To interpret values from a SMatrix and find the rotation angle and the translation vector. More...
 
Number GetValue (Number Row, Number Column)
 
Array InitAlign (SPoint iFixed_P1, SPoint iFixed_P2, SPoint iFixed_P3, SPoint iMobile_P1, SPoint iMobile_P2, SPoint iMobile_P3)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Array InitAlign (SPoint iFixed_P1, SPoint iFixed_P2, SPoint iMobile_P1, SPoint iMobile_P2)
 Calculates the transformation matrix from matching point couples. More...
 
Array InitAutoRoughAlign (SComp RefComp, SComp CompToAlign)
 Compute the matrix to roughly align a component on another. More...
 
Array InitBestAlign (Array< SPoint > TargetPoints, Array< SPoint > SourcePoints, Number Mode, ConstraintFlag ConstraintBitMask, SPoint FixedPoint, SVector ConstraintAxis)
 Sets the matrix for the best fit mapping of the source points onto the target points in a least squares sense. More...
 
Array InitBestRotate (Array< SPoint > TargetPoints, Array< SPoint > SourcePoints, SPoint iFixPoint)
 Sets the matrix for the best ROTATION mapping of the source points onto the target points in a least squares sense. ONLY ROTATION. More...
 
Array InitBestTranslate (Array< SPoint > TargetPoints, Array< SPoint > SourcePoints)
 Sets the matrix for the best TRANSLATION mapping of the source points onto the target points in a least squares sense. ONLY TRANSLATION. More...
 
 InitIdentity ()
 The matrix is initialized to the unitary matrix. All the cells are initialized to zero except the diagonal which is to 1. More...
 
Array InitInverse (SMatrix Mat)
 Initialises the current matrix to the inversed matrix that is: CurrentMatrix*Mat=IdentityMatrix. More...
 
 InitMirrorAxis (SPoint iAxisP1, SPoint iAxisP2)
 Sets the matrix for an axis mirror. More...
 
 InitMirrorPlane (SPoint iPlanePnt, SVector NormalVect)
 Sets the matrix for a planar mirror. More...
 
 InitMirrorPnt (SPoint iMirrorCenter)
 Sets the matrix for a point mirror. More...
 
 InitQuaternion (Number w, Number x, Number y, Number z)
 Initialize a rotation matrix from a quaternion tuple. More...
 
Array InitRot (Number AngX, Number AngY, Number AngZ, UnitEnum Unit, SequenceEnum Sequence, SPoint OriginPoint)
 Sets the matrix for the rotation around the 3 axis X,Y,Z. More...
 
Array InitRot (SPoint iAxisPt, SVector iAxisVect, Number iAngle, UnitEnum iUnit)
 Sets the matrix for the rotation of an angle around an axis. More...
 
Array InitRPSAlignment (Array< SPoint > TargetPoints, Array< SPoint > SourcePoints, Array< Array< Boolean > > XYZ_Constraints, Array< SCloud > AssociatedClouds, Number Neighborhood)
 Computes the RPS alignement matrix from given source and target points. More...
 
 InitScale (SPoint ScaleCenter, Number XScale, Number YScale, Number ZScale)
 Sets the matrix for a different scale ratio along X, Y and Z with a center. More...
 
Boolean IsIdentity ()
 
static SMatrix New ()
 Default constructor. The matrix is initialized to the unitary matrix. The vector is the null vector. More...
 
static SMatrix New (Array< Number > Row1, Array< Number > Row2, Array< Number > Row3)
 Constructor to define a matrix by defining its rows. More...
 
static SMatrix New (SMatrix Other)
 Constructs a SMatrix by copying the SMatrix Other. More...
 
static SMatrix New (SPoint AxisPt, SVector AxisVect, Number Angle, UnitEnum Unit)
 Constructor to set a rotation matrix of an angle around an axis. If the input data are not coherent, the matrix returned is the identity. More...
 
static SMatrix New (SVector TranslateVector)
 Constructor. The SMatrix obtained is a pure translation. More...
 
Array SaveArmCoordinateSystem (Number Index, SMatrix NewMatrix)
 Save a Matrix as a Coordinate System. If a matrix exists at the input index, it will be deleted. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
Array UpdateArmCoordinateSystem (Number Index, SMatrix NewMatrix)
 Update the matrix at the input index, by multiplying the current matrix by the input matrix. More...
 
Number UpdateUCS (String Name)
 Update with the current matrix the UCS found with the given name. More...
 
String ValuesToString ()
 Get a string representation of the point. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

Matrix with 3 lines and 4 columns to make any transformation.
This class should be used in order to apply transformations to other components.

Member Enumeration Documentation

◆ ConstraintFlag

Enumerator
TRANSLATION_X 

Allow the translation along the X-axis

TRANSLATION_Y 

Allow the translation along the Y-axis

TRANSLATION_Z 

Allow the translation along the Z-axis

ROTATION_X 

Allow the rotation around the X-axis

ROTATION_Y 

Allow the rotation around the Y-axis

ROTATION_Z 

Allow the rotation around the Z-axis

ALL_MOVEMENT 

Disable constraints

◆ SequenceEnum

Enumerator
OrderXYZ 
OrderYXZ 
OrderZXY 

◆ UnitEnum

Enumerator
RADIAN 
DEGREE 

Member Function Documentation

◆ AddToDocAsUCS

Number SMatrix::AddToDocAsUCS ( String  Name,
Boolean  IsActivated 
)
slot

To add the matrix to the scene as an UCS with the given name.

Note
The matrix used for the UCS should not have null rows. Also, the vectors created from the rows should not be parallel.
Return values
0There is no error
1The matrix is not well defined
Parameters
[in]NameName of the UCS
[in]IsActivatedTrue if the UCS should be activated

◆ ApplyTransformation

SMatrix::ApplyTransformation ( SMatrix  iMatrixToMul)
slot

To multiply a matrix by another matrix Apply the transformation on the current matrix.
it's the matrix product of the two matrix : this*_iMatrixToMul.

◆ BestFitCompute

static Array SMatrix::BestFitCompute ( Array< SComp CompTable,
Number  ThresDist,
Number  BestFitType,
ConstraintFlag  ConstraintBitMask,
SPoint  FixedPoint,
SVector  ConstraintAxis,
Boolean  iAttractReversedNormals 
)
staticslot

Calculate the matrix that should be applied to each component of a set to make a best fit of all the components in a least squares sense.

Note
This function analyzes the overlapping area of the objects. It means that an overlapping area must exist. Otherwise the best fit operation may give a non relevant result or no result at all (identity matrix).
If you use this function with clouds, the cloud must represent a surface in order to project point on this cloud. If you have only a few points (less than 100 of overlapping area) it may be difficult for the function to approximate a surface and to make statistic evaluations. The result may be disappointing or you may have no result at all (identity matrix). If you have only a few points in cloud number 1 to best fit with the same number of points matching in cloud number 2, you should prefer the function InitBestAlign().
Before calling the function, the component should be roughly prepositioned so they are not too far from each other.
Return values
Array.ErrorCodeThe error code:
  • 0 OK, no error
  • 1 Invalid list of component or bad / incomplete initialization or impossible to initialize.
Array.MatrixTblArray of resulting matrices defining new component positions, in the same order as the input component table. The first component being assumed as immobile, the first matrix is initialized with the identity matrix.
Array.StdDeviationTblthe registration standard deviation error of each component
Array.MeanErrorTblthe registration mean error of each component
Note
If the fitting error is small, there is a high chance that the position of the component is correct. A high fitting error can come from several factors:
  • The position of the object is not correct.
  • The component is a very "noisy" shape (many measurement errors).
  • The shape (or scale) of the different components are different.

If you register several components together (BestFitType==1), do not forget that if one of the component has a "bad shape" so that it cannot fit correctly with its neighbors, this will also affect the fitting error of the neighbors. However, there is a high chance that the standard deviation of the "worst component" is the highest.

If you register several components together (BestFitType==1), Array.StdDeviationTbl[0] will contain a value although component zero do not moves. This represent the fitting error of component zero with its neighbors in the overlapping areas. If you register all components on the first (BestFitType==0), or if there are only two components, Array.StdDeviationTbl[0] is returned with a null value.

Parameters
[in]CompTableTable of components to best fit together The first component of the list is assumed to be immobile. Valid components in the list are: SCloud, SPoly, SMultiline, SCADSurface
[in]ThresDistIgnore the part of the components whose distance with other components is greater than this threshold. If a complete session is done and BestFitCompute has not been called previously, this value can be set to null to tell the function to take 1/100 of the greatest size. The parameter "ThresDist" is very critical To explain this value, we will take the comparison of a "magnet". When you make the best fit, you "attract" some parts of the shape so that they get closer and to minimize a distance. However, the fitting between the shapes will be correct only if the "attraction" is done between 2 parts representing the same shape in the different objects to fit. In other words, if you attract 2 parts at the opposite extremities of the object to fit, there is a high chance that the position at the end will be incorrect. To avoid this, the "magnet" must limit his attraction to a certain distance and it is the goal of this parameter. The value to set should be in relation with the misalignment error before entering in the command. In other words "how far are the object to align?". In this value, you must also take in account the measurement accuracy and the noise thickness, if any.
[in]BestFitTypeWhich type of best fit should be done ?
  • 0: Component 1 to n are best fitted with the first component (number 0 that is immobile)
  • 1: Best fit all together. (component number i is best fitted with all other n-1 components). This option is ignored if there are only 2 components.
  • 2: Component 1 to n are best fitted with the first component (number 0 that is immobile) and a SCALE is applied on components 1 to n
[in]ConstraintBitMaskTransformation constraints (bit mask option)
  • TRANSLATION_X (ConstraintBitMask & TRANSLATION_X) Allow the translation along the X-axis
  • TRANSLATION_Y (ConstraintBitMask & TRANSLATION_Y) Allow the translation along the Y-axis
  • TRANSLATION_Z (ConstraintBitMask & TRANSLATION_Z) Allow the translation along the Z-axis
  • ROTATION_X (ConstraintBitMask & ROTATION_X) Allow the rotation around the X-axis
  • ROTATION_Y (ConstraintBitMask & ROTATION_Y) Allow the rotation around the Y-axis
  • ROTATION_Z (ConstraintBitMask & ROTATION_Z) Allow the rotation around the Z-axis
[in]FixedPointFixed point. If not null, this point will not move during the rotation.
[in]ConstraintAxisAxis of constraint. If not null, the translation will be guided by this vector.
[in]iAttractReversedNormalsShould we make attraction between surfaces having reversed normals ?
  • false No, do not consider overlapping when surfaces have not the same orientation
  • true Yes, make an attraction between surfaces even if they do not have the same orientation. Note: This option will only affect meshes and clouds containing scanning direction information

◆ FromActiveCS

static Array SMatrix::FromActiveCS ( )
staticslot

Return the matrix associated to the active UCS/WCS.

◆ FromUCS

static Array SMatrix::FromUCS ( String  Name)
staticslot

Search all the component with the given name.

Return values
ArrayAll the SMatrix with the given name

◆ GetArmCoordinateSystem

Array SMatrix::GetArmCoordinateSystem ( Number  Index)
slot

Return the Matrix saved at a given index.

Return values
Array.ErrorCodeThe error code
Array.MatrixThe matrix
  • 0: No error
  • 1: The index is invalid
Parameters
[in]Indexindex of the CS to update (1 to 9)

◆ GetEuler

Array SMatrix::GetEuler ( UnitEnum  Unit)
slot

To interpret values from a SMatrix and find the rotation angle and the translation vector.

Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: The matrix is not a pure rotation, impossible to find rotation and scale, but the translation vector is valid.
Array.VectorThe translation SVector
Array.RotXThe pitch angle (left handed rotation around X) (default RADIAN)
Array.RotYThe roll angle (left handed rotation around Y) (default RADIAN)
Array.RotZThe yaw or heading angle (left handed rotation around Z) (default RADIAN)
Array.ScaleXThe matrix scale along X
Array.ScaleYThe matrix scale along Y
Array.ScaleZThe matrix scale along Z
Parameters
[in]UnitIn which unit will be expressed Angle SMatrix.RADIAN: Angle is in radians SMatrix.DEGREE: Angle is in degrees

◆ GetValue

Number SMatrix::GetValue ( Number  Row,
Number  Column 
)
slot
Returns
Returns the matrix value at the position(Row, Column)
Parameters
[in]Rowindex of the row 0 <= Row < 3
[in]Columnindex of the column 0 <= Column < 4

◆ InitAlign [1/2]

Array SMatrix::InitAlign ( SPoint  iFixed_P1,
SPoint  iFixed_P2,
SPoint  iFixed_P3,
SPoint  iMobile_P1,
SPoint  iMobile_P2,
SPoint  iMobile_P3 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]iFixed_P1Arrival P1
[in]iFixed_P2Arrival P2
[in]iFixed_P3Arrival P3
[in]iMobile_P1Departure P1 to move on iFixed_P1
[in]iMobile_P2Departure P2 to align on segment iFixed_P1 iFixed_P2
[in]iMobile_P3Departure P3 to put on the same plane as iFixed_P1 iFixed_P2 iFixed_P3

◆ InitAlign [2/2]

Array SMatrix::InitAlign ( SPoint  iFixed_P1,
SPoint  iFixed_P2,
SPoint  iMobile_P1,
SPoint  iMobile_P2 
)
slot

Calculates the transformation matrix from matching point couples.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: Transformation could not be computed. Inconsistent points, an identity matrix is initialized.
Parameters
[in]iFixed_P1Arrival P1
[in]iFixed_P2Arrival P2
[in]iMobile_P1Departure P1 to move on iFixed_P1
[in]iMobile_P2Departure P2 to align on segment iFixed_P1 iFixed_P2

◆ InitAutoRoughAlign

Array SMatrix::InitAutoRoughAlign ( SComp  RefComp,
SComp  CompToAlign 
)
slot

Compute the matrix to roughly align a component on another.

Note
The two components to align are supposed to represent the same shape. Unpredictable result may occur if the two components do not represent the same shape or just an overlap portion. If the shape is "symmetric" (sphere, cube, parallelepiped, etc.) the result may be unpredictable modulo 180 degrees.
It is usually necessary to call SMatrix::BestFitCompute after calling InitAutoRoughAlign
Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: Transformation could not be computed. An identity matrix is initialized.
Parameters
[in]RefCompReference component. Valid components in the list are: SCloud, SPoly
[in]CompToAlignComponent to align on RefComp. Valid components in the list are: SCloud, SPoly

◆ InitBestAlign

Array SMatrix::InitBestAlign ( Array< SPoint TargetPoints,
Array< SPoint SourcePoints,
Number  Mode,
ConstraintFlag  ConstraintBitMask,
SPoint  FixedPoint,
SVector  ConstraintAxis 
)
slot

Sets the matrix for the best fit mapping of the source points onto the target points in a least squares sense.

Note
The number of points of each list must be the same and point number i of both lists is assumed to match together.
Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: Transformation could not be computed. Inconsistent points, an identity matrix is initialized.
Parameters
[in]TargetPointsTable of target points
[in]SourcePointsTable of departure points
[in]ModeThe type of transformation to do
  • 0 Rigid (Translation + Rotation ; no affinity)
  • 1 Translation + Rotation + Scale (apply if necessary a scale; SAME scale along X, Y and Z)
[in]ConstraintBitMaskTransformation constraints (bit mask option)
  • TRANSLATION_X (ConstraintBitMask & TRANSLATION_X) Allow the translation along the X-axis
  • TRANSLATION_Y (ConstraintBitMask & TRANSLATION_Y) Allow the translation along the Y-axis
  • TRANSLATION_Z (ConstraintBitMask & TRANSLATION_Z) Allow the translation along the Z-axis
  • ROTATION_X (ConstraintBitMask & ROTATION_X) Allow the rotation around the X-axis
  • ROTATION_Y (ConstraintBitMask & ROTATION_Y) Allow the rotation around the Y-axis
  • ROTATION_Z (ConstraintBitMask & ROTATION_Z) Allow the rotation around the Z-axis
[in]FixedPointFixed point. If not 0, this point will not move during the rotation.
[in]ConstraintAxisAxis of constraint. If not 0, the translation will be guided by this vector.

◆ InitBestRotate

Array SMatrix::InitBestRotate ( Array< SPoint TargetPoints,
Array< SPoint SourcePoints,
SPoint  iFixPoint 
)
slot

Sets the matrix for the best ROTATION mapping of the source points onto the target points in a least squares sense. ONLY ROTATION.

Note
The number of points of each list must be the same and point number i of both lists is assumed to match together.
Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: Transformation could not be computed. Inconsistent points, an identity matrix is initialized.
Parameters
[in]TargetPointsTable of target points
[in]SourcePointsTable of departure points
[in]iFixPointThe point which must not move

◆ InitBestTranslate

Array SMatrix::InitBestTranslate ( Array< SPoint TargetPoints,
Array< SPoint SourcePoints 
)
slot

Sets the matrix for the best TRANSLATION mapping of the source points onto the target points in a least squares sense. ONLY TRANSLATION.

Note
The number of points of each list must be the same and point number i of both lists is assumed to match together.
Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: Transformation could not be computed. Inconsistent points, an identity matrix is initialized.
Parameters
[in]TargetPointsTable of target points
[in]SourcePointsTable of departure points

◆ InitIdentity

SMatrix::InitIdentity ( )
slot

The matrix is initialized to the unitary matrix. All the cells are initialized to zero except the diagonal which is to 1.

◆ InitInverse

Array SMatrix::InitInverse ( SMatrix  Mat)
slot

Initialises the current matrix to the inversed matrix that is: CurrentMatrix*Mat=IdentityMatrix.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: The input matrix cannot be inversed in this case, current matrix is initialized to null matrix
Parameters
[in]MatMatrix to inverse

◆ InitMirrorAxis

SMatrix::InitMirrorAxis ( SPoint  iAxisP1,
SPoint  iAxisP2 
)
slot

Sets the matrix for an axis mirror.

◆ InitMirrorPlane

SMatrix::InitMirrorPlane ( SPoint  iPlanePnt,
SVector  NormalVect 
)
slot

Sets the matrix for a planar mirror.

◆ InitMirrorPnt

SMatrix::InitMirrorPnt ( SPoint  iMirrorCenter)
slot

Sets the matrix for a point mirror.

◆ InitQuaternion

SMatrix::InitQuaternion ( Number  w,
Number  x,
Number  y,
Number  z 
)
slot

Initialize a rotation matrix from a quaternion tuple.

Parameters
[in]zQuaternion tuple (w, x, y, z)

◆ InitRot [1/2]

Array SMatrix::InitRot ( Number  AngX,
Number  AngY,
Number  AngZ,
UnitEnum  Unit,
SequenceEnum  Sequence,
SPoint  OriginPoint 
)
slot

Sets the matrix for the rotation around the 3 axis X,Y,Z.

Return values
Array.ErrorCodeThe error code
  • 0: No error
  • 1: Inconsistent data was entered, an identity matrix is initialized.
Parameters
[in]AngXOmega
[in]AngYPhi
[in]AngZKappa
[in]UnitIn which unit is expressed Angle SMatrix.RADIAN: Angle is in radians SMatrix.DEGREE: Angle is in degrees
[in]SequenceOrder applied of the angles to the Axis SMatrix.OrderXYZ : Applied in order X->Y->Z such that R = Rz*Ry*Rx. This is the Euler convention In aerial photogrammetric measurements this transformation corresponds to the OPK sequence also called (Omega Phi Kappa) with Omega, Phi=Ry and Kappa=Rz. SMatrix.OrderYXZ : Applied in order Y->X->Z such that R=Rz*Rx*Ry. In aerial photogrammetric measurements this transformation corresponds to the POK sequence also called (Phi Omega Kappa) with Omega, Phi=Ry and Kappa=Rz. SMatrix.OrderZXY : Applied in order Z->X->Y such that R=Ry*Rx*Rz. In terrestrial photogrammetric measurements this transformation corresponds to the POK sequence also called (Phi Omega Kappa) with Omega, Kappa=Ry and Phi=Rz.
OriginPointtranslation done in space

◆ InitRot [2/2]

Array SMatrix::InitRot ( SPoint  iAxisPt,
SVector  iAxisVect,
Number  iAngle,
UnitEnum  iUnit 
)
slot

Sets the matrix for the rotation of an angle around an axis.

Return values
Array.ErrorCodeThe error code
  • 0: No error
  • 1: Inconsistent data was entered, an identity matrix is initialized.
Parameters
[in]iAxisPtFirst point of the axis
[in]iAxisVectVector of the axis
[in]iAngleAngle
[in]iUnitIn which unit is expressed Angle SMatrix.RADIAN: Angle is in radians SMatrix.DEGREE: Angle is in degrees

◆ InitRPSAlignment

Array SMatrix::InitRPSAlignment ( Array< SPoint TargetPoints,
Array< SPoint SourcePoints,
Array< Array< Boolean > >  XYZ_Constraints,
Array< SCloud AssociatedClouds,
Number  Neighborhood 
)
slot

Computes the RPS alignement matrix from given source and target points.

Note
Each list's number of points must be the same and point number i from both lists is assumed to match together.
Call ApplyTransformation() to apply the matrix transformation on mobile components
Return values
Array.ErrorCodeThe error code:
  • 0: OK (normal calculation).
  • 1: An error occured.
Parameters
[in]TargetPointsTable of target points
[in]SourcePointsTable of departure points
[in]XYZ_Constraints; The X, Y and Z direction constraints (for RPS alignment)
[in]AssociatedCloudstable of clouds associated with the Source points or null if no optimization on source points to do
The better point nearest from SourcePoints will be used, the distance Neighborhood is used to find this point in the cloud
[in]NeighborhoodThe distance to which mobile points can be adjusted

◆ InitScale

SMatrix::InitScale ( SPoint  ScaleCenter,
Number  XScale,
Number  YScale,
Number  ZScale 
)
slot

Sets the matrix for a different scale ratio along X, Y and Z with a center.

Parameters
[in]ScaleCenterScale center
[in]XScaleX scale
[in]YScaleY scale
[in]ZScaleZ scale

◆ IsIdentity

Boolean SMatrix::IsIdentity ( )
slot
Return values
trueThe matrix is the identity
falseThe matrix is not the identity

◆ New [1/5]

static SMatrix SMatrix::New ( )
staticslot

Default constructor. The matrix is initialized to the unitary matrix. The vector is the null vector.

◆ New [2/5]

static SMatrix SMatrix::New ( Array< Number >  Row1,
Array< Number >  Row2,
Array< Number >  Row3 
)
staticslot

Constructor to define a matrix by defining its rows.

Parameters
[in]Row1the 4 data of the first row
[in]Row2the 4 data of the second row
[in]Row3the 4 data of the third row

◆ New [3/5]

static SMatrix SMatrix::New ( SMatrix  Other)
staticslot

Constructs a SMatrix by copying the SMatrix Other.

◆ New [4/5]

static SMatrix SMatrix::New ( SPoint  AxisPt,
SVector  AxisVect,
Number  Angle,
UnitEnum  Unit 
)
staticslot

Constructor to set a rotation matrix of an angle around an axis. If the input data are not coherent, the matrix returned is the identity.

Parameters
[in]AxisPtFirst point of the axis
[in]AxisVectVector of the axis
[in]AngleAngle
[in]Unitin which unit is expressed Angle SMatrix.RADIAN: Angle is in radians SMatrix.DEGREE: Angle is in degrees

◆ New [5/5]

static SMatrix SMatrix::New ( SVector  TranslateVector)
staticslot

Constructor. The SMatrix obtained is a pure translation.

◆ SaveArmCoordinateSystem

Array SMatrix::SaveArmCoordinateSystem ( Number  Index,
SMatrix  NewMatrix 
)
slot

Save a Matrix as a Coordinate System. If a matrix exists at the input index, it will be deleted.

Return values
Array.ErrorCodeThe error code
  • 0: No error
  • 1: The index is invalid
Parameters
[in]Indexindex of the CS to update (1 to 9)
[in]NewMatrixnew matrix

◆ toString [1/2]

String SMatrix::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SMatrix::toString ( )
staticslot

Get the type of the variable.

◆ UpdateArmCoordinateSystem

Array SMatrix::UpdateArmCoordinateSystem ( Number  Index,
SMatrix  NewMatrix 
)
slot

Update the matrix at the input index, by multiplying the current matrix by the input matrix.

Return values
Array.ErrorCodeThe error code
  • 0: No error
  • 1: The index is invalid
Parameters
[in]Indexindex of the CS to update (1 to 9)
[in]NewMatrixnew matrix

◆ UpdateUCS

Number SMatrix::UpdateUCS ( String  Name)
slot

Update with the current matrix the UCS found with the given name.

Note
The matrix used for the update should not have null rows. Also, the vectors created from the rows should not be parallel.
Return values
0There is no error
1There are more than one UCS with the given name or this is the WCS
2The matrix is not well defined

◆ ValuesToString

String SMatrix::ValuesToString ( )
slot

Get a string representation of the point.