From 579221711810a2b9a97257b7a8014cd1830cf0ce Mon Sep 17 00:00:00 2001 From: pdn Date: Mon, 22 Sep 2014 17:12:59 +0400 Subject: [PATCH] 0025253: gp_trsf code cleaning More accurate code of transformation type definition --- src/gp/gp_Trsf.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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; } } -- 2.39.5