mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
[bos #43370] Swich Composite Side to Wire Discretization. Change to check only compatible hypoteses, added caching for processed ones.
This commit is contained in:
parent
ea86803a14
commit
34f7733106
@ -86,6 +86,8 @@
|
|||||||
namespace fs=boost::filesystem;
|
namespace fs=boost::filesystem;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
// maximum stored group name length in MED file
|
// maximum stored group name length in MED file
|
||||||
#define MAX_MED_GROUP_NAME_LENGTH 80
|
#define MAX_MED_GROUP_NAME_LENGTH 80
|
||||||
|
|
||||||
@ -1023,20 +1025,26 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::CheckHypothesesOnSubMeshes(
|
|||||||
const SMESH_subMesh::algo_event event) const
|
const SMESH_subMesh::algo_event event) const
|
||||||
{
|
{
|
||||||
SMESH_Hypothesis::Hypothesis_Status ret = SMESH_Hypothesis::Hypothesis_Status::HYP_OK;
|
SMESH_Hypothesis::Hypothesis_Status ret = SMESH_Hypothesis::Hypothesis_Status::HYP_OK;
|
||||||
|
std::unordered_set<const SMESH_Hypothesis*> processedHypotheses;
|
||||||
|
|
||||||
|
// Look through sub-meshes of the given sub-mesh
|
||||||
SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false, false);
|
SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false, false);
|
||||||
while (smIt->more())
|
while (smIt->more())
|
||||||
{
|
{
|
||||||
SMESH_subMesh* sm = smIt->next();
|
const SMESH_subMesh* sm = smIt->next();
|
||||||
SMESH_Algo* algo = sm->GetAlgo();
|
const SMESH_Algo* algo = sm->GetAlgo();
|
||||||
if (!algo)
|
if (!algo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const TopoDS_Shape& aSubShape = sm->GetSubShape();
|
const SMESH_HypoFilter* hypoKind = algo->GetCompatibleHypoFilter(false);
|
||||||
const auto& usedHyps = _meshDS->GetHypothesis(aSubShape);
|
if (!hypoKind)
|
||||||
if (usedHyps.empty())
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
std::list <const SMESHDS_Hypothesis*> usedHyps;
|
||||||
|
if (!GetHypotheses(sm, *hypoKind, usedHyps, true))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Look through hypotheses used by algo
|
||||||
for (const auto* usedHyp : usedHyps)
|
for (const auto* usedHyp : usedHyps)
|
||||||
{
|
{
|
||||||
MESSAGE("usedHyp->GetID() = " << usedHyp->GetID() << "; usedHyp->GetName() = " << usedHyp->GetName());
|
MESSAGE("usedHyp->GetID() = " << usedHyp->GetID() << "; usedHyp->GetName() = " << usedHyp->GetName());
|
||||||
@ -1044,7 +1052,11 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::CheckHypothesesOnSubMeshes(
|
|||||||
if (hyp == anHyp)
|
if (hyp == anHyp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (processedHypotheses.find(hyp) != processedHypotheses.end())
|
||||||
|
continue;
|
||||||
|
|
||||||
const SMESH_Hypothesis::Hypothesis_Status ret2 = subMesh->SubMeshesAlgoStateEngine(event, hyp, true);
|
const SMESH_Hypothesis::Hypothesis_Status ret2 = subMesh->SubMeshesAlgoStateEngine(event, hyp, true);
|
||||||
|
processedHypotheses.insert(hyp); // Cache the hypothesis pointer
|
||||||
if (ret2 > ret)
|
if (ret2 > ret)
|
||||||
{
|
{
|
||||||
ret = ret2;
|
ret = ret2;
|
||||||
|
Loading…
Reference in New Issue
Block a user