mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 08:20:34 +05:00
#17328: EDF 20043 - Submeshes
This commit is contained in:
parent
46f1ca0181
commit
9de03403fe
@ -268,11 +268,15 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh,
|
||||
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 );
|
||||
@ -280,32 +284,15 @@ SMESH_Algo::GetUsedHypothesis(SMESH_Mesh & aMesh,
|
||||
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;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -93,7 +93,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
|
||||
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 ); }
|
||||
@ -127,7 +127,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
|
||||
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();
|
||||
|
||||
@ -196,7 +196,7 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
|
||||
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
|
||||
@ -213,22 +213,11 @@ class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
|
||||
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
|
||||
*/
|
||||
@ -442,8 +431,8 @@ protected:
|
||||
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:
|
||||
|
@ -201,7 +201,7 @@ SMESH_Algo* SMESH_subMesh::GetAlgo() const
|
||||
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;
|
||||
}
|
||||
@ -2120,8 +2120,9 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
|
||||
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
|
||||
@ -2148,7 +2149,9 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
|
||||
{
|
||||
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() )
|
||||
|
@ -332,6 +332,7 @@ protected:
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user