X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Propagation.cxx;h=e970dc72c5d66c30d1d49d4141297a8596a40365;hp=c56715d7e36820d3a2f80b5753de18ff2e92a06e;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=f1013bf7248e1d093c9a5865acbe74f6f98140b6 diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx index c56715d7e..e970dc72c 100644 --- a/src/StdMeshers/StdMeshers_Propagation.cxx +++ b/src/StdMeshers/StdMeshers_Propagation.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 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 @@ -20,7 +20,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH SMESH : implementaion of SMESH idl descriptions +// SMESH SMESH : implementation of SMESH idl descriptions // File : StdMeshers_Propagation.cxx // Module : SMESH // @@ -85,16 +85,15 @@ namespace { */ //============================================================================= -StdMeshers_Propagation::StdMeshers_Propagation (int hypId, int studyId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, studyId, gen) +StdMeshers_Propagation::StdMeshers_Propagation (int hypId, SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, gen) { _name = GetName(); _param_algo_dim = -1; // 1D auxiliary } StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution (int hypId, - int studyId, SMESH_Gen * gen) - : StdMeshers_Propagation(hypId, studyId, gen) { _name = GetName(); } + : StdMeshers_Propagation(hypId, gen) { _name = GetName(); } StdMeshers_Propagation::~StdMeshers_Propagation() {} string StdMeshers_Propagation::GetName () { return "Propagation"; } string StdMeshers_PropagOfDistribution::GetName () { return "PropagOfDistribution"; } @@ -114,7 +113,17 @@ TopoDS_Edge StdMeshers_Propagation::GetPropagationSource(SMESH_Mesh& the return PropagationMgr::GetSource( theMesh.GetSubMeshContaining( theEdge ), isPropagOfDistribution); } - +const SMESH_HypoFilter& StdMeshers_Propagation::GetFilter() +{ + static SMESH_HypoFilter propagHypFilter; + if ( propagHypFilter.IsEmpty() ) + { + propagHypFilter. + Init( SMESH_HypoFilter::HasName( StdMeshers_Propagation::GetName ())). + Or ( SMESH_HypoFilter::HasName( StdMeshers_PropagOfDistribution::GetName ())); + } + return propagHypFilter; +} //============================================================================= //============================================================================= // PROPAGATION MANAGEMENT @@ -174,7 +183,7 @@ namespace { } //============================================================================= /*! - * \brief return PropagationMgrData found on a submesh + * \brief return PropagationMgrData found on a sub-mesh */ PropagationMgrData* findData(SMESH_subMesh* sm) { @@ -184,14 +193,14 @@ namespace { } //============================================================================= /*! - * \brief return PropagationMgrData found on theEdge submesh + * \brief return PropagationMgrData found on theEdge sub-mesh */ - PropagationMgrData* findData(SMESH_Mesh& theMesh, const TopoDS_Shape& theEdge) - { - if ( theEdge.ShapeType() == TopAbs_EDGE ) - return findData( theMesh.GetSubMeshContaining( theEdge ) ); - return 0; - } + // PropagationMgrData* findData(SMESH_Mesh& theMesh, const TopoDS_Shape& theEdge) + // { + // if ( theEdge.ShapeType() == TopAbs_EDGE ) + // return findData( theMesh.GetSubMeshContaining( theEdge ) ); + // return 0; + // } //============================================================================= /*! * \brief return existing or a new PropagationMgrData @@ -216,6 +225,8 @@ namespace { static SMESH_HypoFilter hypo; hypo.Init( hypo.HasDim( 1 )). AndNot ( hypo.IsAlgo() ). + AndNot ( hypo.HasName( StdMeshers_Propagation::GetName() )). + AndNot ( hypo.HasName( StdMeshers_PropagOfDistribution::GetName() )). AndNot ( hypo.IsAssignedTo( theSubMesh->GetFather()->GetShapeToMesh() )); return theSubMesh->GetFather()->GetHypothesis( theSubMesh, hypo, true, theSssignedTo ); @@ -226,14 +237,8 @@ namespace { */ const SMESH_Hypothesis* getProagationHyp (SMESH_subMesh* theSubMesh) { - static SMESH_HypoFilter propagHypFilter; - if ( propagHypFilter.IsEmpty() ) - { - propagHypFilter. - Init( SMESH_HypoFilter::HasName( StdMeshers_Propagation::GetName ())). - Or ( SMESH_HypoFilter::HasName( StdMeshers_PropagOfDistribution::GetName ())); - } - return theSubMesh->GetFather()->GetHypothesis( theSubMesh, propagHypFilter, true ); + return theSubMesh->GetFather()->GetHypothesis + ( theSubMesh, StdMeshers_Propagation::GetFilter(), true ); } //================================================================================ /*! @@ -298,7 +303,7 @@ namespace { // Get ordered edges and find index of anE in a sequence edges.clear(); BRepTools_WireExplorer aWE (TopoDS::Wire(itA.Value())); - int edgeIndex = 0; + size_t edgeIndex = 0; for (; aWE.More(); aWE.Next()) { TopoDS_Edge edge = aWE.Current(); edge.Orientation( aWE.Orientation() ); @@ -319,8 +324,8 @@ namespace { else { // count nb sides TopoDS_Edge prevEdge = anE; - int nbSide = 0, eIndex = edgeIndex + 1; - for ( int i = 0; i < edges.size(); ++i, ++eIndex ) + size_t nbSide = 0, eIndex = edgeIndex + 1; + for ( size_t i = 0; i < edges.size(); ++i, ++eIndex ) { if ( eIndex == edges.size() ) eIndex = 0; @@ -583,6 +588,7 @@ namespace { clearPropagationChain( subMesh ); } // return; -- hyp is modified any way + // fall through default: //case SMESH_subMesh::MODIF_HYP: // hyp modif // clear mesh in a chain @@ -627,7 +633,11 @@ namespace { } return; } + case MEANINGLESS_LAST: { + break; + } } // switch by SubMeshState - } + + } // ProcessEvent() } // namespace