- CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
- if ( CORBA::is_nil( groupObj )) return newShape;
- GEOM::GEOM_Object_var geomGroup = GEOM::GEOM_Object::_narrow( groupObj );
-
- // get indices of group items
- set<int> curIndices;
- GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
- GEOM::GEOM_IGroupOperations_wrap groupOp =
- geomGen->GetIGroupOperations();
- GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
- for ( CORBA::ULong i = 0; i < ids->length(); ++i )
- curIndices.insert( ids[i] );
-
- if ( groupData._indices == curIndices )
- return newShape; // group not changed
-
- // update data
- groupData._indices = curIndices;
-
- GEOM_Client* geomClient = _gen_i->GetShapeReader();
- if ( !geomClient ) return newShape;
- CORBA::String_var groupIOR = geomGen->GetStringFromIOR( geomGroup );
- geomClient->RemoveShapeFromBuffer( groupIOR.in() );
- newShape = _gen_i->GeomObjectToShape( geomGroup );
+ SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( groupData._smeshObject );
+ SALOMEDS::SObject_wrap geomRefSO, geomSO;
+ if ( !meshSO->_is_nil() &&
+ meshSO->FindSubObject( SMESH::Tag_RefOnShape, geomRefSO.inout() ) &&
+ geomRefSO->ReferencedObject( geomSO.inout() ))
+ {
+ CORBA::Object_var geomObj = _gen_i->SObjectToObject( geomSO );
+ GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( geomObj );
+ newShape = _gen_i->GeomObjectToShape( geom );
+ CORBA::String_var entry = geom->GetStudyEntry();
+ groupData._groupEntry = entry.in();
+ }
+ }
+ else
+ {
+ // get geom group
+ SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( groupData._groupEntry.c_str() );
+ if ( !groupSO->_is_nil() )
+ {
+ CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
+ if ( CORBA::is_nil( groupObj )) return newShape;
+ GEOM::GEOM_Object_var geomGroup = GEOM::GEOM_Object::_narrow( groupObj );
+
+ // get indices of group items
+ set<int> curIndices;
+ GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine( geomGroup );
+ GEOM::GEOM_IGroupOperations_wrap groupOp = geomGen->GetIGroupOperations();
+ GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
+ for ( CORBA::ULong i = 0; i < ids->length(); ++i )
+ curIndices.insert( ids[i] );
+
+ if ( how == ONLY_IF_CHANGED && groupData._indices == curIndices )
+ return newShape; // group not changed
+
+ // update data
+ groupData._indices = curIndices;
+
+ GEOM_Client* geomClient = _gen_i->GetShapeReader();
+ if ( !geomClient ) return newShape;
+ CORBA::String_var groupIOR = geomGen->GetStringFromIOR( geomGroup );
+ geomClient->RemoveShapeFromBuffer( groupIOR.in() );
+ newShape = _gen_i->GeomObjectToShape( geomGroup );
+ }