From: isn Date: Mon, 20 Nov 2017 15:18:09 +0000 (+0300) Subject: patch for #1427 X-Git-Tag: v2.1.1__salome84~11^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_1427;p=modules%2Fhydro.git patch for #1427 --- diff --git a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx index adfa27e3..9c4392cc 100644 --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include #include @@ -95,26 +97,11 @@ void HYDROData_LCM_FaceClassifier::Classify( const std::vector& thePoints for (int i = 1; i <= NbF; i++) { - Bnd_Box2d B; + Bnd_Box b3d; const TopoDS_Face& F = TopoDS::Face(aFaces(i)); - BRepTools::AddUVBounds(F, B); - - //convert 2d space of planar face to the 3d space of given points - //this is more faster way then getting of bnd3d of faces and project them on plane... - Handle(Geom_Plane) Pl = HYDROData_LCM_FaceClassifier::GetPlane(F); - gp_Trsf RT; - RT.SetTransformation(Pl->Position()); - RT.Invert(); - double xmin, ymin, xmax, ymax; - B.Get(xmin, ymin, xmax, ymax); - gp_Pnt MinP(xmin, ymin, 0), MaxP(xmax, ymax, 0); - MinP.Transform(RT); - MaxP.Transform(RT); - gp_Pnt2d MinPT(MinP.X(), MinP.Y()); - gp_Pnt2d MaxPT(MaxP.X(), MaxP.Y()); + BRepBndLib::Add(F, b3d); Bnd_Box2d NB; - NB.Update(MinPT.X(), MinPT.Y(), MaxPT.X(), MaxPT.Y() ); - + NB.Update(b3d.CornerMin().X(), b3d.CornerMin().Y(), b3d.CornerMax().X(), b3d.CornerMax().Y() ); aTreeFiller.Add(i, NB); BRepTopAdaptor_FClass2d* aClass2d = new BRepTopAdaptor_FClass2d( F, 1E-7 ); aMapF2Class2d.Add(F, aClass2d);