From: pdn Date: Mon, 22 Sep 2014 13:12:59 +0000 (+0400) Subject: 0025253: gp_trsf code cleaning X-Git-Tag: V6_8_0_beta~79 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=579221711810a2b9a97257b7a8014cd1830cf0ce;p=occt-copy.git 0025253: gp_trsf code cleaning More accurate code of transformation type definition --- diff --git a/src/gp/gp_Trsf.cxx b/src/gp/gp_Trsf.cxx index a2baa75fb6..8d7fae2d17 100644 --- a/src/gp/gp_Trsf.cxx +++ b/src/gp/gp_Trsf.cxx @@ -233,16 +233,7 @@ void gp_Trsf::SetDisplacement (const gp_Ax3& FromA1, void gp_Trsf::SetTranslationPart (const gp_Vec& V) { loc = V.XYZ(); - Standard_Real X = loc.X(); - 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()); + const Standard_Boolean locnull = (loc.SquareModulus() < gp::Resolution()); switch (shape) { @@ -261,6 +252,9 @@ void gp_Trsf::SetTranslationPart (const gp_Vec& V) { case gp_Scale : case gp_CompoundTrsf : case gp_Other : + if (!locnull) { + shape = gp_CompoundTrsf; + } break; } }