1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Patch for Bug #73"Error of compilation of the OCCT products for 6.7.0.

Method SetValues() with previous list of arguments was added for compatibility
This commit is contained in:
gka
2015-04-07 19:22:24 +03:00
parent 3e056d8e98
commit 00d4616755
2 changed files with 124 additions and 0 deletions

View File

@@ -220,6 +220,33 @@ is
raises
ConstructionError from Standard
is static;
SetValues(me : in out;
a11, a12, a13, a14,
a21, a22, a23, a24,
a31, a32, a33, a34 : Real;
Tolang, TolDist : Real)
---Purpose: Sets the coefficients of the transformation. The
-- transformation of the point x,y,z is the point
-- x',y',z' with :
--
-- x' = a11 x + a12 y + a13 z + a14
-- y' = a21 x + a22 y + a23 z + a24
-- z' = a31 x + a32 y + a43 z + a34
--
-- Tolang and TolDist are used to test for null
-- angles and null distances to determine the form of
-- the transformation (identity, translation, etc..).
--
-- The method Value(i,j) will return aij.
-- Raises ConstructionError if the determinant of the aij is null. Or if
-- the matrix as not a uniform scale.
raises
ConstructionError from Standard
is static;

View File

@@ -356,6 +356,103 @@ void gp_Trsf::SetValues(const Standard_Real a11,
loc = col4;
}
//=======================================================================
//function : SetValues
//purpose :
// 06-01-1998 modified by PMN : On utilise TolDist pour evaluer si les coeffs
// sont nuls : c'est toujours mieux que gp::Resolution !
//=======================================================================
void gp_Trsf::SetValues(const Standard_Real a11,
const Standard_Real a12,
const Standard_Real a13,
const Standard_Real a14,
const Standard_Real a21,
const Standard_Real a22,
const Standard_Real a23,
const Standard_Real a24,
const Standard_Real a31,
const Standard_Real a32,
const Standard_Real a33,
const Standard_Real a34,
// const Standard_Real Tolang,
const Standard_Real ,
const Standard_Real
#ifndef No_Exception
TolDist
#endif
)
{
gp_XYZ col1(a11,a21,a31);
gp_XYZ col2(a12,a22,a32);
gp_XYZ col3(a13,a23,a33);
gp_XYZ col4(a14,a24,a34);
// compute the determinant
gp_Mat M(col1,col2,col3);
Standard_Real s = M.Determinant();
Standard_Real As = s;
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As < gp::Resolution(),"gp_Trsf::SeValues, null determinant");
if (s > 0)
s = Pow(s,1./3.);
else
s = -Pow(-s,1./3.);
M.Divide(s);
// check if the matrix is a rotation matrix
// the transposition should be the invert.
gp_Mat TM(M);
TM.Transpose();
TM.Multiply(M);
//
// don t trust the initial values !
//
gp_Mat anIdentity ;
anIdentity.SetIdentity() ;
TM.Subtract(anIdentity);
As = TM.Value(1,1);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(1,2);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(1,3);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(2,1);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(2,2);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(2,3);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(3,1);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(3,2);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
As = TM.Value(3,3);
if (As < 0) As = - As;
Standard_ConstructionError_Raise_if
(As > TolDist,"gp_Trsf::SeValues, non uniform");
scale = s;
shape = gp_CompoundTrsf;
matrix = M;
loc = col4;
}
//=======================================================================
//function : GetRotation
//purpose :