Use GEOM_Object_var instead of GEOM_Object_wrap for obj returned by GetMainShape()

This commit is contained in:
eap 2012-12-28 11:38:13 +00:00
parent fd1f32bef8
commit 08f731ecd6
3 changed files with 7 additions and 5 deletions

View File

@ -1373,12 +1373,12 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
// The main shape of the group
GEOM::GEOM_Object_wrap aGroupMainShape;
GEOM::GEOM_Object_var aGroupMainShape;
if (aGeomGroup->GetType() == 37) {
GEOM::GEOM_IGroupOperations_wrap anOp =
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
aGroupMainShape = anOp->GetMainShape(aGeomGroup);
// aGroupMainShape is a new geom servant to be deleted by GEOM_Object_wrap
// aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
}
else {
aGroupMainShape = aGeomGroup;

View File

@ -227,8 +227,9 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom)
GEOM::GEOM_IGroupOperations_wrap aGroupOp =
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
if ( !aGroupOp->_is_nil() ) {
GEOM::GEOM_Object_wrap mainShape = aGroupOp->GetMainShape( geom );
GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom );
// mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom );
if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) {
GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] );
return elementType( member );

View File

@ -354,7 +354,8 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
if (aSubGeomVar->_is_nil()) return false;
// skl for NPAL14695 - implementation of searching of mainObj
GEOM::GEOM_Object_wrap mainObj = op->GetMainShape(aSubGeomVar);
GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as
mainObj already exists! */
while(1) {
if (mainObj->_is_nil())
return false;