-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <TopoDS_Wire.hxx>
#ifdef _DEBUG_
-#define _MYDEBUG_
+//#define _MYDEBUG_
#include "SMESH_File.hxx"
#include "SMESH_Comment.hxx"
#endif
list< const TVDEdge* > _edges; // MA edges in CCW order within _cell
InSegment( InPoint * p0, InPoint * p1, size_t iE)
- : _p0(p0), _p1(p1), _geomEdgeInd(iE) {}
- InSegment() : _p0(0), _p1(0), _geomEdgeInd(0) {}
+ : _p0(p0), _p1(p1), _geomEdgeInd(iE), _cell(0) {}
+ InSegment() : _p0(0), _p1(0), _geomEdgeInd(0), _cell(0) {}
const InPoint& point0() const { return *_p0; }
const InPoint& point1() const { return *_p1; }
if ( inSegments.size() > 1000 )
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;
SMESH_File file(fileName, false );
file.remove();
file.openForWriting();
}
}
#else
- void inSegmentsToFile( vector< InSegment>& inSegments) {}
- void dumpEdge( const TVDEdge* edge ) {}
- void dumpCell( const TVDCell* cell ) {}
+ #define inSegmentsToFile(arg) {}
+ //void dumpEdge( const TVDEdge* edge ) {}
+ //void dumpCell( const TVDCell* cell ) {}
#endif
}
// -------------------------------------------------------------------------------------
// get scale to have the same 2d proportions as in 3d
computeProportionScale( face, uvBox, scale );
- // make scale to have coordinates precise enough when converted to int
+ // 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];
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 = 1e-5;
+ const double precision = Min( 1e-5, minSegLen * 1e-2 );
double preciScale = Min( vMax[iMax] / precision,
std::numeric_limits<int>::max() / vMax[iMax] );
preciScale /= scale[iMax];
{
inPoints[ iP++ ] = points[i-1].getInPoint( scale );
inSegments.push_back( InSegment( & inPoints[ iP-2 ], & inPoints[ iP-1 ], iE ));
+ if ( inPoints[ iP-2 ] == inPoints[ iP-1 ])
+ return false; // too short segment
}
}
}
{
inPoints[ iP++ ] = points[i].getInPoint( scale );
inSegments.push_back( InSegment( & inPoints[ iP-2 ], & inPoints[ iP-1 ], iE ));
+ if ( inPoints[ iP-2 ] == inPoints[ iP-1 ])
+ return false; // too short segment
}
}
}
*/
//================================================================================
-void SMESH_MAT2d::Branch::init( vector<const TVDEdge*>& maEdges,
- const Boundary* boundary,
- map< const TVDVertex*, BranchEndType > endType )
+void SMESH_MAT2d::Branch::init( vector<const TVDEdge*>& maEdges,
+ const Boundary* boundary,
+ map< const TVDVertex*, BranchEndType >& endType )
{
if ( maEdges.empty() ) return;