From: isn Date: Thu, 24 Nov 2016 13:42:39 +0000 (+0300) Subject: refs #1002 X-Git-Tag: v1.6~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b66a3d2f74b8683586b83b332e4f54b045e4cce6;p=modules%2Fhydro.git refs #1002 --- diff --git a/src/HYDROGUI/HYDROGUI_Polyline.cxx b/src/HYDROGUI/HYDROGUI_Polyline.cxx index 7225e2e6..ccd259aa 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.cxx +++ b/src/HYDROGUI/HYDROGUI_Polyline.cxx @@ -87,10 +87,20 @@ void HYDROGUI_Polyline::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d( aColor, aType, anWidth ); TopExp_Explorer Exp1 ( myshape, TopAbs_EDGE ); + Bnd_Box BB; + BRepBndLib::AddClose(myshape, BB); + double xmin, xmax, ymin, ymax, zmin, zmax; + double devCoeff = 0.1; + if (!BB.IsVoid()) + { + BB.Get(xmin, ymin, zmin, xmax, ymax, zmax); //ignore Z coord + double minSide = Min(Abs(xmax - xmin), Abs(ymax - ymin)); + devCoeff = minSide > 50 ? 0.1 : minSide / 500; + } for ( ; Exp1.More(); Exp1.Next() ) { TopoDS_Edge anEdge = TopoDS::Edge( Exp1.Current() ); - Handle( Graphic3d_ArrayOfPolylines ) anArray = BuildEdgePresentation( anEdge, 0.1 ); + Handle( Graphic3d_ArrayOfPolylines ) anArray = BuildEdgePresentation( anEdge, devCoeff ); if( !anArray.IsNull() ) { aGroup->SetPrimitivesAspect( anAspect );