//purpose : auxilary function for conversion long_array to std::map<>
// which is used in some methods
//=======================================================================
-static void ToMap(const SMESH::long_array & IDs,
- const SMESHDS_Mesh* aMesh,
- std::map<int,const SMDS_MeshElement*>& aMap)
+static void ToMap(const SMESH::long_array & IDs,
+ const SMESHDS_Mesh* aMesh,
+ std::map<int,const SMDS_MeshElement*>& aMap,
+ const SMDSAbs_ElementType aType = SMDSAbs_All )
{
for (int i=0; i<IDs.length(); i++) {
CORBA::Long ind = IDs[i];
std::map<int,const SMDS_MeshElement*>::iterator It = aMap.find(ind);
if(It==aMap.end()) {
const SMDS_MeshElement * elem = aMesh->FindElement(ind);
- aMap.insert( make_pair(ind,elem) );
+ if ( elem && ( aType == SMDSAbs_All || elem->GetType() == aType ))
+ aMap.insert( make_pair( elem->GetID(), elem ));
}
}
}
SMESHDS_Mesh* aMesh = GetMeshDS();
map<int,const SMDS_MeshElement*> faces;
- ToMap(IDsOfElements, aMesh, faces);
+ ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
SMESH::NumericalFunctor_i* aNumericalFunctor =
dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
SMESHDS_Mesh* aMesh = GetMeshDS();
map<int,const SMDS_MeshElement*> faces;
- ToMap(IDsOfElements, aMesh, faces);
+ ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
SMESH::NumericalFunctor_i* aNumericalFunctor =
dynamic_cast<SMESH::NumericalFunctor_i*>( SMESH_Gen_i::GetServant( Criterion ).in() );
SMESHDS_Mesh* aMesh = GetMeshDS();
map<int,const SMDS_MeshElement*> faces;
- ToMap(IDsOfElements, aMesh, faces);
+ ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
// Update Python script
TPythonDump() << "isDone = " << this << ".SplitQuad( "
SMESHDS_Mesh* aMesh = GetMeshDS();
map<int,const SMDS_MeshElement*> elements;
- ToMap(IDsOfElements, aMesh, elements);
+ ToMap(IDsOfElements, aMesh, elements, SMDSAbs_Face);
set<const SMDS_MeshNode*> fixedNodes;
for (int i = 0; i < IDsOfFixedNodes.length(); i++) {