INFOS("SMESH_Mesh::~SMESH_Mesh");
// delete groups
- map < int, SMESH_Group * >::iterator itg;
+ std::map < int, SMESH_Group * >::iterator itg;
for (itg = _mapGroup.begin(); itg != _mapGroup.end(); itg++) {
SMESH_Group *aGroup = (*itg).second;
delete aGroup;
{
// removal of a shape to mesh, delete objects referring to sub-shapes:
// - sub-meshes
- map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.begin();
+ std::map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.begin();
for ( ; i_sm != _mapSubMesh.end(); ++i_sm )
delete i_sm->second;
_mapSubMesh.clear();
// - groups on geometry
- map <int, SMESH_Group *>::iterator i_gr = _mapGroup.begin();
+ std::map <int, SMESH_Group *>::iterator i_gr = _mapGroup.begin();
while ( i_gr != _mapGroup.end() ) {
if ( dynamic_cast<SMESHDS_GroupOnGeom*>( i_gr->second->GetGroupDS() )) {
_myMeshDS->RemoveGroup( i_gr->second->GetGroupDS() );
}
// Reading groups (sub-meshes are out of scope of MED import functionality)
- list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
+ std::list<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
if(MYDEBUG) MESSAGE("MEDToMesh - Nb groups = "<<aGroupNames.size());
int anId;
- list<TNameAndType>::iterator name_type = aGroupNames.begin();
+ std::list<TNameAndType>::iterator name_type = aGroupNames.begin();
for ( ; name_type != aGroupNames.end(); name_type++ ) {
SMESH_Group* aGroup = AddGroup( name_type->second, name_type->first.c_str(), anId );
if ( aGroup ) {
*/
//=============================================================================
-const list<const SMESHDS_Hypothesis*>&
+const std::list<const SMESHDS_Hypothesis*>&
SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const
throw(SALOME_Exception)
{
//=======================================================================
/*!
* \brief Return the hypothesis assigned to the shape
- * \param aSubShape - the shape to check
- * \param aFilter - the hypothesis filter
- * \param andAncestors - flag to check hypos assigned to ancestors of the shape
- * \retval SMESH_Hypothesis* - the first hypo passed through aFilter
+ * \param aSubShape - the shape to check
+ * \param aFilter - the hypothesis filter
+ * \param andAncestors - flag to check hypos assigned to ancestors of the shape
+ * \param assignedTo - to return the shape the found hypo is assigned to
+ * \retval SMESH_Hypothesis* - the first hypo passed through aFilter
*/
//=======================================================================
const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubShape,
const SMESH_HypoFilter& aFilter,
- const bool andAncestors) const
+ const bool andAncestors,
+ TopoDS_Shape* assignedTo) const
{
{
- const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
- list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
+ const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
+ std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp );
- if ( aFilter.IsOk( h, aSubShape))
+ if ( aFilter.IsOk( h, aSubShape)) {
+ if ( assignedTo ) *assignedTo = aSubShape;
return h;
+ }
}
}
if ( andAncestors )
TopTools_ListIteratorOfListOfShape it( GetAncestors( aSubShape ));
for (; it.More(); it.Next() )
{
- const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
- list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
+ const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
+ std::list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
for ( ; hyp != hypList.end(); hyp++ ) {
const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp );
- if (aFilter.IsOk( h, it.Value() ))
+ if (aFilter.IsOk( h, it.Value() )) {
+ if ( assignedTo ) *assignedTo = it.Value();
return h;
+ }
}
}
}
bool mainHypFound = false;
// fill in hypTypes
- list<const SMESHDS_Hypothesis*>::const_iterator hyp;
+ std::list<const SMESHDS_Hypothesis*>::const_iterator hyp;
for ( hyp = aHypList.begin(); hyp != aHypList.end(); hyp++ ) {
if ( hypTypes.insert( (*hyp)->GetName() ).second )
nbHyps++;
// get hypos from aSubShape
{
- const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
+ const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(aSubShape);
for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ )
if ( aFilter.IsOk (cSMESH_Hyp( *hyp ), aSubShape) &&
( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) &&
{
if ( !map.Add( it.Value() ))
continue;
- const list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
+ const std::list<const SMESHDS_Hypothesis*>& hypList = _myMeshDS->GetHypothesis(it.Value());
for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ )
if (aFilter.IsOk( cSMESH_Hyp( *hyp ), it.Value() ) &&
( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) &&
*/
//=============================================================================
-const list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
+const std::list<SMESHDS_Command*> & SMESH_Mesh::GetLog() throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
if(MYDEBUG) MESSAGE("SMESH_Mesh::GetLog");
*/
//================================================================================
-list<SMESH_subMesh*>
+std::list<SMESH_subMesh*>
SMESH_Mesh::GetGroupSubMeshesContaining(const TopoDS_Shape & aSubShape) const
throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
- list<SMESH_subMesh*> found;
+ std::list<SMESH_subMesh*> found;
SMESH_subMesh * subMesh = GetSubMeshContaining(aSubShape);
if ( !subMesh )
return found;
// submeshes of groups have max IDs, so search from the map end
- map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
+ std::map<int, SMESH_subMesh *>::const_reverse_iterator i_sm;
for ( i_sm = _mapSubMesh.rbegin(); i_sm != _mapSubMesh.rend(); ++i_sm) {
SMESHDS_SubMesh * ds = i_sm->second->GetSubMeshDS();
if ( ds && ds->IsComplexSubmesh() ) {
bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
{
set<string> aGroupNames;
- for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
SMESH_Group* aGroup = it->second;
- string aGroupName = aGroup->GetName();
+ std::string aGroupName = aGroup->GetName();
aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
if (!aGroupNames.insert(aGroupName).second)
return true;
set<string> aGroupNames;
char aString [256];
int maxNbIter = 10000; // to guarantee cycle finish
- for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
SMESH_Group* aGroup = it->second;
SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
if ( aGroupDS ) {
myWriter.SetMeshId(_idDoc);
// myWriter.SetGroups(_mapGroup);
- for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ for ( std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
SMESH_Group* aGroup = it->second;
SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
if ( aGroupDS ) {
- string aGroupName = aGroup->GetName();
+ std::string aGroupName = aGroup->GetName();
aGroupDS->SetStoreName( aGroupName.c_str() );
myWriter.AddGroup( aGroupDS );
}
*/
//=============================================================================
-list<int> SMESH_Mesh::GetGroupIds() const
+std::list<int> SMESH_Mesh::GetGroupIds() const
{
- list<int> anIds;
- for ( map<int, SMESH_Group*>::const_iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
+ std::list<int> anIds;
+ for ( std::map<int, SMESH_Group*>::const_iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
anIds.push_back( it->first );
return anIds;
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
- map<int,int> myFaceMap;
+ std::map<int,int> myFaceMap;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
while( itFaces->more( ) ) {
int nbNodes = itFaces->next()->NbNodes();
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
save << clause << ".4) Number of " << orderStr << " pyramids:\t" << nb5 << endl;
if ( nb8 + nb4 + nb5 + nb6 != NbVolumes(order) ) {
- map<int,int> myVolumesMap;
+ std::map<int,int> myVolumesMap;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
while( itVolumes->more( ) ) {
int nbNodes = itVolumes->next()->NbNodes();