if ( aMeshEntry == "" && aGeomEntry == "" ) {
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
- aGeomEntry = aGeomVar->GetStudyEntry();
+ if ( !aGeomVar->_is_nil() )
+ aGeomEntry = aGeomVar->GetStudyEntry();
}
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh
if ( !aMeshVar->_is_nil() ) {
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( aMeshSO );
- aMeshEntry = aGeomVar->GetStudyEntry();
+ if ( !aGeomVar->_is_nil() )
+ aMeshEntry = aGeomVar->GetStudyEntry();
}
}
}
if ( aMeshEntry == "" && aGeomEntry == "" ) {
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
- aGeomEntry = aGeomVar->GetStudyEntry();
+ if ( !aGeomVar->_is_nil() )
+ aGeomEntry = aGeomVar->GetStudyEntry();
}
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // take geometry from submesh
if ( !aMeshVar->_is_nil() ) {
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( aMeshSO );
- aMeshEntry = aGeomVar->GetStudyEntry();
+ if ( !aGeomVar->_is_nil() )
+ aMeshEntry = aGeomVar->GetStudyEntry();
}
}
}
//=================================================================================
QList<int> StdMeshersGUI_SubShapeSelectorWdg::GetCorrectedListOfIDs( bool fromSubshapeToMainshape )
{
- if ( myMainShape.IsNull() || myGeomShape.IsNull() )
+ if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) && fromSubshapeToMainshape )
return myListOfIDs;
+ else if ( ( myMainShape.IsNull() || myGeomShape.IsNull() ) && !fromSubshapeToMainshape )
+ return mySelectedIDs;
QList<int> aList;
TopTools_IndexedMapOfShape aGeomMap;