//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//=============================================================================
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
//=============================================================================
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus )
{
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus )
{
const list <const SMESHDS_Hypothesis * > & hyps =
GetUsedHypothesis(aMesh, aShape, /*ignoreAuxiliaryHyps=*/false);
const list <const SMESHDS_Hypothesis * > & hyps =
GetUsedHypothesis(aMesh, aShape, /*ignoreAuxiliaryHyps=*/false);
{
const StdMeshers_LocalLength * hyp =
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
ASSERT(hyp);
_value[ BEG_LENGTH_IND ] = hyp->GetLength();
{
const StdMeshers_LocalLength * hyp =
dynamic_cast <const StdMeshers_LocalLength * >(theHyp);
ASSERT(hyp);
_value[ BEG_LENGTH_IND ] = hyp->GetLength();
- if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 ))
+
+ const double eps = Min( 1E-4, 1./nbSeg/100. );
+
+ if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, eps ))
//================================================================================
/*!
* \brief adjust internal node parameters so that the last segment length == an
//================================================================================
/*!
* \brief adjust internal node parameters so that the last segment length == an
- * \param a1 - the first segment length
- * \param an - the last segment length
- * \param U1 - the first edge parameter
- * \param Un - the last edge parameter
- * \param length - the edge length
- * \param C3d - the edge curve
- * \param theParams - internal node parameters to adjust
- * \param adjustNeighbors2an - to adjust length of segments next to the last one
- * and not to remove parameters
+ * \param a1 - the first segment length
+ * \param an - the last segment length
+ * \param U1 - the first edge parameter
+ * \param Un - the last edge parameter
+ * \param length - the edge length
+ * \param C3d - the edge curve
+ * \param theParams - internal node parameters to adjust
+ * \param adjustNeighbors2an - to adjust length of segments next to the last one
+ * and not to remove parameters
// * \brief Clean mesh on edges
// * \param event - algo_event or compute_event itself (of SMESH_subMesh)
// * \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
// * \brief Clean mesh on edges
// * \param event - algo_event or compute_event itself (of SMESH_subMesh)
// * \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
// */
// void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh,
// EventListenerData*, const SMESH_Hypothesis*)
// */
// void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh,
// EventListenerData*, const SMESH_Hypothesis*)
double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
static StdMeshers_Regular_1D* auxAlgo = 0;
if ( !auxAlgo ) {
double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
static StdMeshers_Regular_1D* auxAlgo = 0;
if ( !auxAlgo ) {
{
TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference!
_gen->Compute( theMesh, mainEdge, SMESH_Gen::SHAPE_ONLY_UPWARD );
{
TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference!
_gen->Compute( theMesh, mainEdge, SMESH_Gen::SHAPE_ONLY_UPWARD );
{
const std::vector<double>& aPnts = _fpHyp->GetPoints();
std::vector<int> nbsegs = _fpHyp->GetNbSegments();
{
const std::vector<double>& aPnts = _fpHyp->GetPoints();
std::vector<int> nbsegs = _fpHyp->GetNbSegments();
// sort normalized params, taking into account theReverse
TColStd_SequenceOfReal Params;
// sort normalized params, taking into account theReverse
TColStd_SequenceOfReal Params;
Params.InsertBefore( 1, 0.0 );
Params.Append( 1.0 );
double eltSize, segmentSize, par1, par2;
Params.InsertBefore( 1, 0.0 );
Params.Append( 1.0 );
double eltSize, segmentSize, par1, par2;
// CLEAN event is incorrectly ptopagated seemingly due to Propagation hyp
// so TEMPORARY solution is to clean the submesh manually
if (SMESHDS_SubMesh * subMeshDS = meshDS->MeshElements(theShape))
// CLEAN event is incorrectly ptopagated seemingly due to Propagation hyp
// so TEMPORARY solution is to clean the submesh manually
if (SMESHDS_SubMesh * subMeshDS = meshDS->MeshElements(theShape))
// take into account reversing the edge the hypothesis is propagated from
// (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain)
reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
// take into account reversing the edge the hypothesis is propagated from
// (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain)
reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
int mainID = meshDS->ShapeToIndex(_mainEdge);
if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
reversed = !reversed;
int mainID = meshDS->ShapeToIndex(_mainEdge);
if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
reversed = !reversed;
BRepAdaptor_Curve C3d( E );
if ( ! computeInternalParameters( theMesh, C3d, length, f, l, params, false, true )) {
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
BRepAdaptor_Curve C3d( E );
if ( ! computeInternalParameters( theMesh, C3d, length, f, l, params, false, true )) {
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
return false;
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
return false;
redistributeNearVertices( theMesh, C3d, length, params, VFirst, VLast );
if(_quadraticMesh) {
redistributeNearVertices( theMesh, C3d, length, params, VFirst, VLast );
if(_quadraticMesh) {
- SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
- aResMap.insert(std::make_pair(sm,aVec));
+ SMESH_subMesh * sm = theMesh.GetSubMesh( theShape );
+ theResMap.insert( std::make_pair( sm, aVec ));
if (nbHyp == 0 && aShape.ShapeType() == TopAbs_EDGE)
{
// Check, if propagated from some other edge
if (nbHyp == 0 && aShape.ShapeType() == TopAbs_EDGE)
{
// Check, if propagated from some other edge
// Propagation of 1D hypothesis from <aMainEdge> on this edge;
// get non-auxiliary assigned to _mainEdge
nbHyp = aMesh.GetHypotheses( _mainEdge, *compatibleFilter, _usedHypList, true );
// Propagation of 1D hypothesis from <aMainEdge> on this edge;
// get non-auxiliary assigned to _mainEdge
nbHyp = aMesh.GetHypotheses( _mainEdge, *compatibleFilter, _usedHypList, true );