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

0025253: gp_trsf code cleaning

More accurate code of transformation type definition
This commit is contained in:
pdn 2014-09-22 17:12:59 +04:00 committed by bugmaster
parent 71598a83cd
commit 5792217118

View File

@ -233,16 +233,7 @@ void gp_Trsf::SetDisplacement (const gp_Ax3& FromA1,
void gp_Trsf::SetTranslationPart (const gp_Vec& V) { void gp_Trsf::SetTranslationPart (const gp_Vec& V) {
loc = V.XYZ(); loc = V.XYZ();
Standard_Real X = loc.X(); const Standard_Boolean locnull = (loc.SquareModulus() < gp::Resolution());
if (X < 0) X = - X;
Standard_Real Y = loc.Y();
if (Y < 0) Y = - Y;
Standard_Real Z = loc.Z();
if (Z < 0) Z = - Z;
Standard_Boolean locnull =
(X <= gp::Resolution() &&
Y <= gp::Resolution() &&
Z <= gp::Resolution());
switch (shape) { switch (shape) {
@ -261,6 +252,9 @@ void gp_Trsf::SetTranslationPart (const gp_Vec& V) {
case gp_Scale : case gp_Scale :
case gp_CompoundTrsf : case gp_CompoundTrsf :
case gp_Other : case gp_Other :
if (!locnull) {
shape = gp_CompoundTrsf;
}
break; break;
} }
} }