- anObj = SALOMEDS::SObject::_nil();
- aMeshSO->FindSubObject(Tag_EdgeGroups , anObj);
- if ( !anObj->_is_nil() )
- {
- SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(anObj);
- if (!hasGroup && it->More())
- {
- anInfo.append(QString("Groups:<br><br>"));
- hasGroup = true;
- }
- for(; it->More(); it->Next()){
- SALOMEDS::SObject_var subObj = it->Value();
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( subObj->GetObject() );
- if ( !aGroup->_is_nil() )
- {
- anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
- anInfo.append(QString("%1<br>").arg("on edges"));
- anInfo.append(QString("%1<br>").arg(aGroup->Size()));
- // check if the group based on geometry
- SMESH::SMESH_GroupOnGeom_var aGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow(aGroup);
- if ( !aGroupOnGeom->_is_nil() )
- {
- GEOM::GEOM_Object_var aGroupMainShape = aGroupOnGeom->GetShape();
- QString aShapeName = "<unknown>";
- SALOMEDS::SObject_var aGeomObj, aRef;
- if ( subObj->FindSubObject( 1, aGeomObj ) && aGeomObj->ReferencedObject( aRef ))
- aShapeName = aRef->GetName();
- anInfo.append(QString("based on <i>%1</i> geometry object<br><br>").arg(aShapeName));
- }
- else
- anInfo.append(QString("<br>"));
- }
- }
+ anObj.reset();
+ aMeshSO->FindSubObject(Tag_EdgeGroups, anObj);
+ if (anObj) {
+ _PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
+ if (!hasGroup && it->More()) {
+ anInfo.append(QString("Groups:<br><br>"));
+ hasGroup = true;
+ }
+ for (; it->More(); it->Next()) {
+ _PTR(SObject) subObj = it->Value();
+ CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+ if (!aGroup->_is_nil()) {
+ anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
+ anInfo.append(QString("%1<br>").arg("on edges"));
+ anInfo.append(QString("%1<br>").arg(aGroup->Size()));
+ // check if the group based on geometry
+ SMESH::SMESH_GroupOnGeom_var aGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow(aGroup);
+ if (!aGroupOnGeom->_is_nil()) {
+ GEOM::GEOM_Object_var aGroupMainShape = aGroupOnGeom->GetShape();
+ QString aShapeName = "<unknown>";
+ _PTR(SObject) aGeomObj, aRef;
+ if (subObj->FindSubObject(1, aGeomObj) && aGeomObj->ReferencedObject(aRef))
+ aShapeName = aRef->GetName().c_str();
+ anInfo.append(QString("based on <i>%1</i> geometry object<br><br>").arg(aShapeName));
+ } else {
+ anInfo.append(QString("<br>"));
+ }
+ }