else
myDlg->activateObject( SMESHGUI_MeshDlg::Obj );
- myDlg->setHypoSets( SMESH::GetHypothesesSets() );
-
myDlg->setCurrentTab( SMESH::DIM_3D );
myDlg->show();
{
// Enable tabs according to shape dimension
- int shapeDim = -1;
+ int shapeDim = 3;
QStringList aGEOMs;
myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs);
}
if (aSeq->length() > 0) {
- //shapeDim = 0;
+ shapeDim = -1;
for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
switch ( aGeomVar->GetShapeType() ) {
{
//shapeDim = 3; // Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab
TopoDS_Shape aShape;
- bool isClosed = GEOMBase::GetShape(aGeomVar, aShape) && /*aShape.Closed()*/BRep_Tool::IsClosed(aShape);
+ bool isClosed = GEOMBase::GetShape(aGeomVar, aShape) && /*aShape.Closed()*/BRep_Tool::IsClosed(aShape);
shapeDim = qMax(isClosed ? 3 : 2, shapeDim);
}
break;
onAlgoSelected(-1, i);
}
myDlg->setMaxHypoDim( shapeDim );
-
+ myDlg->setHypoSets( SMESH::GetHypothesesSets( shapeDim ));
if (!myToCreate) // edition: read hypotheses
{
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
- if ( !mesh->_is_nil() )
+ if ( !mesh->_is_nil() ) {
+ //rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry
+ QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+ _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
+ myDlg->activateObject(SMESHGUI_MeshDlg::Geom);
enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
+ }
}
myDlg->setGeomPopupEnabled( enable );
}
}
- else {
+ else { // no geometry defined
myDlg->enableTab( SMESH::DIM_3D );
QStringList hypList;
availableHyps( SMESH::DIM_3D, Algo, hypList,
SMESH::CreateHypothesis(theTypeName, aHypName, false);
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(aHyp))
- aHyp->Destroy();
+ aHyp->UnRegister();
#endif
} else {
// Get hypotheses creator client (GUI)
SMESH::CreateHypothesis(theTypeName, aHypName, false);
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(aHyp))
- aHyp->Destroy();
+ aHyp->UnRegister();
#endif
}
}
// It is safe to decrement its refcount
// so that it will be destroyed when the entry in study will be removed
if (aMeshSO)
- aMeshVar->Destroy();
+ aMeshVar->UnRegister();
#endif
}
return true;
SMESH::CreateHypothesis(aHypName, aHypName, true);
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(aHyp))
- aHyp->Destroy();
+ aHyp->UnRegister();
#endif
}
else
{
// Get hypotheses creator client (GUI)
// BUG 0020378
- //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
// Create algorithm
SMESH::CreateHypothesis(aHypName, aHypName, true);
#ifdef WITHGENERICOBJ
if (!CORBA::is_nil(aHyp))
- aHyp->Destroy();
+ aHyp->UnRegister();
#endif
}
}