X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_MAT2d.cxx;h=b90ca2b8c19449ff28cb572428ca13327da36ff4;hb=HEAD;hp=8e3eaeb6481d4b44f0c31cd2c705641b30f5664d;hpb=8d297d6698f361d4f2dde723050bcfbaea050920;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx index 8e3eaeb64..68cdf8aea 100644 --- a/src/SMESHUtils/SMESH_MAT2d.cxx +++ b/src/SMESHUtils/SMESH_MAT2d.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -46,11 +46,9 @@ #include #include -#ifdef _DEBUG_ -//#define _MYDEBUG_ #include "SMESH_File.hxx" #include "SMESH_Comment.hxx" -#endif +#include "utilities.h" using namespace std; using boost::polygon::x; @@ -155,12 +153,13 @@ namespace // } // ------------------------------------------------------------------------------------- -#ifdef _MYDEBUG_ + // writes segments into a txt file readable by voronoi_visualizer void inSegmentsToFile( vector< InSegment>& inSegments) { - if ( inSegments.size() > 1000 ) + if (inSegments.size() > 1000 || !SALOME::VerbosityActivated()) return; + const char* fileName = "/misc/dn25/salome/eap/salome/misc/Code/C++/MAdebug.txt"; const char* user = getenv("USER"); if ( !user || strcmp( user, "eap" )) return; @@ -219,11 +218,6 @@ namespace } while (edge != cell->incident_edge()); } } -#else - #define inSegmentsToFile(arg) {} - //void dumpEdge( const TVDEdge* edge ) {} - //void dumpCell( const TVDCell* cell ) {} -#endif } // ------------------------------------------------------------------------------------- @@ -420,7 +414,9 @@ namespace void bndSegsToMesh( const vector< vector< BndSeg > >& bndSegsPerEdge ) { -#ifdef _MYDEBUG_ + if (bndSegsPerEdge.empty() || !SALOME::VerbosityActivated()) + return; + if ( !getenv("bndSegsToMesh")) return; map< const TVDVertex *, int > v2Node; map< const TVDVertex *, int >::iterator v2n; @@ -470,7 +466,6 @@ namespace text << "\n"; file.write( text.c_str(), text.size() ); cout << fileName << endl; -#endif } //================================================================================ @@ -673,14 +668,12 @@ namespace // make 'scale' such that to have coordinates precise enough when converted to int gp_XY uvMin = uvBox.CornerMin(), uvMax = uvBox.CornerMax(); - uvMin.ChangeCoord(1) = uvMin.X() * scale[0]; - uvMin.ChangeCoord(2) = uvMin.Y() * scale[1]; - uvMax.ChangeCoord(1) = uvMax.X() * scale[0]; - uvMax.ChangeCoord(2) = uvMax.Y() * scale[1]; + uvMin *= gp_XY( scale[0], scale[1] ); + uvMax *= gp_XY( scale[0], scale[1] ); double vMax[2] = { Max( Abs( uvMin.X() ), Abs( uvMax.X() )), Max( Abs( uvMin.Y() ), Abs( uvMax.Y() )) }; int iMax = ( vMax[0] > vMax[1] ) ? 0 : 1; - const double precision = Min( 1e-5, minSegLen * 1e-2 ); + const double precision = Min( 1e-5, Min( minSegLen * 1e-2, vMax[iMax] * 1e-5 )); double preciScale = Min( vMax[iMax] / precision, std::numeric_limits::max() / vMax[iMax] ); preciScale /= scale[iMax]; @@ -1079,6 +1072,11 @@ namespace } } + else // 2D_mesh_QuadranglePreference_00/A1, bos20144.brep + { + continue; // bndSegs.size() == 1 + } + bndSegs[i].setBranch( branchID, bndSegsPerEdge ); // set to i-th and to the opposite bndSeg if ( bndSegs[i].hasOppositeEdge() ) branchEdges[ bndSegs[i].branchID() ].push_back( bndSegs[i]._edge );