Improve error reporting for Filling Surface; initialize myGeometryGUI in FillingDlg to avoid exception on initialization of the dialog

This commit is contained in:
jfa 2005-08-08 13:02:01 +00:00
parent c03f2eac0d
commit 774da7a735
2 changed files with 42 additions and 38 deletions

View File

@ -893,12 +893,15 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
//Compute the Solid value
try {
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fiiling driver failed");
SetErrorCode("Filling driver failed");
return NULL;
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
if (strcmp(aFail->GetMessageString(), "Geom_BSplineSurface") == 0)
SetErrorCode("B-Spline surface construction failed");
else
SetErrorCode(aFail->GetMessageString());
return NULL;
}

View File

@ -57,8 +57,11 @@
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl)
:GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, WFlags fl)
:GEOMBase_Skeleton(parent, name, modal,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myGeometryGUI(theGeometryGUI)
{
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FILLING")));
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@ -89,7 +92,6 @@ GenerationGUI_FillingDlg::GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI,
Init();
}
//=================================================================================
// function : ~GenerationGUI_FillingDlg()
// purpose : Destroys the object and frees any allocated resources
@ -99,7 +101,6 @@ GenerationGUI_FillingDlg::~GenerationGUI_FillingDlg()
// no need to delete child widgets, Qt does it all for us
}
//=================================================================================
// function : Init()
// purpose :
@ -268,7 +269,8 @@ void GenerationGUI_FillingDlg::LineEditReturnPressed()
void GenerationGUI_FillingDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
globalSelection( GEOM_COMPOUND );
displayPreview();
}
@ -341,4 +343,3 @@ bool GenerationGUI_FillingDlg::execute( ObjectList& objects )
return true;
}