X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Algo.cxx;fp=src%2FSMESH%2FSMESH_Algo.cxx;h=cef1ea89c70ad30bd520ac6fefa25a5cc81cf69a;hp=234b7ecce8e0a661b71e2f94d35c738fea1574ad;hb=9313a9353cce92fd1c7926b3a2358916822a827e;hpb=5980f7c6cc925471e77507c48b92b84742432348 diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 234b7ecce..cef1ea89c 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; using namespace std; #include "SMESH_Algo.hxx" #include "SMESH_Gen.hxx" @@ -39,6 +38,8 @@ using namespace std; #include "utilities.h" #include +#include +#include //============================================================================= /*! @@ -52,6 +53,8 @@ SMESH_Algo::SMESH_Algo(int hypId, int studyId, // _compatibleHypothesis.push_back("hypothese_bidon"); _type = ALGO; gen->_mapAlgo[hypId] = this; + + _onlyUnaryInput = _requireDescretBoundary = true; } //============================================================================= @@ -75,77 +78,6 @@ const vector < string > &SMESH_Algo::GetCompatibleHypothesis() return _compatibleHypothesis; } -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & SMESH_Algo::SaveTo(ostream & save) -{ - return save << this; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & SMESH_Algo::LoadFrom(istream & load) -{ - return load >> (*this); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator <<(ostream & save, SMESH_Algo & hyp) -{ - return save; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >>(istream & load, SMESH_Algo & hyp) -{ - return load; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -bool SMESH_Algo::CheckHypothesis(SMESH_Mesh & aMesh, - const TopoDS_Shape & aShape) -{ - MESSAGE("SMESH_Algo::CheckHypothesis"); - ASSERT(0); // use method from derived classes - return false; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -bool SMESH_Algo::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) -{ - MESSAGE("SMESH_Algo::Compute"); - ASSERT(0); // use method from derived classes - return false; -} - //============================================================================= /*! * List the hypothesis used by the algorithm associated to the shape. @@ -164,12 +96,21 @@ const list & SMESH_Algo::GetUsedHypothesis( int nbHyp = _usedHypList.size(); if (nbHyp == 0) { - TopoDS_Shape mainShape = aMesh.GetMeshDS()->ShapeToMesh(); - if (!mainShape.IsSame(aShape)) - { - _usedHypList = GetAppliedHypothesis(aMesh, mainShape); // copy - nbHyp = _usedHypList.size(); - } + TopTools_ListIteratorOfListOfShape ancIt( aMesh.GetAncestors( aShape )); + for (; ancIt.More(); ancIt.Next()) + { + const TopoDS_Shape& ancestor = ancIt.Value(); + _usedHypList = GetAppliedHypothesis(aMesh, ancestor); // copy + nbHyp = _usedHypList.size(); + if (nbHyp == 1) + break; + } +// TopoDS_Shape mainShape = aMesh.GetMeshDS()->ShapeToMesh(); +// if (!mainShape.IsSame(aShape)) +// { +// _usedHypList = GetAppliedHypothesis(aMesh, mainShape); // copy +// nbHyp = _usedHypList.size(); +// } } if (nbHyp > 1) _usedHypList.clear(); //only one compatible hypothesis allowed