1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SMESH_subMesh.cxx
25 // Author : Paul RASCLE, EDF
30 #include "SMESH_subMesh.hxx"
31 #include "SMESH_Gen.hxx"
32 #include "SMESH_Mesh.hxx"
33 #include "SMESH_Hypothesis.hxx"
34 #include "SMESH_Algo.hxx"
35 #include "SMESH_HypoFilter.hxx"
37 #include "utilities.h"
40 #include <BRep_Builder.hxx>
43 #include <TopoDS_Compound.hxx>
44 #include <TopTools_MapOfShape.hxx>
45 #include <TopTools_ListOfShape.hxx>
46 #include <TopTools_ListIteratorOfListOfShape.hxx>
47 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
51 #include <BRep_Tool.hxx>
53 #include <TopTools_IndexedMapOfShape.hxx>
56 #include <Standard_Failure.hxx>
57 #include <Standard_ErrorHandler.hxx>
59 //=============================================================================
61 * default constructor:
63 //=============================================================================
65 SMESH_subMesh::SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS,
66 const TopoDS_Shape & aSubShape)
68 _subShape = aSubShape;
70 _subMeshDS = meshDS->MeshElements(_subShape); // may be null ...
73 _dependenceAnalysed = false;
75 if (_subShape.ShapeType() == TopAbs_VERTEX)
78 _computeState = READY_TO_COMPUTE;
83 _computeState = NOT_READY;
87 //=============================================================================
91 //=============================================================================
93 SMESH_subMesh::~SMESH_subMesh()
95 MESSAGE("SMESH_subMesh::~SMESH_subMesh");
99 //=============================================================================
103 //=============================================================================
105 int SMESH_subMesh::GetId() const
107 //MESSAGE("SMESH_subMesh::GetId");
111 //=============================================================================
115 //=============================================================================
117 SMESHDS_SubMesh * SMESH_subMesh::GetSubMeshDS()
119 // submesh appears in DS only when a mesher set nodes and elements on it
120 if (_subMeshDS==NULL)
122 _subMeshDS = _meshDS->MeshElements(_subShape); // may be null ...
123 // if (_subMeshDS==NULL)
125 // MESSAGE("problem... subMesh still empty");
131 //=============================================================================
135 //=============================================================================
137 SMESHDS_SubMesh* SMESH_subMesh::CreateSubMeshDS()
139 if ( !GetSubMeshDS() )
140 _meshDS->NewSubMesh( _meshDS->ShapeToIndex( _subShape ) );
142 return GetSubMeshDS();
145 //=============================================================================
149 //=============================================================================
151 SMESH_subMesh *SMESH_subMesh::GetFirstToCompute()
153 const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
154 SMESH_subMesh *firstToCompute = 0;
156 map < int, SMESH_subMesh * >::const_iterator itsub;
157 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
159 SMESH_subMesh *sm = (*itsub).second;
160 bool readyToCompute = (sm->GetComputeState() == READY_TO_COMPUTE);
169 return firstToCompute; // a subMesh of this
171 if (_computeState == READY_TO_COMPUTE)
175 return 0; // nothing to compute
178 //=============================================================================
182 //=============================================================================
184 bool SMESH_subMesh::SubMeshesComputed()
186 //MESSAGE("SMESH_subMesh::SubMeshesComputed");
187 const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
189 int myDim = SMESH_Gen::GetShapeDim( _subShape );
190 int dimToCheck = myDim - 1;
191 bool subMeshesComputed = true;
192 map < int, SMESH_subMesh * >::const_iterator itsub;
193 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
195 SMESH_subMesh *sm = (*itsub).second;
196 const TopoDS_Shape & ss = sm->GetSubShape();
197 // MSV 07.04.2006: restrict checking to myDim-1 only. Ex., there is no sense
198 // in checking of existence of edges if the algo needs only faces. Moreover,
199 // degenerated edges may have no submesh, as after computing NETGEN_2D.
200 int dim = SMESH_Gen::GetShapeDim( ss );
201 if (dim < dimToCheck)
203 SMESHDS_SubMesh * ds = sm->GetSubMeshDS();
205 // There are some tricks with compute states, e.g. Penta_3D leaves
206 // one face with READY_TO_COMPUTE state in order to be able to
207 // recompute 3D when a locale triangle hypo changes (see PAL7428).
208 // So we check if mesh is really present
209 bool computeOk = (sm->GetComputeState() == COMPUTE_OK ||
210 (ds && ( ds->GetNodes()->more() || ds->GetElements()->more() )));
213 int type = ss.ShapeType();
215 subMeshesComputed = false;
219 case TopAbs_COMPOUND:
221 MESSAGE("The not computed sub mesh is a COMPOUND");
224 case TopAbs_COMPSOLID:
226 MESSAGE("The not computed sub mesh is a COMPSOLID");
231 MESSAGE("The not computed sub mesh is a SHEL");
236 MESSAGE("The not computed sub mesh is a WIRE");
241 MESSAGE("The not computed sub mesh is a SOLID");
246 MESSAGE("The not computed sub mesh is a FACE");
251 MESSAGE("The not computed sub mesh is a EDGE");
256 MESSAGE("The not computed sub mesh is of unknown type");
264 return subMeshesComputed;
267 //=============================================================================
271 //=============================================================================
273 bool SMESH_subMesh::SubMeshesReady()
275 MESSAGE("SMESH_subMesh::SubMeshesReady");
276 const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
278 bool subMeshesReady = true;
279 map < int, SMESH_subMesh * >::const_iterator itsub;
280 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
282 SMESH_subMesh *sm = (*itsub).second;
283 bool computeOk = ((sm->GetComputeState() == COMPUTE_OK)
284 || (sm->GetComputeState() == READY_TO_COMPUTE));
287 subMeshesReady = false;
292 return subMeshesReady;
295 //=============================================================================
297 * Construct dependence on first level subMeshes. complex shapes (compsolid,
298 * shell, wire) are not analysed the same way as simple shapes (solid, face,
300 * For collection shapes (compsolid, shell, wire) prepare a list of submeshes
301 * with possible multiples occurences. Multiples occurences corresponds to
302 * internal frontiers within shapes of the collection and must not be keeped.
303 * See FinalizeDependence.
305 //=============================================================================
307 const map < int, SMESH_subMesh * >&SMESH_subMesh::DependsOn()
309 if (_dependenceAnalysed)
312 //MESSAGE("SMESH_subMesh::DependsOn");
314 int type = _subShape.ShapeType();
318 case TopAbs_COMPOUND:
320 //MESSAGE("compound");
321 for (TopExp_Explorer exp(_subShape, TopAbs_SOLID); exp.More();
324 InsertDependence(exp.Current());
326 for (TopExp_Explorer exp(_subShape, TopAbs_SHELL, TopAbs_SOLID); exp.More();
329 InsertDependence(exp.Current()); //only shell not in solid
331 for (TopExp_Explorer exp(_subShape, TopAbs_FACE, TopAbs_SHELL); exp.More();
334 InsertDependence(exp.Current());
336 for (TopExp_Explorer exp(_subShape, TopAbs_EDGE, TopAbs_FACE); exp.More();
339 InsertDependence(exp.Current());
343 case TopAbs_COMPSOLID:
345 //MESSAGE("compsolid");
346 for (TopExp_Explorer exp(_subShape, TopAbs_SOLID); exp.More();
349 InsertDependence(exp.Current());
356 for (TopExp_Explorer exp(_subShape, TopAbs_FACE); exp.More();
359 InsertDependence(exp.Current());
366 for (TopExp_Explorer exp(_subShape, TopAbs_EDGE); exp.More();
369 InsertDependence(exp.Current());
376 for (TopExp_Explorer exp(_subShape, TopAbs_FACE); exp.More();
379 InsertDependence(exp.Current());
386 for (TopExp_Explorer exp(_subShape, TopAbs_EDGE); exp.More();
389 InsertDependence(exp.Current());
396 for (TopExp_Explorer exp(_subShape, TopAbs_VERTEX); exp.More();
399 InsertDependence(exp.Current());
412 _dependenceAnalysed = true;
416 //=============================================================================
418 * For simple Shapes (solid, face, edge): add subMesh into dependence list.
420 //=============================================================================
422 void SMESH_subMesh::InsertDependence(const TopoDS_Shape aSubShape)
424 //MESSAGE("SMESH_subMesh::InsertDependence");
425 SMESH_subMesh *aSubMesh = _father->GetSubMesh(aSubShape);
426 int type = aSubShape.ShapeType();
427 int ordType = 9 - type; // 2 = Vertex, 8 = CompSolid
428 int cle = aSubMesh->GetId();
429 cle += 10000000 * ordType; // sort map by ordType then index
430 if ( _mapDepend.find( cle ) == _mapDepend.end())
432 _mapDepend[cle] = aSubMesh;
433 const map < int, SMESH_subMesh * > & subMap = aSubMesh->DependsOn();
434 _mapDepend.insert( subMap.begin(), subMap.end() );
438 //=============================================================================
442 //=============================================================================
444 const TopoDS_Shape & SMESH_subMesh::GetSubShape() const
446 //MESSAGE("SMESH_subMesh::GetSubShape");
451 //=======================================================================
452 //function : CanAddHypothesis
453 //purpose : return true if theHypothesis can be attached to me:
454 // its dimention is checked
455 //=======================================================================
457 bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) const
459 int aHypDim = theHypothesis->GetDim();
460 int aShapeDim = SMESH_Gen::GetShapeDim(_subShape);
461 if ( aHypDim <= aShapeDim )
463 // if ( aHypDim < aShapeDim )
464 // return ( _father->IsMainShape( _subShape ));
469 //=======================================================================
470 //function : IsApplicableHypotesis
472 //=======================================================================
474 bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
475 const TopAbs_ShapeEnum theShapeType)
477 if ( theHypothesis->GetType() > SMESHDS_Hypothesis::PARAM_ALGO)
479 return ( theHypothesis->GetShapeType() & (1<< theShapeType));
482 switch ( theShapeType ) {
486 return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim();
489 // Special case for algorithms, building 2D mesh on a whole shell.
490 // Before this fix there was a problem after restoring from study,
491 // because in that case algorithm is assigned before hypothesis
492 // (on shell in problem case) and hypothesis is checked on faces
493 // (because it is 2D), where we have NO_ALGO state.
494 // Now 2D hypothesis is also applicable to shells.
495 return (theHypothesis->GetDim() == 2 || theHypothesis->GetDim() == 3);
498 // case TopAbs_COMPSOLID:
499 // case TopAbs_COMPOUND:
505 //=============================================================================
509 //=============================================================================
511 SMESH_Hypothesis::Hypothesis_Status
512 SMESH_subMesh::AlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
514 // MESSAGE("SMESH_subMesh::AlgoStateEngine");
515 //SCRUTE(_algoState);
518 // **** les retour des evenement shape sont significatifs
519 // (add ou remove fait ou non)
520 // le retour des evenement father n'indiquent pas que add ou remove fait
522 SMESH_Hypothesis::Hypothesis_Status aux_ret, ret = SMESH_Hypothesis::HYP_OK;
524 int dim = SMESH_Gen::GetShapeDim(_subShape);
529 if (event == ADD_HYP || event == ADD_ALGO)
530 return SMESH_Hypothesis::HYP_BAD_DIM; // do not allow to assign any hyp
532 return SMESH_Hypothesis::HYP_OK;
535 SMESH_Gen* gen =_father->GetGen();
537 int oldAlgoState = _algoState;
538 bool modifiedHyp = false; // if set to true, force event MODIF_ALGO_STATE
539 // in ComputeStateEngine
541 // ----------------------
542 // check mesh conformity
543 // ----------------------
544 if (event == ADD_ALGO)
546 if (IsApplicableHypotesis( anHyp ) &&
547 !_father->IsNotConformAllowed() &&
548 !IsConform( static_cast< SMESH_Algo* >( anHyp )))
549 return SMESH_Hypothesis::HYP_NOTCONFORM;
552 // ----------------------------------
553 // add a hypothesis to DS if possible
554 // ----------------------------------
555 if (event == ADD_HYP || event == ADD_ALGO)
557 if ( ! CanAddHypothesis( anHyp ))
558 return SMESH_Hypothesis::HYP_BAD_DIM;
560 if ( /*!anHyp->IsAuxiliary() &&*/ GetSimilarAttached( _subShape, anHyp ) )
561 return SMESH_Hypothesis::HYP_ALREADY_EXIST;
563 if ( !_meshDS->AddHypothesis(_subShape, anHyp))
564 return SMESH_Hypothesis::HYP_ALREADY_EXIST;
566 // Serve Propagation of 1D hypothesis
567 if (event == ADD_HYP) {
568 bool isPropagationOk = true;
569 bool isPropagationHyp = ( strcmp( "Propagation", anHyp->GetName() ) == 0 );
571 if ( isPropagationHyp ) {
572 TopExp_Explorer exp (_subShape, TopAbs_EDGE);
573 TopTools_MapOfShape aMap;
574 for (; exp.More(); exp.Next()) {
575 if (aMap.Add(exp.Current())) {
576 if (!_father->BuildPropagationChain(exp.Current())) {
577 isPropagationOk = false;
582 else if (anHyp->GetDim() == 1) { // Only 1D hypothesis can be propagated
583 TopExp_Explorer exp (_subShape, TopAbs_EDGE);
584 TopTools_MapOfShape aMap;
585 for (; exp.More(); exp.Next()) {
586 if (aMap.Add(exp.Current())) {
587 TopoDS_Shape aMainEdge;
588 if (_father->IsPropagatedHypothesis(exp.Current(), aMainEdge)) {
589 isPropagationOk = _father->RebuildPropagationChains();
590 } else if (_father->IsPropagationHypothesis(exp.Current())) {
591 isPropagationOk = _father->BuildPropagationChain(exp.Current());
599 if ( isPropagationOk ) {
600 if ( isPropagationHyp )
601 return ret; // nothing more to do for "Propagation" hypothesis
603 else if ( ret < SMESH_Hypothesis::HYP_CONCURENT) {
604 ret = SMESH_Hypothesis::HYP_CONCURENT;
606 } // Serve Propagation of 1D hypothesis
609 // --------------------------
610 // remove a hypothesis from DS
611 // --------------------------
612 if (event == REMOVE_HYP || event == REMOVE_ALGO)
614 if (!_meshDS->RemoveHypothesis(_subShape, anHyp))
615 return SMESH_Hypothesis::HYP_OK; // nothing changes
617 // Serve Propagation of 1D hypothesis
618 if (event == REMOVE_HYP)
620 bool isPropagationOk = true;
621 SMESH_HypoFilter propagFilter( SMESH_HypoFilter::HasName( "Propagation" ));
622 bool isPropagationHyp = propagFilter.IsOk( anHyp, _subShape );
624 if ( isPropagationHyp )
626 TopExp_Explorer exp (_subShape, TopAbs_EDGE);
627 TopTools_MapOfShape aMap;
628 for (; exp.More(); exp.Next()) {
629 if (aMap.Add(exp.Current()) &&
630 !_father->GetHypothesis( exp.Current(), propagFilter, true )) {
631 // no more Propagation on the current edge
632 if (!_father->RemovePropagationChain(exp.Current())) {
633 return SMESH_Hypothesis::HYP_UNKNOWN_FATAL;
637 // rebuild propagation chains, because removing one
638 // chain can resolve concurention, existing before
639 isPropagationOk = _father->RebuildPropagationChains();
641 else if (anHyp->GetDim() == 1) // Only 1D hypothesis can be propagated
643 isPropagationOk = _father->RebuildPropagationChains();
646 if ( isPropagationOk ) {
647 if ( isPropagationHyp )
648 return ret; // nothing more to do for "Propagation" hypothesis
650 else if ( ret < SMESH_Hypothesis::HYP_CONCURENT) {
651 ret = SMESH_Hypothesis::HYP_CONCURENT;
653 } // Serve Propagation of 1D hypothesis
654 else // event == REMOVE_ALGO
656 SMESH_Algo* algo = dynamic_cast<SMESH_Algo*> (anHyp);
657 if (!algo->NeedDescretBoundary())
659 // clean all mesh in the tree of the current submesh;
660 // we must perform it now because later
661 // we will have no information about the type of the removed algo
663 ComputeStateEngine( CLEAN );
669 // ------------------
670 // analyse algo state
671 // ------------------
672 if (!IsApplicableHypotesis( anHyp ))
673 return ret; // not applicable hypotheses do not change algo state
678 // ----------------------------------------------------------------------
685 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
687 if (algo->CheckHypothesis((*_father),_subShape, aux_ret))
688 SetAlgoState(HYP_OK);
690 SetAlgoState(MISSING_HYP);
699 case ADD_FATHER_ALGO: { // Algo just added in father
700 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
702 if ( algo == anHyp ) {
703 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret))
704 SetAlgoState(HYP_OK);
706 SetAlgoState(MISSING_HYP);
710 case REMOVE_FATHER_HYP:
712 case REMOVE_FATHER_ALGO: {
713 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
716 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
717 SetAlgoState(HYP_OK);
719 SetAlgoState(MISSING_HYP);
729 // ----------------------------------------------------------------------
735 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
737 if ( algo->CheckHypothesis((*_father),_subShape, ret ))
738 SetAlgoState(HYP_OK);
739 if (SMESH_Hypothesis::IsStatusFatal( ret ))
740 _meshDS->RemoveHypothesis(_subShape, anHyp);
741 else if (!_father->IsUsedHypothesis( anHyp, this ))
743 _meshDS->RemoveHypothesis(_subShape, anHyp);
744 ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
748 case ADD_ALGO: { //already existing algo : on father ?
749 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
751 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))// ignore hyp status
752 SetAlgoState(HYP_OK);
754 SetAlgoState(MISSING_HYP);
759 case REMOVE_ALGO: { // perhaps a father algo applies ?
760 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
761 if (algo == NULL) // no more algo applying on subShape...
763 SetAlgoState(NO_ALGO);
767 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
768 SetAlgoState(HYP_OK);
770 SetAlgoState(MISSING_HYP);
774 case ADD_FATHER_HYP: {
775 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
777 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
778 SetAlgoState(HYP_OK);
780 SetAlgoState(MISSING_HYP);
783 case ADD_FATHER_ALGO: { // new father algo
784 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
786 if ( algo == anHyp ) {
787 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
788 SetAlgoState(HYP_OK);
790 SetAlgoState(MISSING_HYP);
794 case REMOVE_FATHER_HYP: // nothing to do
796 case REMOVE_FATHER_ALGO: {
797 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
798 if (algo == NULL) // no more applying algo on father
800 SetAlgoState(NO_ALGO);
804 if ( algo->CheckHypothesis((*_father),_subShape , aux_ret ))
805 SetAlgoState(HYP_OK);
807 SetAlgoState(MISSING_HYP);
817 // ----------------------------------------------------------------------
823 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
825 if (!algo->CheckHypothesis((*_father),_subShape, ret ))
827 if ( !SMESH_Hypothesis::IsStatusFatal( ret ))
828 // ret should be fatal: anHyp was not added
829 ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
831 else if (!_father->IsUsedHypothesis( anHyp, this ))
832 ret = SMESH_Hypothesis::HYP_INCOMPATIBLE;
834 if (SMESH_Hypothesis::IsStatusFatal( ret ))
836 MESSAGE("do not add extra hypothesis");
837 _meshDS->RemoveHypothesis(_subShape, anHyp);
845 case ADD_ALGO: { //already existing algo : on father ?
846 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
847 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) {
848 // check if algo changes
850 f.Init( SMESH_HypoFilter::IsAlgo() );
851 f.And( SMESH_HypoFilter::IsApplicableTo( _subShape ));
852 f.AndNot( SMESH_HypoFilter::Is( algo ));
853 const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( _subShape, f, true );
855 string(algo->GetName()) != string(prevAlgo->GetName()) )
859 SetAlgoState(MISSING_HYP);
863 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
865 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
866 SetAlgoState(HYP_OK);
868 SetAlgoState(MISSING_HYP);
872 case REMOVE_ALGO: { // perhaps a father algo applies ?
873 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
874 if (algo == NULL) // no more algo applying on subShape...
876 SetAlgoState(NO_ALGO);
880 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) {
881 // check if algo remains
882 if ( anHyp != algo && strcmp( anHyp->GetName(), algo->GetName()) )
886 SetAlgoState(MISSING_HYP);
890 case ADD_FATHER_HYP: { // new father hypothesis ?
891 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
893 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))
895 if (_father->IsUsedHypothesis( anHyp, this )) // new Hyp
899 SetAlgoState(MISSING_HYP);
902 case ADD_FATHER_ALGO: {
903 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
904 if ( algo == anHyp ) { // a new algo on father
905 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) {
906 // check if algo changes
908 f.Init( SMESH_HypoFilter::IsAlgo() );
909 f.And( SMESH_HypoFilter::IsApplicableTo( _subShape ));
910 f.AndNot( SMESH_HypoFilter::Is( algo ));
911 const SMESH_Hypothesis* prevAlgo = _father->GetHypothesis( _subShape, f, true );
913 string(algo->GetName()) != string(prevAlgo->GetName()) )
917 SetAlgoState(MISSING_HYP);
921 case REMOVE_FATHER_HYP: {
922 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
924 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) {
925 // is there the same local hyp or maybe a new father algo applied?
926 if ( !GetSimilarAttached( _subShape, anHyp ) )
930 SetAlgoState(MISSING_HYP);
933 case REMOVE_FATHER_ALGO: {
934 SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape);
935 if (algo == NULL) // no more applying algo on father
937 SetAlgoState(NO_ALGO);
941 if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) {
942 // check if algo changes
943 if ( string(algo->GetName()) != string( anHyp->GetName()) )
947 SetAlgoState(MISSING_HYP);
957 // ----------------------------------------------------------------------
964 if ((_algoState != oldAlgoState) || modifiedHyp)
965 ComputeStateEngine(MODIF_ALGO_STATE);
971 //=======================================================================
972 //function : IsConform
973 //purpose : check if a conform mesh will be produced by the Algo
974 //=======================================================================
976 bool SMESH_subMesh::IsConform(const SMESH_Algo* theAlgo)
978 // MESSAGE( "SMESH_subMesh::IsConform" );
980 if ( !theAlgo ) return false;
982 // check only algo that doesn't NeedDescretBoundary(): because mesh made
983 // on a sub-shape will be ignored by theAlgo
984 if ( theAlgo->NeedDescretBoundary() )
987 SMESH_Gen* gen =_father->GetGen();
989 // only local algo is to be checked
990 if ( gen->IsGlobalHypothesis( theAlgo, *_father ))
993 // check algo attached to adjacent shapes
995 // loop on one level down sub-meshes
996 TopoDS_Iterator itsub( _subShape );
997 for (; itsub.More(); itsub.Next())
999 // loop on adjacent subShapes
1000 TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( itsub.Value() ));
1001 for (; it.More(); it.Next())
1003 const TopoDS_Shape& adjacent = it.Value();
1004 if ( _subShape.IsSame( adjacent )) continue;
1005 if ( adjacent.ShapeType() != _subShape.ShapeType())
1008 // check algo attached to smAdjacent
1009 SMESH_Algo * algo = gen->GetAlgo((*_father), adjacent);
1011 //algo != theAlgo &&
1012 !algo->NeedDescretBoundary() /*&&
1013 !gen->IsGlobalHypothesis( algo, *_father )*/)
1014 return false; // NOT CONFORM MESH WILL BE PRODUCED
1021 //=============================================================================
1025 //=============================================================================
1027 void SMESH_subMesh::SetAlgoState(int state)
1032 //=============================================================================
1036 //=============================================================================
1037 SMESH_Hypothesis::Hypothesis_Status
1038 SMESH_subMesh::SubMeshesAlgoStateEngine(int event,
1039 SMESH_Hypothesis * anHyp)
1041 //MESSAGE("SMESH_subMesh::SubMeshesAlgoStateEngine");
1042 SMESH_Hypothesis::Hypothesis_Status ret = SMESH_Hypothesis::HYP_OK;
1043 //EAP: a wire (dim==1) should notify edges (dim==1)
1044 //EAP: int dim = SMESH_Gen::GetShapeDim(_subShape);
1045 if (_subShape.ShapeType() < TopAbs_EDGE ) // wire,face etc
1047 const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
1049 map < int, SMESH_subMesh * >::const_iterator itsub;
1050 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
1052 SMESH_subMesh *sm = (*itsub).second;
1053 SMESH_Hypothesis::Hypothesis_Status ret2 =
1054 sm->AlgoStateEngine(event, anHyp);
1062 //=============================================================================
1066 //=============================================================================
1068 void SMESH_subMesh::CleanDependsOn()
1070 //MESSAGE("SMESH_subMesh::CleanDependsOn");
1072 const map < int, SMESH_subMesh * >&dependson = DependsOn();
1073 map < int, SMESH_subMesh * >::const_iterator its;
1074 for (its = dependson.begin(); its != dependson.end(); its++)
1076 SMESH_subMesh *sm = (*its).second;
1077 sm->ComputeStateEngine(CLEAN);
1081 //=============================================================================
1085 //=============================================================================
1087 void SMESH_subMesh::DumpAlgoState(bool isMain)
1089 int dim = SMESH_Gen::GetShapeDim(_subShape);
1090 // if (dim < 1) return;
1093 const map < int, SMESH_subMesh * >&subMeshes = DependsOn();
1095 map < int, SMESH_subMesh * >::const_iterator itsub;
1096 for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
1098 SMESH_subMesh *sm = (*itsub).second;
1099 sm->DumpAlgoState(false);
1102 int type = _subShape.ShapeType();
1103 MESSAGE("dim = " << dim << " type of shape " << type);
1107 MESSAGE(" AlgoState = NO_ALGO");
1110 MESSAGE(" AlgoState = MISSING_HYP");
1113 MESSAGE(" AlgoState = HYP_OK");
1116 switch (_computeState)
1119 MESSAGE(" ComputeState = NOT_READY");
1121 case READY_TO_COMPUTE:
1122 MESSAGE(" ComputeState = READY_TO_COMPUTE");
1125 MESSAGE(" ComputeState = COMPUTE_OK");
1127 case FAILED_TO_COMPUTE:
1128 MESSAGE(" ComputeState = FAILED_TO_COMPUTE");
1133 //================================================================================
1135 * \brief Remove nodes and elements bound to submesh
1136 * \param subMesh - submesh containing nodes and elements
1138 //================================================================================
1140 static void cleanSubMesh( SMESH_subMesh * subMesh )
1143 if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS()) {
1144 SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS();
1145 SMDS_ElemIteratorPtr ite = subMeshDS->GetElements();
1146 while (ite->more()) {
1147 const SMDS_MeshElement * elt = ite->next();
1148 //MESSAGE( " RM elt: "<<elt->GetID()<<" ( "<<elt->NbNodes()<<" )" );
1149 //meshDS->RemoveElement(elt);
1150 meshDS->RemoveFreeElement(elt, subMeshDS);
1153 SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes();
1154 while (itn->more()) {
1155 const SMDS_MeshNode * node = itn->next();
1156 //MESSAGE( " RM node: "<<node->GetID());
1157 //meshDS->RemoveNode(node);
1158 meshDS->RemoveFreeNode(node, subMeshDS);
1164 //=============================================================================
1168 //=============================================================================
1170 bool SMESH_subMesh::ComputeStateEngine(int event)
1172 //MESSAGE("SMESH_subMesh::ComputeStateEngine");
1173 //SCRUTE(_computeState);
1176 int dim = SMESH_Gen::GetShapeDim(_subShape);
1180 if ( IsMeshComputed() )
1181 _computeState = COMPUTE_OK;
1183 _computeState = READY_TO_COMPUTE;
1186 SMESH_Gen *gen = _father->GetGen();
1187 SMESH_Algo *algo = 0;
1189 SMESH_Hypothesis::Hypothesis_Status hyp_status;
1191 switch (_computeState)
1194 // ----------------------------------------------------------------------
1200 case MODIF_ALGO_STATE:
1201 algo = gen->GetAlgo((*_father), _subShape);
1202 if (algo && !algo->NeedDescretBoundary())
1203 CleanDependsOn(); // clean sub-meshes with event CLEAN
1204 if (event == MODIF_ALGO_STATE && _algoState == HYP_OK)
1206 _computeState = READY_TO_COMPUTE;
1209 case COMPUTE: // nothing to do
1213 RemoveSubMeshElementsAndNodes();
1215 case SUBMESH_COMPUTED: // nothing to do
1217 case SUBMESH_RESTORED:
1218 ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
1220 case MESH_ENTITY_REMOVED:
1222 case CHECK_COMPUTE_STATE:
1223 if ( IsMeshComputed() )
1224 _computeState = COMPUTE_OK;
1232 // ----------------------------------------------------------------------
1234 case READY_TO_COMPUTE:
1238 case MODIF_ALGO_STATE:
1239 algo = gen->GetAlgo((*_father), _subShape);
1240 if (algo && !algo->NeedDescretBoundary())
1241 CleanDependsOn(); // clean sub-meshes with event CLEAN
1242 if (event == MODIF_HYP)
1243 break; // nothing else to do when MODIF_HYP
1244 _computeState = NOT_READY;
1247 ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
1249 _computeState = READY_TO_COMPUTE;
1254 algo = gen->GetAlgo((*_father), _subShape);
1256 ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
1259 MESSAGE("***** verify compute state *****");
1260 _computeState = NOT_READY;
1263 // check submeshes needed
1264 if (algo->NeedDescretBoundary())
1265 ret = SubMeshesComputed();
1268 MESSAGE("Some SubMeshes not computed");
1269 _computeState = FAILED_TO_COMPUTE;
1274 RemoveSubMeshElementsAndNodes();
1277 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1280 if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput())
1281 ret = ApplyToCollection( algo, GetCollection( gen, algo ) );
1283 ret = algo->Compute((*_father), _subShape);
1285 catch (Standard_Failure) {
1286 MESSAGE( "Exception in algo->Compute() ");
1292 MESSAGE("problem in algo execution: failed to compute");
1293 _computeState = FAILED_TO_COMPUTE;
1294 if (!algo->NeedDescretBoundary())
1295 UpdateSubMeshState( FAILED_TO_COMPUTE );
1298 // Show vertices location of a failed shape
1299 cout << algo->GetName() << " failed on shape with the following vertices:" << endl;
1300 TopTools_IndexedMapOfShape vMap;
1301 TopExp::MapShapes( _subShape, TopAbs_VERTEX, vMap );
1302 for ( int iv = 1; iv <= vMap.Extent(); ++iv ) {
1303 gp_Pnt P( BRep_Tool::Pnt( TopoDS::Vertex( vMap( iv ) )));
1304 cout << P.X() << " " << P.Y() << " " << P.Z() << " " << endl;
1311 _computeState = COMPUTE_OK;
1312 UpdateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
1313 if (!algo->NeedDescretBoundary())
1314 UpdateSubMeshState( COMPUTE_OK );
1320 RemoveSubMeshElementsAndNodes();
1321 _computeState = NOT_READY;
1322 algo = gen->GetAlgo((*_father), _subShape);
1325 ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
1327 _computeState = READY_TO_COMPUTE;
1330 case SUBMESH_COMPUTED: // nothing to do
1332 case SUBMESH_RESTORED:
1333 // check if a mesh is already computed that may
1334 // happen after retrieval from a file
1335 ComputeStateEngine( CHECK_COMPUTE_STATE );
1336 ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
1338 case MESH_ENTITY_REMOVED:
1340 case CHECK_COMPUTE_STATE:
1341 if ( IsMeshComputed() )
1342 _computeState = COMPUTE_OK;
1350 // ----------------------------------------------------------------------
1356 case MODIF_ALGO_STATE:
1357 ComputeStateEngine( CLEAN );
1358 algo = gen->GetAlgo((*_father), _subShape);
1359 if (algo && !algo->NeedDescretBoundary())
1360 CleanDependsOn(); // clean sub-meshes with event CLEAN
1362 case COMPUTE: // nothing to do
1365 CleanDependants(); // clean sub-meshes, dependant on this one, with event CLEAN
1366 RemoveSubMeshElementsAndNodes();
1367 _computeState = NOT_READY;
1368 algo = gen->GetAlgo((*_father), _subShape);
1371 ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
1373 _computeState = READY_TO_COMPUTE;
1376 case SUBMESH_COMPUTED: // nothing to do
1378 case SUBMESH_RESTORED:
1379 ComputeStateEngine( CHECK_COMPUTE_STATE );
1380 ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
1382 case MESH_ENTITY_REMOVED:
1383 UpdateDependantsState( CHECK_COMPUTE_STATE );
1384 ComputeStateEngine( CHECK_COMPUTE_STATE );
1385 ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
1387 case CHECK_COMPUTE_STATE:
1388 if ( !IsMeshComputed() )
1389 if (_algoState == HYP_OK)
1390 _computeState = READY_TO_COMPUTE;
1392 _computeState = NOT_READY;
1400 // ----------------------------------------------------------------------
1402 case FAILED_TO_COMPUTE:
1406 if (_algoState == HYP_OK)
1407 _computeState = READY_TO_COMPUTE;
1409 _computeState = NOT_READY;
1411 case MODIF_ALGO_STATE:
1412 if (_algoState == HYP_OK)
1413 _computeState = READY_TO_COMPUTE;
1415 _computeState = NOT_READY;
1417 case COMPUTE: // nothing to do
1420 CleanDependants(); // submeshes dependent on me should be cleaned as well
1421 RemoveSubMeshElementsAndNodes();
1422 if (_algoState == HYP_OK)
1423 _computeState = READY_TO_COMPUTE;
1425 _computeState = NOT_READY;
1427 case SUBMESH_COMPUTED: // allow retry compute
1428 if (_algoState == HYP_OK)
1429 _computeState = READY_TO_COMPUTE;
1431 _computeState = NOT_READY;
1433 case SUBMESH_RESTORED:
1434 ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
1436 case MESH_ENTITY_REMOVED:
1438 case CHECK_COMPUTE_STATE:
1439 if ( IsMeshComputed() )
1440 _computeState = COMPUTE_OK;
1442 if (_algoState == HYP_OK)
1443 _computeState = READY_TO_COMPUTE;
1445 _computeState = NOT_READY;
1453 // ----------------------------------------------------------------------
1459 //SCRUTE(_computeState);
1463 //=======================================================================
1464 //function : ApplyToCollection
1465 //purpose : Apply theAlgo to all subshapes in theCollection
1466 //=======================================================================
1468 bool SMESH_subMesh::ApplyToCollection (SMESH_Algo* theAlgo,
1469 const TopoDS_Shape& theCollection)
1471 MESSAGE("SMESH_subMesh::ApplyToCollection");
1472 ASSERT ( !theAlgo->NeedDescretBoundary() );
1477 ret = theAlgo->Compute( *_father, theCollection );
1479 // set _computeState of subshapes
1480 TopExp_Explorer anExplorer( theCollection, _subShape.ShapeType() );
1481 for ( ; anExplorer.More(); anExplorer.Next() )
1483 const TopoDS_Shape& aSubShape = anExplorer.Current();
1484 SMESH_subMesh* subMesh = _father->GetSubMeshContaining( aSubShape );
1489 subMesh->_computeState = COMPUTE_OK;
1490 subMesh->UpdateDependantsState( SUBMESH_COMPUTED );
1491 subMesh->UpdateSubMeshState( COMPUTE_OK );
1495 subMesh->_computeState = FAILED_TO_COMPUTE;
1503 //=======================================================================
1504 //function : UpdateSubMeshState
1506 //=======================================================================
1508 void SMESH_subMesh::UpdateSubMeshState(const compute_state theState)
1510 const map<int, SMESH_subMesh*>& smMap = DependsOn();
1511 map<int, SMESH_subMesh*>::const_iterator itsub;
1512 for (itsub = smMap.begin(); itsub != smMap.end(); itsub++)
1514 SMESH_subMesh* sm = (*itsub).second;
1515 sm->_computeState = theState;
1519 //=======================================================================
1520 //function : ComputeSubMeshStateEngine
1522 //=======================================================================
1524 void SMESH_subMesh::ComputeSubMeshStateEngine(int event)
1526 const map<int, SMESH_subMesh*>& smMap = DependsOn();
1527 map<int, SMESH_subMesh*>::const_iterator itsub;
1528 for (itsub = smMap.begin(); itsub != smMap.end(); itsub++)
1530 SMESH_subMesh* sm = (*itsub).second;
1531 sm->ComputeStateEngine(event);
1535 //=======================================================================
1536 //function : UpdateDependantsState
1538 //=======================================================================
1540 void SMESH_subMesh::UpdateDependantsState(const compute_event theEvent)
1542 //MESSAGE("SMESH_subMesh::UpdateDependantsState");
1543 TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape ));
1544 for (; it.More(); it.Next())
1546 const TopoDS_Shape& ancestor = it.Value();
1547 SMESH_subMesh *aSubMesh =
1548 _father->GetSubMeshContaining(ancestor);
1550 aSubMesh->ComputeStateEngine( theEvent );
1554 //=============================================================================
1558 //=============================================================================
1560 void SMESH_subMesh::CleanDependants()
1562 int dimToClean = SMESH_Gen::GetShapeDim( _subShape ) + 1;
1564 TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape ));
1565 for (; it.More(); it.Next())
1567 const TopoDS_Shape& ancestor = it.Value();
1568 if ( SMESH_Gen::GetShapeDim( ancestor ) == dimToClean ) {
1569 // PAL8021. do not go upper than SOLID, else ComputeStateEngine(CLEAN)
1570 // will erase mesh on other shapes in a compound
1571 if ( ancestor.ShapeType() >= TopAbs_SOLID ) {
1572 SMESH_subMesh *aSubMesh = _father->GetSubMeshContaining(ancestor);
1574 aSubMesh->ComputeStateEngine(CLEAN);
1580 //=============================================================================
1584 //=============================================================================
1586 void SMESH_subMesh::RemoveSubMeshElementsAndNodes()
1588 //SCRUTE(_subShape.ShapeType());
1590 cleanSubMesh( this );
1592 // algo may bind a submesh not to _subShape, eg 3D algo
1593 // sets nodes on SHELL while _subShape may be SOLID
1595 int dim = SMESH_Gen::GetShapeDim( _subShape );
1596 int type = _subShape.ShapeType() + 1;
1597 for ( ; type <= TopAbs_EDGE; type++) {
1598 if ( dim == SMESH_Gen::GetShapeDim( (TopAbs_ShapeEnum) type ))
1600 TopExp_Explorer exp( _subShape, (TopAbs_ShapeEnum) type );
1601 for ( ; exp.More(); exp.Next() )
1602 cleanSubMesh( _father->GetSubMeshContaining( exp.Current() ));
1609 //=======================================================================
1610 //function : IsMeshComputed
1611 //purpose : check if _subMeshDS contains mesh elements
1612 //=======================================================================
1614 bool SMESH_subMesh::IsMeshComputed() const
1616 // algo may bind a submesh not to _subShape, eg 3D algo
1617 // sets nodes on SHELL while _subShape may be SOLID
1619 int dim = SMESH_Gen::GetShapeDim( _subShape );
1620 int type = _subShape.ShapeType();
1621 for ( ; type <= TopAbs_VERTEX; type++) {
1622 if ( dim == SMESH_Gen::GetShapeDim( (TopAbs_ShapeEnum) type ))
1624 TopExp_Explorer exp( _subShape, (TopAbs_ShapeEnum) type );
1625 for ( ; exp.More(); exp.Next() )
1627 SMESHDS_SubMesh * subMeshDS = _meshDS->MeshElements( exp.Current() );
1628 if ( subMeshDS != NULL &&
1629 (subMeshDS->GetElements()->more() || subMeshDS->GetNodes()->more())) {
1642 //=======================================================================
1643 //function : GetCollection
1644 //purpose : return a shape containing all sub-shapes of the MainShape that can be
1645 // meshed at once along with _subShape
1646 //=======================================================================
1648 TopoDS_Shape SMESH_subMesh::GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo)
1650 MESSAGE("SMESH_subMesh::GetCollection");
1651 ASSERT (!theAlgo->NeedDescretBoundary());
1653 TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh();
1655 if ( mainShape.IsSame( _subShape ))
1658 const bool ignoreAuxiliaryHyps = false;
1659 list<const SMESHDS_Hypothesis*> aUsedHyp =
1660 theAlgo->GetUsedHypothesis( *_father, _subShape, ignoreAuxiliaryHyps ); // copy
1662 // put in a compound all shapes with the same hypothesis assigned
1663 // and a good ComputState
1665 TopoDS_Compound aCompound;
1666 BRep_Builder aBuilder;
1667 aBuilder.MakeCompound( aCompound );
1669 TopExp_Explorer anExplorer( mainShape, _subShape.ShapeType() );
1670 for ( ; anExplorer.More(); anExplorer.Next() )
1672 const TopoDS_Shape& S = anExplorer.Current();
1673 SMESH_subMesh* subMesh = _father->GetSubMesh( S );
1674 SMESH_Algo* anAlgo = theGen->GetAlgo( *_father, S );
1676 if (subMesh->GetComputeState() == READY_TO_COMPUTE &&
1677 anAlgo == theAlgo &&
1678 anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp)
1680 aBuilder.Add( aCompound, S );
1687 //=======================================================================
1688 //function : GetSimilarAttached
1689 //purpose : return a hypothesis attached to theShape.
1690 // If theHyp is provided, similar but not same hypotheses
1691 // is returned; else only applicable ones having theHypType
1693 //=======================================================================
1695 const SMESH_Hypothesis* SMESH_subMesh::GetSimilarAttached(const TopoDS_Shape& theShape,
1696 const SMESH_Hypothesis * theHyp,
1697 const int theHypType)
1699 SMESH_HypoFilter hypoKind;
1700 hypoKind.Init( hypoKind.HasType( theHyp ? theHyp->GetType() : theHypType ));
1702 hypoKind.And ( hypoKind.HasDim( theHyp->GetDim() ));
1703 hypoKind.AndNot( hypoKind.Is( theHyp ));
1704 if ( theHyp->IsAuxiliary() )
1705 hypoKind.And( hypoKind.HasName( theHyp->GetName() ));
1707 hypoKind.AndNot( hypoKind.IsAuxiliary());
1710 hypoKind.And( hypoKind.IsApplicableTo( theShape ));
1713 return _father->GetHypothesis( theShape, hypoKind, false );
1716 //=======================================================================
1717 //function : CheckConcurentHypothesis
1718 //purpose : check if there are several applicable hypothesis attached to
1720 //=======================================================================
1722 SMESH_Hypothesis::Hypothesis_Status
1723 SMESH_subMesh::CheckConcurentHypothesis (const int theHypType)
1725 MESSAGE ("SMESH_subMesh::CheckConcurentHypothesis");
1727 // is there local hypothesis on me?
1728 if ( GetSimilarAttached( _subShape, 0, theHypType ) )
1729 return SMESH_Hypothesis::HYP_OK;
1732 TopoDS_Shape aPrevWithHyp;
1733 const SMESH_Hypothesis* aPrevHyp = 0;
1734 TopTools_ListIteratorOfListOfShape it( _father->GetAncestors( _subShape ));
1735 for (; it.More(); it.Next())
1737 const TopoDS_Shape& ancestor = it.Value();
1738 const SMESH_Hypothesis* hyp = GetSimilarAttached( ancestor, 0, theHypType );
1741 if ( aPrevWithHyp.IsNull() || aPrevWithHyp.IsSame( ancestor ))
1743 aPrevWithHyp = ancestor;
1746 else if ( aPrevWithHyp.ShapeType() == ancestor.ShapeType() && aPrevHyp != hyp )
1747 return SMESH_Hypothesis::HYP_CONCURENT;
1749 return SMESH_Hypothesis::HYP_OK;
1752 return SMESH_Hypothesis::HYP_OK;