savedHyps.swap( me->_usedHypList ); // it does not change (#16578)
me->_usedHypList.clear();
+ me->_assigedShapeList.clear();
if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary ))
{
- aMesh.GetHypotheses( aShape, *filter, me->_usedHypList, true );
+ aMesh.GetHypotheses( aShape, *filter, me->_usedHypList, true, & me->_assigedShapeList );
if ( ignoreAuxiliary && _usedHypList.size() > 1 )
+ {
me->_usedHypList.clear(); //only one compatible hypothesis allowed
+ me->_assigedShapeList.clear();
+ }
}
if ( _usedHypList == savedHyps )
savedHyps.swap( me->_usedHypList );
return _usedHypList;
}
-//=============================================================================
+//================================================================================
/*!
- * List the relevant hypothesis associated to the shape. Relevant hypothesis
- * have a name (type) listed in the algorithm. Hypothesis associated to
- * father shape -are not- taken into account (see GetUsedHypothesis)
+ * Return sub-shape to which hypotheses returned by GetUsedHypothesis() are assigned
*/
-//=============================================================================
+//================================================================================
-const list<const SMESHDS_Hypothesis *> &
-SMESH_Algo::GetAppliedHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- const bool ignoreAuxiliary) const
+const std::list < TopoDS_Shape > & SMESH_Algo::GetAssignedShapes() const
{
- SMESH_Algo* me = const_cast< SMESH_Algo* >( this );
-
- std::list<const SMESHDS_Hypothesis *> savedHyps; // don't delete the list if
- savedHyps.swap( me->_appliedHypList ); // it does not change (#16578)
-
- me->_appliedHypList.clear();
- if ( const SMESH_HypoFilter* filter = GetCompatibleHypoFilter( ignoreAuxiliary ))
- aMesh.GetHypotheses( aShape, *filter, me->_appliedHypList, false );
-
- if ( _appliedHypList == savedHyps )
- savedHyps.swap( me->_appliedHypList );
-
- return _appliedHypList;
+ return _assigedShapeList;
}
//=============================================================================
bool IsCompatible( const Features& algo2 ) const;
};
/*!
- * \brief Returns a structure describing algorithm features
+ * \brief Return a structure describing algorithm features
*/
static const Features& GetFeatures( const std::string& algoType );
const Features& GetFeatures() const { return GetFeatures( _name ); }
virtual std::istream & LoadFrom(std::istream & load);
/*!
- * \brief Returns all types of compatible hypotheses
+ * \brief Return all types of compatible hypotheses
*/
const std::vector < std::string > & GetCompatibleHypothesis();
MapShapeNbElems& aResMap) = 0;
/*!
- * \brief Returns a list of compatible hypotheses used to mesh a shape
+ * \brief Return a list of compatible hypotheses used to mesh a shape
* \param aMesh - the mesh
* \param aShape - the shape
* \param ignoreAuxiliary - do not include auxiliary hypotheses in the list
const TopoDS_Shape & aShape,
const bool ignoreAuxiliary=true) const;
/*!
- * \brief Returns a list of compatible hypotheses assigned to a shape in a mesh
- * \param aMesh - the mesh
- * \param aShape - the shape
- * \param ignoreAuxiliary - do not include auxiliary hypotheses in the list
- * \retval const std::list <const SMESHDS_Hypothesis*> - hypotheses list
- *
- * List the relevant hypothesis associated to the shape. Relevant hypothesis
- * have a name (type) listed in the algorithm. Hypothesis associated to
- * father shape -are not- taken into account (see GetUsedHypothesis)
+ * \brief Return sub-shape to which hypotheses returned by GetUsedHypothesis() are assigned
*/
- const std::list <const SMESHDS_Hypothesis *> &
- GetAppliedHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- const bool ignoreAuxiliary=true) const;
+ virtual const std::list < TopoDS_Shape > & GetAssignedShapes() const;
/*!
- * \brief Returns the filter recognizing only compatible hypotheses
+ * \brief Return the filter recognizing only compatible hypotheses
* \param ignoreAuxiliary - make filter ignore compatible auxiliary hypotheses
* \retval SMESH_HypoFilter* - the filter that can be NULL
*/
const SMESH_HypoFilter * _compatibleAllHypFilter;
const SMESH_HypoFilter * _compatibleNoAuxHypFilter;
std::vector<std::string> _compatibleHypothesis;
- std::list<const SMESHDS_Hypothesis *> _appliedHypList;
std::list<const SMESHDS_Hypothesis *> _usedHypList;
+ std::list<TopoDS_Shape> _assigedShapeList; // _usedHypList assigned to
// Algo features influencing which Compute() and how is called:
if ( !_algo )
{
SMESH_subMesh* me = const_cast< SMESH_subMesh* >( this );
- me->_algo = _father->GetGen()->GetAlgo( me );
+ me->_algo = _father->GetGen()->GetAlgo( me, & me->_algoShape );
}
return _algo;
}
return _subShape;
const bool skipAuxHyps = false;
- list<const SMESHDS_Hypothesis*> aUsedHyp =
+ list<const SMESHDS_Hypothesis*> usedHyps =
theAlgo->GetUsedHypothesis( *_father, _subShape, skipAuxHyps ); // copy
+ std::list < TopoDS_Shape > assiShapes = theAlgo->GetAssignedShapes();
// put in a compound all shapes with the same hypothesis assigned
// and a good ComputeState
{
SMESH_Algo* anAlgo = subMesh->GetAlgo();
if (( anAlgo->IsSameName( *theAlgo )) && // same algo
- ( anAlgo->GetUsedHypothesis( *_father, S, skipAuxHyps ) == aUsedHyp )) // same hyps
+ ( anAlgo->GetUsedHypothesis( *_father, S, skipAuxHyps ) == usedHyps ) && // same hyps
+ ( anAlgo->GetAssignedShapes() == assiShapes ) && // on same sub-shapes
+ ( _algoShape == subMesh->_algoShape ))
{
aBuilder.Add( aCompound, S );
if ( !subMesh->SubMeshesComputed() )
std::vector< SMESH_subMesh * > _ancestors;
SMESH_Algo * _algo; // the algorithm found by last *StateEngine() call
+ TopoDS_Shape _algoShape; // shape the algorithm is assigned to
algo_state _algoState;
compute_state _computeState;
SMESH_ComputeErrorPtr _computeError;