1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-08 18:40:55 +03:00

0025751: Eliminate GCC warning -Wunused-but-set-variable in gp_GTrsf2d.cxx for Android build

Exception macros conditions have been fixed.
This commit is contained in:
azn 2015-03-12 12:42:01 +03:00 committed by bugmaster
parent 0f9f1f4ea0
commit 18ee2939c3
3 changed files with 39 additions and 47 deletions

View File

@ -122,10 +122,10 @@ void gp_GTrsf::SetForm()
// //
gp_Mat M(matrix); gp_Mat M(matrix);
Standard_Real s = M.Determinant(); Standard_Real s = M.Determinant();
Standard_Real As = s;
if (As < 0) As = - As; if ( Abs(s) < gp::Resolution() )
Standard_ConstructionError_Raise_if Standard_ConstructionError::Raise("gp_GTrsf::SetForm, null determinant");
(As < gp::Resolution(),"gp_GTrsf::SetForm, null determinant");
if (s > 0) if (s > 0)
s = Pow(s,1./3.); s = Pow(s,1./3.);
else else
@ -142,15 +142,11 @@ void gp_GTrsf::SetForm()
TM.Subtract(anIdentity); TM.Subtract(anIdentity);
if (shape==gp_Other) shape = gp_CompoundTrsf; if (shape==gp_Other) shape = gp_CompoundTrsf;
Standard_Integer i, j; for (Standard_Integer i = 1; i <= 3; i++)
for (i=1; i<=3; i++) { for (Standard_Integer j = 1; j <= 3; j++)
for (j=1; j<=3; j++) { if ( Abs( TM.Value(i, j) ) > tol )
As = TM.Value(i,j); {
if (As < 0) As = - As; shape = gp_Other;
if (As > tol) { return;
shape = gp_Other;
return;
} }
}
}
} }

View File

@ -176,9 +176,10 @@ inline void gp_GTrsf::Transforms (Standard_Real& X,
inline gp_Trsf gp_GTrsf::Trsf () const inline gp_Trsf gp_GTrsf::Trsf () const
{ {
if ( Form() == gp_Other )
Standard_ConstructionError::Raise("gp_GTrsf::Trsf() - non-orthogonal GTrsf");
gp_Trsf T; gp_Trsf T;
Standard_ConstructionError_Raise_if
(Form() == gp_Other,"");
T.shape = shape; T.shape = shape;
T.scale = scale; T.scale = scale;
T.matrix = matrix; T.matrix = matrix;

View File

@ -133,40 +133,35 @@ void gp_GTrsf2d::PreMultiply (const gp_GTrsf2d& T)
gp_Trsf2d gp_GTrsf2d::Trsf2d () const gp_Trsf2d gp_GTrsf2d::Trsf2d () const
{ {
gp_Trsf2d T; // Test of orthogonality
Standard_Real value; const Standard_Real aTolerance = Precision::Angular();
#ifndef No_Exception const Standard_Real aTolerance2 = 2.0 * aTolerance;
Standard_Real tolerance = Precision::Angular() ;
Standard_Real tol2 = 2. * tolerance;
#endif
Standard_ConstructionError_Raise_if if ( Form() == gp_Other )
(Form() == gp_Other," gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d (0)"); Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(0)");
Standard_Real value = (matrix.Value(1, 1) * matrix.Value(1, 1)
+ matrix.Value(2, 1) * matrix.Value(2, 1));
if ( Abs(value - 1.) > aTolerance2 )
Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(1)");
value = (matrix.Value(1, 2) * matrix.Value(1, 2)
+ matrix.Value(2, 2) * matrix.Value(2, 2));
if ( Abs(value - 1.) > aTolerance2 )
Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(2)");
value = (matrix.Value(1, 1) * matrix.Value(1, 2)
+ matrix.Value(2, 1) * matrix.Value(2, 2));
if ( Abs(value) > aTolerance )
Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(3)");
//Test of orthogonality gp_Trsf2d aTransformation;
aTransformation.matrix = matrix;
aTransformation.shape = shape;
aTransformation.scale = scale;
aTransformation.loc = loc;
value = (matrix.Value(1,1) * matrix.Value(1,1) + return aTransformation;
matrix.Value(2,1) * matrix.Value(2,1)) ;
Standard_ConstructionError_Raise_if
(Abs(value - 1.) > tol2," gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d (1)");
value = (matrix.Value(1,2) * matrix.Value(1,2) +
matrix.Value(2,2) * matrix.Value(2,2));
Standard_ConstructionError_Raise_if
(Abs(value - 1.) > tol2," gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d (2)");
value = (matrix.Value(1,1) * matrix.Value(1,2) +
matrix.Value(2,1) * matrix.Value(2,2));
Standard_ConstructionError_Raise_if
(Abs(value) > tolerance," gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d (3)");
//
T.matrix = matrix ;
T.shape = shape;
T.scale = scale ;
T.loc = loc;
return T;
} }