Salome HOME
Merge remote-tracking branch 'origin/V9_5_BR'
authoreap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
committereap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
Conflicts:
src/SMESH_I/SMESH_Mesh_i.cxx

1  2 
CMakeLists.txt
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESH_I/SMESH_Mesh_i.cxx

diff --cc CMakeLists.txt
Simple merge
Simple merge
Simple merge
index cf2a16ea647d3354553b1c95a1b5c4f3d3056bb3,470ca6587eb262b98525d7ae8979df388ae08c25..9c00cb31ee2073aa8d0f54e6090ba84c4c3d4ed8
@@@ -6752,84 -6750,82 +6752,86 @@@ TListOfListOfInt SMESH_Mesh_i::findConc
  {
    TListOfListOfInt anOrder;
    ::SMESH_Mesh& mesh = GetImpl();
 -  {
 -    // collect submeshes and detect concurrent algorithms and hypothesises
 -    TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
 -
 -    map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
 -    for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
 -      ::SMESH_subMesh* sm = (*i_sm).second;
 -      // shape of submesh
 -      const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
 -
 -      // list of assigned hypothesises
 -      const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
 -      // Find out dimensions where the submesh can be concurrent.
 -      // We define the dimensions by algo of each of hypotheses in hypList
 -      list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
 -      for( ; hypIt != hypList.end(); hypIt++ ) {
 -        SMESH_Algo* anAlgo = 0;
 -        const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
 -        if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
 -          // hyp it-self is algo
 -          anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
 -        else {
 -          // try to find algorithm with help of sub-shapes
 -          TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
 -          for ( ; !anAlgo && anExp.More(); anExp.Next() )
 -            anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
 -        }
 -        if (!anAlgo)
 -          continue; // no algorithm assigned to a current submesh
  
 -        int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
 -        // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
 -        // and !anAlgo->NeedLowerHyps( dim ))
 +  // collect submeshes and detect concurrent algorithms and hypothesises
 +  TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
  
 -        // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
 -        for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
 -          addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
 +  map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
-   for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
++  for ( ; i_sm != _mapSubMesh.end(); i_sm++ )
++  {
 +    ::SMESH_subMesh* sm = (*i_sm).second;
 +    // shape of submesh
 +    const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
 +
 +    // list of assigned hypothesises
 +    const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
 +    // Find out dimensions where the submesh can be concurrent.
 +    // We define the dimensions by algo of each of hypotheses in hypList
 +    list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
-     for( ; hypIt != hypList.end(); hypIt++ ) {
++    for( ; hypIt != hypList.end(); hypIt++ )
++    {
 +      SMESH_Algo* anAlgo = 0;
 +      const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
 +      if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
 +        // hyp it-self is algo
 +        anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
 +      else {
 +        // try to find algorithm with help of sub-shapes
 +        TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
 +        for ( ; !anAlgo && anExp.More(); anExp.Next() )
 +          anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
        }
 -    } // end iterations on submesh
 +      if (!anAlgo)
 +        continue; // no algorithm assigned to a current submesh
 +
 +      int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
 +      // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDiscreteBoundary()
 +      // and !anAlgo->NeedLowerHyps( dim ))
 +
 +      // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
 +      for ( int j = anAlgo->NeedDiscreteBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
 +        addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
 +    }
 +  } // end iterations on submesh
  
      // iterate on created dimension-hypotheses and check for concurrents
 -    for ( int i = 0; i < 4; i++ ) {
 -      const TDimHypList& listOfDimHyp = dimHypListArr[i];
 -      // check for concurrents in own and other dimensions (step-by-step)
 -      TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
 -      for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) {
 -        const SMESH_DimHyp* dimHyp = *dhIt;
 -        TDimHypList listOfConcurr;
 -        set<int>    setOfConcurrIds;
 -        // looking for concurrents and collect into own list
 -        for ( int j = i; j < 4; j++ )
 -          findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
 -        // check if any concurrents found
 -        if ( listOfConcurr.size() > 0 ) {
 -          // add own submesh to list of concurrent
 -          addInOrderOfPriority( dimHyp, listOfConcurr );
 -          list<int> listOfConcurrIds;
 -          TDimHypList::iterator hypIt = listOfConcurr.begin();
 -          for ( ; hypIt != listOfConcurr.end(); ++hypIt )
 -            listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
 -          anOrder.push_back( listOfConcurrIds );
 -        }
 +  for ( int i = 0; i < 4; i++ )
 +  {
 +    const TDimHypList& listOfDimHyp = dimHypListArr[i];
 +    // check for concurrents in own and other dimensions (step-by-step)
 +    TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
 +    for ( ; dhIt != listOfDimHyp.end(); dhIt++ )
 +    {
 +      const SMESH_DimHyp* dimHyp = *dhIt;
 +      TDimHypList listOfConcurr;
 +      set<int>    setOfConcurrIds;
 +      // looking for concurrents and collect into own list
 +      for ( int j = i; j < 4; j++ )
 +        findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr, setOfConcurrIds );
 +      // check if any concurrents found
 +      if ( listOfConcurr.size() > 0 )
 +      {
 +        // add own submesh to list of concurrent
 +        addInOrderOfPriority( dimHyp, listOfConcurr );
 +        list<int> listOfConcurrIds;
 +        TDimHypList::iterator hypIt = listOfConcurr.begin();
 +        for ( ; hypIt != listOfConcurr.end(); ++hypIt )
 +          listOfConcurrIds.push_back( (*hypIt)->_subMesh->GetId() );
 +        anOrder.push_back( listOfConcurrIds );
        }
      }
 +  }
  
 -    removeDimHyps(dimHypListArr);
 +  removeDimHyps(dimHypListArr);
  
 -    // now, minimize the number of concurrent groups
 -    // Here we assume that lists of submeshes can have same submesh
 -    // in case of multi-dimension algorithms, as result
 -    //  list with common submesh has to be united into one list
 -    int listIndx = 0;
 -    TListOfListOfInt::iterator listIt = anOrder.begin();
 -    for(; listIt != anOrder.end(); listIt++, listIndx++ )
 -      unionLists( *listIt,  anOrder, listIndx + 1 );
 -  }
 +  // now, minimize the number of concurrent groups
 +  // Here we assume that lists of submeshes can have same submesh
 +  // in case of multi-dimension algorithms, as result
 +  //  list with common submesh has to be united into one list
 +  int listIndx = 0;
 +  TListOfListOfInt::iterator listIt = anOrder.begin();
 +  for(; listIt != anOrder.end(); listIt++, listIndx++ )
 +    unionLists( *listIt,  anOrder, listIndx + 1 );
  
    return anOrder;
  }