mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-05 11:14:17 +05:00
23282: EDF 13035 - Problem with submeshes priority
fix SMESH_Mesh::SortByMeshOrder()
This commit is contained in:
parent
b50774870a
commit
08a7d4d04e
@ -474,47 +474,38 @@ void SMESH_Mesh::ClearSubMesh(const int theShapeId)
|
|||||||
|
|
||||||
int SMESH_Mesh::UNVToMesh(const char* theFileName)
|
int SMESH_Mesh::UNVToMesh(const char* theFileName)
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("UNVToMesh - theFileName = "<<theFileName);
|
if ( _isShapeToMesh )
|
||||||
if(_isShapeToMesh)
|
|
||||||
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
||||||
_isShapeToMesh = false;
|
_isShapeToMesh = false;
|
||||||
|
|
||||||
DriverUNV_R_SMDS_Mesh myReader;
|
DriverUNV_R_SMDS_Mesh myReader;
|
||||||
myReader.SetMesh(_myMeshDS);
|
myReader.SetMesh(_myMeshDS);
|
||||||
myReader.SetFile(theFileName);
|
myReader.SetFile(theFileName);
|
||||||
myReader.SetMeshId(-1);
|
myReader.SetMeshId(-1);
|
||||||
myReader.Perform();
|
myReader.Perform();
|
||||||
if(MYDEBUG){
|
|
||||||
MESSAGE("UNVToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes());
|
if ( SMDS_MeshGroup* aGroup = (SMDS_MeshGroup*) myReader.GetGroup() )
|
||||||
MESSAGE("UNVToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges());
|
{
|
||||||
MESSAGE("UNVToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces());
|
|
||||||
MESSAGE("UNVToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes());
|
|
||||||
}
|
|
||||||
SMDS_MeshGroup* aGroup = (SMDS_MeshGroup*) myReader.GetGroup();
|
|
||||||
if (aGroup != 0) {
|
|
||||||
TGroupNamesMap aGroupNames = myReader.GetGroupNamesMap();
|
TGroupNamesMap aGroupNames = myReader.GetGroupNamesMap();
|
||||||
//const TGroupIdMap& aGroupId = myReader.GetGroupIdMap();
|
|
||||||
aGroup->InitSubGroupsIterator();
|
aGroup->InitSubGroupsIterator();
|
||||||
while (aGroup->MoreSubGroups()) {
|
while (aGroup->MoreSubGroups())
|
||||||
|
{
|
||||||
SMDS_MeshGroup* aSubGroup = (SMDS_MeshGroup*) aGroup->NextSubGroup();
|
SMDS_MeshGroup* aSubGroup = (SMDS_MeshGroup*) aGroup->NextSubGroup();
|
||||||
string aName = aGroupNames[aSubGroup];
|
string aName = aGroupNames[aSubGroup];
|
||||||
int aId;
|
int aId;
|
||||||
|
if ( SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId ))
|
||||||
SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId );
|
{
|
||||||
if ( aSMESHGroup ) {
|
|
||||||
if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<<aName);
|
|
||||||
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aSMESHGroup->GetGroupDS() );
|
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aSMESHGroup->GetGroupDS() );
|
||||||
if ( aGroupDS ) {
|
if ( aGroupDS ) {
|
||||||
aGroupDS->SetStoreName(aName.c_str());
|
aGroupDS->SetStoreName(aName.c_str());
|
||||||
aSubGroup->InitIterator();
|
aSubGroup->InitIterator();
|
||||||
const SMDS_MeshElement* aElement = 0;
|
const SMDS_MeshElement* aElement = 0;
|
||||||
while (aSubGroup->More()) {
|
while ( aSubGroup->More() )
|
||||||
aElement = aSubGroup->Next();
|
if (( aElement = aSubGroup->Next() ))
|
||||||
if (aElement) {
|
aGroupDS->SMDSGroup().Add( aElement );
|
||||||
aGroupDS->SMDSGroup().Add(aElement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (aElement)
|
if (aElement)
|
||||||
aGroupDS->SetType(aElement->GetType());
|
aGroupDS->SetType( aElement->GetType() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -524,27 +515,21 @@ int SMESH_Mesh::UNVToMesh(const char* theFileName)
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MEDToMesh
|
//function : MEDToMesh
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
|
int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("MEDToMesh - theFileName = "<<theFileName<<", mesh name = "<<theMeshName);
|
if ( _isShapeToMesh )
|
||||||
if(_isShapeToMesh)
|
|
||||||
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
||||||
_isShapeToMesh = false;
|
_isShapeToMesh = false;
|
||||||
|
|
||||||
DriverMED_R_SMESHDS_Mesh myReader;
|
DriverMED_R_SMESHDS_Mesh myReader;
|
||||||
myReader.SetMesh(_myMeshDS);
|
myReader.SetMesh(_myMeshDS);
|
||||||
myReader.SetMeshId(-1);
|
myReader.SetMeshId(-1);
|
||||||
myReader.SetFile(theFileName);
|
myReader.SetFile(theFileName);
|
||||||
myReader.SetMeshName(theMeshName);
|
myReader.SetMeshName(theMeshName);
|
||||||
Driver_Mesh::Status status = myReader.Perform();
|
Driver_Mesh::Status status = myReader.Perform();
|
||||||
if(MYDEBUG){
|
|
||||||
MESSAGE("MEDToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes());
|
|
||||||
MESSAGE("MEDToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges());
|
|
||||||
MESSAGE("MEDToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces());
|
|
||||||
MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes());
|
|
||||||
}
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
SMESH_ComputeErrorPtr er = myReader.GetError();
|
SMESH_ComputeErrorPtr er = myReader.GetError();
|
||||||
if ( er && !er->IsOK() ) cout << er->myComment << endl;
|
if ( er && !er->IsOK() ) cout << er->myComment << endl;
|
||||||
@ -552,13 +537,12 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
|
|||||||
|
|
||||||
// Reading groups (sub-meshes are out of scope of MED import functionality)
|
// Reading groups (sub-meshes are out of scope of MED import functionality)
|
||||||
list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
|
list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
|
||||||
if(MYDEBUG) MESSAGE("MEDToMesh - Nb groups = "<<aGroupNames.size());
|
|
||||||
int anId;
|
int anId;
|
||||||
list<TNameAndType>::iterator name_type = aGroupNames.begin();
|
list<TNameAndType>::iterator name_type = aGroupNames.begin();
|
||||||
for ( ; name_type != aGroupNames.end(); name_type++ ) {
|
for ( ; name_type != aGroupNames.end(); name_type++ )
|
||||||
|
{
|
||||||
SMESH_Group* aGroup = AddGroup( name_type->second, name_type->first.c_str(), anId );
|
SMESH_Group* aGroup = AddGroup( name_type->second, name_type->first.c_str(), anId );
|
||||||
if ( aGroup ) {
|
if ( aGroup ) {
|
||||||
if(MYDEBUG) MESSAGE("MEDToMesh - group added: "<<name_type->first.c_str());
|
|
||||||
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
|
SMESHDS_Group* aGroupDS = dynamic_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
|
||||||
if ( aGroupDS ) {
|
if ( aGroupDS ) {
|
||||||
aGroupDS->SetStoreName( name_type->first.c_str() );
|
aGroupDS->SetStoreName( name_type->first.c_str() );
|
||||||
@ -576,21 +560,16 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName)
|
|||||||
|
|
||||||
int SMESH_Mesh::STLToMesh(const char* theFileName)
|
int SMESH_Mesh::STLToMesh(const char* theFileName)
|
||||||
{
|
{
|
||||||
if(MYDEBUG) MESSAGE("STLToMesh - theFileName = "<<theFileName);
|
|
||||||
if(_isShapeToMesh)
|
if(_isShapeToMesh)
|
||||||
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
throw SALOME_Exception(LOCALIZED("a shape to mesh has already been defined"));
|
||||||
_isShapeToMesh = false;
|
_isShapeToMesh = false;
|
||||||
|
|
||||||
DriverSTL_R_SMDS_Mesh myReader;
|
DriverSTL_R_SMDS_Mesh myReader;
|
||||||
myReader.SetMesh(_myMeshDS);
|
myReader.SetMesh(_myMeshDS);
|
||||||
myReader.SetFile(theFileName);
|
myReader.SetFile(theFileName);
|
||||||
myReader.SetMeshId(-1);
|
myReader.SetMeshId(-1);
|
||||||
myReader.Perform();
|
myReader.Perform();
|
||||||
if(MYDEBUG){
|
|
||||||
MESSAGE("STLToMesh - _myMeshDS->NbNodes() = "<<_myMeshDS->NbNodes());
|
|
||||||
MESSAGE("STLToMesh - _myMeshDS->NbEdges() = "<<_myMeshDS->NbEdges());
|
|
||||||
MESSAGE("STLToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces());
|
|
||||||
MESSAGE("STLToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes());
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,23 +726,21 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape,
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
SMESH_Hypothesis::Hypothesis_Status
|
SMESH_Hypothesis::Hypothesis_Status
|
||||||
SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
|
SMESH_Mesh::RemoveHypothesis(const TopoDS_Shape & aSubShape,
|
||||||
int anHypId)throw(SALOME_Exception)
|
int anHypId) throw( SALOME_Exception )
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
|
if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
|
||||||
|
|
||||||
StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
|
StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
|
||||||
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
|
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
|
||||||
throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
|
throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
|
||||||
|
|
||||||
SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId];
|
SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId];
|
||||||
if(MYDEBUG) {
|
if(MYDEBUG) { SCRUTE(anHyp->GetType()); }
|
||||||
SCRUTE(anHyp->GetType());
|
|
||||||
}
|
|
||||||
|
|
||||||
// shape
|
// shape
|
||||||
|
|
||||||
bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
|
bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
|
||||||
SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;
|
SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;
|
||||||
|
|
||||||
@ -1032,7 +1009,6 @@ SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const int anHypId) const
|
|||||||
const list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
|
const list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
if(MYDEBUG) MESSAGE("SMESH_Mesh::GetLog");
|
|
||||||
return _myMeshDS->GetScript()->GetCommands();
|
return _myMeshDS->GetScript()->GetCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1044,7 +1020,6 @@ const list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
|
|||||||
void SMESH_Mesh::ClearLog() throw(SALOME_Exception)
|
void SMESH_Mesh::ClearLog() throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
Unexpect aCatch(SalomeException);
|
Unexpect aCatch(SalomeException);
|
||||||
if(MYDEBUG) MESSAGE("SMESH_Mesh::ClearLog");
|
|
||||||
_myMeshDS->GetScript()->Clear();
|
_myMeshDS->GetScript()->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,7 +1029,7 @@ void SMESH_Mesh::ClearLog() throw(SALOME_Exception)
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
|
SMESH_subMesh * SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
|
||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
int index = _myMeshDS->ShapeToIndex(aSubShape);
|
int index = _myMeshDS->ShapeToIndex(aSubShape);
|
||||||
@ -1062,7 +1037,8 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// for submeshes on GEOM Group
|
// for submeshes on GEOM Group
|
||||||
if (( !index || index > _nbSubShapes ) && aSubShape.ShapeType() == TopAbs_COMPOUND ) {
|
if (( !index || index > _nbSubShapes ) && aSubShape.ShapeType() == TopAbs_COMPOUND )
|
||||||
|
{
|
||||||
TopoDS_Iterator it( aSubShape );
|
TopoDS_Iterator it( aSubShape );
|
||||||
if ( it.More() )
|
if ( it.More() )
|
||||||
{
|
{
|
||||||
@ -1214,27 +1190,6 @@ bool SMESH_Mesh::IsUsedHypothesis(SMESHDS_Hypothesis * anHyp,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
// const list < SMESH_subMesh * >&
|
|
||||||
// SMESH_Mesh::GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp)
|
|
||||||
// throw(SALOME_Exception)
|
|
||||||
// {
|
|
||||||
// _subMeshesUsingHypothesisList.clear();
|
|
||||||
// SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() );
|
|
||||||
// while ( smIt->more() )
|
|
||||||
// {
|
|
||||||
// SMESH_subMesh* aSubMesh = smIt->next();
|
|
||||||
// if ( IsUsedHypothesis ( anHyp, aSubMesh ))
|
|
||||||
// _subMeshesUsingHypothesisList.push_back( aSubMesh );
|
|
||||||
// }
|
|
||||||
// return _subMeshesUsingHypothesisList;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : NotifySubMeshesHypothesisModification
|
//function : NotifySubMeshesHypothesisModification
|
||||||
//purpose : Say all submeshes using theChangedHyp that it has been modified
|
//purpose : Say all submeshes using theChangedHyp that it has been modified
|
||||||
@ -1264,7 +1219,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
|
|||||||
|
|
||||||
// if aSubMesh meshing depends on hyp,
|
// if aSubMesh meshing depends on hyp,
|
||||||
// we call aSubMesh->AlgoStateEngine( MODIF_HYP, hyp ) that causes either
|
// we call aSubMesh->AlgoStateEngine( MODIF_HYP, hyp ) that causes either
|
||||||
// 1) clearing of already computed aSubMesh or
|
// 1) clearing already computed aSubMesh or
|
||||||
// 2) changing algo_state from MISSING_HYP to HYP_OK when parameters of hyp becomes valid,
|
// 2) changing algo_state from MISSING_HYP to HYP_OK when parameters of hyp becomes valid,
|
||||||
// other possible changes are not interesting. (IPAL0052457 - assigning hyp performance pb)
|
// other possible changes are not interesting. (IPAL0052457 - assigning hyp performance pb)
|
||||||
if ( aSubMesh->GetComputeState() != SMESH_subMesh::COMPUTE_OK &&
|
if ( aSubMesh->GetComputeState() != SMESH_subMesh::COMPUTE_OK &&
|
||||||
@ -1380,15 +1335,15 @@ bool SMESH_Mesh::HasModificationsToDiscard() const
|
|||||||
|
|
||||||
bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
|
bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
|
||||||
{
|
{
|
||||||
//set<string> aGroupNames; // Corrected for Mantis issue 0020028
|
// Corrected for Mantis issue 0020028
|
||||||
map< SMDSAbs_ElementType, set<string> > aGroupNames;
|
map< SMDSAbs_ElementType, set<string> > aGroupNames;
|
||||||
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
|
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
|
||||||
{
|
{
|
||||||
SMESH_Group* aGroup = it->second;
|
SMESH_Group* aGroup = it->second;
|
||||||
SMDSAbs_ElementType aType = aGroup->GetGroupDS()->GetType();
|
SMDSAbs_ElementType aType = aGroup->GetGroupDS()->GetType();
|
||||||
string aGroupName = aGroup->GetName();
|
string aGroupName = aGroup->GetName();
|
||||||
aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
|
aGroupName.resize( MAX_MED_GROUP_NAME_LENGTH );
|
||||||
if (!aGroupNames[aType].insert(aGroupName).second)
|
if ( !aGroupNames[aType].insert(aGroupName).second )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2025,8 +1980,8 @@ SMESH_Group* SMESH_Mesh::AddGroup (SMESHDS_GroupBase* groupDS) throw(SALOME_Exce
|
|||||||
|
|
||||||
bool SMESH_Mesh::SynchronizeGroups()
|
bool SMESH_Mesh::SynchronizeGroups()
|
||||||
{
|
{
|
||||||
size_t nbGroups = _mapGroup.size();
|
const size_t nbGroups = _mapGroup.size();
|
||||||
const set<SMESHDS_GroupBase*>& groups = _myMeshDS->GetGroups();
|
const set<SMESHDS_GroupBase*>& groups = _myMeshDS->GetGroups();
|
||||||
set<SMESHDS_GroupBase*>::const_iterator gIt = groups.begin();
|
set<SMESHDS_GroupBase*>::const_iterator gIt = groups.begin();
|
||||||
for ( ; gIt != groups.end(); ++gIt )
|
for ( ; gIt != groups.end(); ++gIt )
|
||||||
{
|
{
|
||||||
@ -2101,7 +2056,7 @@ void SMESH_Mesh::SetCallUp( TCallUp* upCaller )
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
bool SMESH_Mesh::RemoveGroup (const int theGroupID)
|
bool SMESH_Mesh::RemoveGroup( const int theGroupID )
|
||||||
{
|
{
|
||||||
if (_mapGroup.find(theGroupID) == _mapGroup.end())
|
if (_mapGroup.find(theGroupID) == _mapGroup.end())
|
||||||
return false;
|
return false;
|
||||||
@ -2340,27 +2295,31 @@ void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape)
|
|||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
bool SMESH_Mesh::SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort) const
|
bool SMESH_Mesh::SortByMeshOrder(std::vector<SMESH_subMesh*>& theListToSort) const
|
||||||
{
|
{
|
||||||
if ( !_mySubMeshOrder.size() || theListToSort.size() < 2)
|
if ( !_mySubMeshOrder.size() || theListToSort.size() < 2)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool res = false;
|
bool res = false;
|
||||||
vector<SMESH_subMesh*> onlyOrderedList;
|
vector<SMESH_subMesh*> onlyOrderedList, smVec;
|
||||||
|
|
||||||
// collect all ordered submeshes in one list as pointers
|
// collect all ordered submeshes in one list as pointers
|
||||||
// and get their positions within theListToSort
|
// and get their positions within theListToSort
|
||||||
typedef vector<SMESH_subMesh*>::iterator TPosInList;
|
typedef vector<SMESH_subMesh*>::iterator TPosInList;
|
||||||
map< int, TPosInList > sortedPos;
|
map< int, TPosInList > sortedPos;
|
||||||
TPosInList smBeg = theListToSort.begin(), smEnd = theListToSort.end();
|
TPosInList smBeg = theListToSort.begin(), smEnd = theListToSort.end();
|
||||||
TListOfListOfInt::const_iterator listIdsIt = _mySubMeshOrder.begin();
|
TListOfListOfInt::const_iterator listIdsIt = _mySubMeshOrder.begin();
|
||||||
for( ; listIdsIt != _mySubMeshOrder.end(); listIdsIt++)
|
for( ; listIdsIt != _mySubMeshOrder.end(); listIdsIt++)
|
||||||
{
|
{
|
||||||
const TListOfInt& listOfId = *listIdsIt;
|
const TListOfInt& listOfId = *listIdsIt;
|
||||||
// convert sm ids to sm's
|
// convert sm ids to sm's
|
||||||
vector<SMESH_subMesh*> smVec;
|
smVec.clear();
|
||||||
TListOfInt::const_iterator idIt = listOfId.begin();
|
TListOfInt::const_iterator idIt = listOfId.begin();
|
||||||
for ( ; idIt != listOfId.end(); idIt++ ) {
|
for ( ; idIt != listOfId.end(); idIt++ )
|
||||||
if ( SMESH_subMesh * sm = GetSubMeshContaining( *idIt )) {
|
{
|
||||||
|
if ( SMESH_subMesh * sm = GetSubMeshContaining( *idIt ))
|
||||||
|
{
|
||||||
|
smVec.push_back( sm );
|
||||||
if ( sm->GetSubMeshDS() && sm->GetSubMeshDS()->IsComplexSubmesh() )
|
if ( sm->GetSubMeshDS() && sm->GetSubMeshDS()->IsComplexSubmesh() )
|
||||||
{
|
{
|
||||||
SMESHDS_SubMeshIteratorPtr smdsIt = sm->GetSubMeshDS()->GetSubMeshIterator();
|
SMESHDS_SubMeshIteratorPtr smdsIt = sm->GetSubMeshDS()->GetSubMeshIterator();
|
||||||
@ -2371,10 +2330,6 @@ void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape)
|
|||||||
smVec.push_back( sm );
|
smVec.push_back( sm );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
smVec.push_back( sm );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// find smVec items in theListToSort
|
// find smVec items in theListToSort
|
||||||
|
@ -1592,13 +1592,13 @@ class Mesh:
|
|||||||
return groups
|
return groups
|
||||||
|
|
||||||
## Return sub-mesh objects list in meshing order
|
## Return sub-mesh objects list in meshing order
|
||||||
# @return list of list of sub-meshes
|
# @return list of lists of sub-meshes
|
||||||
# @ingroup l2_construct
|
# @ingroup l2_construct
|
||||||
def GetMeshOrder(self):
|
def GetMeshOrder(self):
|
||||||
return self.mesh.GetMeshOrder()
|
return self.mesh.GetMeshOrder()
|
||||||
|
|
||||||
## Set order in which concurrent sub-meshes sould be meshed
|
## Set order in which concurrent sub-meshes sould be meshed
|
||||||
# @param submeshes list of sub-meshes
|
# @param submeshes list of lists of sub-meshes
|
||||||
# @ingroup l2_construct
|
# @ingroup l2_construct
|
||||||
def SetMeshOrder(self, submeshes):
|
def SetMeshOrder(self, submeshes):
|
||||||
return self.mesh.SetMeshOrder(submeshes)
|
return self.mesh.SetMeshOrder(submeshes)
|
||||||
|
Loading…
Reference in New Issue
Block a user