mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
Improve reaction of 'Divide edge' dialog on Display of objects
This commit is contained in:
parent
c1745184cb
commit
b6b2fb7cd6
@ -53,9 +53,11 @@ using namespace std;
|
||||
// The dialog will by default be modeless, unless you set 'modal' to
|
||||
// TRUE to construct a modal dialog.
|
||||
//=================================================================================
|
||||
BasicGUI_ArcDlg::BasicGUI_ArcDlg(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()
|
||||
BasicGUI_ArcDlg::BasicGUI_ArcDlg(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_ARC")));
|
||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
@ -145,10 +147,10 @@ void BasicGUI_ArcDlg::ClickOnOk()
|
||||
ClickOnCancel();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//=================================================================================
|
||||
// function : ClickOnCancel()
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
//=================================================================================
|
||||
void BasicGUI_ArcDlg::ClickOnCancel()
|
||||
{
|
||||
GEOMBase_Skeleton::ClickOnCancel();
|
||||
@ -317,7 +319,8 @@ bool BasicGUI_ArcDlg::isValid( QString& msg )
|
||||
//=================================================================================
|
||||
bool BasicGUI_ArcDlg::execute( ObjectList& objects )
|
||||
{
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArc( myPoint1, myPoint2, myPoint3 );
|
||||
GEOM::GEOM_Object_var anObj =
|
||||
GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
|
||||
if ( !anObj->_is_nil() )
|
||||
objects.push_back( anObj._retn() );
|
||||
return true;
|
||||
|
@ -111,11 +111,13 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||
}
|
||||
case 212: // MENU VIEW - DISPLAY ALL
|
||||
{
|
||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||
myDisplayGUI->DisplayAll();
|
||||
break;
|
||||
}
|
||||
case 213: // MENU VIEW - DISPLAY ONLY
|
||||
{
|
||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||
myDisplayGUI->DisplayOnly();
|
||||
break;
|
||||
}
|
||||
@ -131,6 +133,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||
}
|
||||
case 216: // MENU VIEW - DISPLAY
|
||||
{
|
||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||
myDisplayGUI->Display();
|
||||
break;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||
aDlg = new RepairGUI_RemoveIntWiresDlg( parent, "" );
|
||||
break;
|
||||
case 608: // ADD POINT ON EDGE
|
||||
aDlg = new RepairGUI_DivideEdgeDlg( parent, "" );
|
||||
aDlg = new RepairGUI_DivideEdgeDlg( getGeometryGUI(), parent, "" );
|
||||
break;
|
||||
case 609: // FREE BOUNDARIES
|
||||
aDlg = new RepairGUI_FreeBoundDlg( getGeometryGUI(), parent );
|
||||
|
@ -48,9 +48,13 @@ using namespace std;
|
||||
// The dialog will by default be modeless, unless you set 'modal' to
|
||||
// TRUE to construct a modal dialog.
|
||||
//=================================================================================
|
||||
RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
|
||||
:GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||
RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||
const char* name, bool modal, WFlags fl)
|
||||
: GEOMBase_Skeleton(parent, name, modal, WStyle_Customize |
|
||||
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
||||
{
|
||||
myGeomGUI = theGeometryGUI;
|
||||
|
||||
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_DIVIDE_EDGE")));
|
||||
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
|
||||
|
||||
@ -76,7 +80,7 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg(QWidget* parent, const char* na
|
||||
myIsParameterGr->find( 0 )->toggle();
|
||||
|
||||
QGridLayout* aLay = new QGridLayout( 0, 1, 2, 0, 6, "aLay" );
|
||||
myValEdt = new QtxDblSpinBox(0., 1., 0.1, GroupPoints->GroupBox1);// QAD_SpinBoxDbl( GroupPoints->GroupBox1, 0., 1., 0.1, 3 );
|
||||
myValEdt = new QtxDblSpinBox(0., 1., 0.1, GroupPoints->GroupBox1);
|
||||
myValEdt->setPrecision( 3 );
|
||||
myValEdt->setValue( 0.5 );
|
||||
QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->GroupBox1 );
|
||||
@ -128,7 +132,7 @@ void RepairGUI_DivideEdgeDlg::Init()
|
||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) );
|
||||
}
|
||||
@ -145,7 +149,6 @@ void RepairGUI_DivideEdgeDlg::ClickOnOk()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ClickOnApply()
|
||||
// purpose :
|
||||
@ -205,7 +208,9 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
|
||||
GEOM::short_array anIndexes;
|
||||
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap );
|
||||
SalomeApp_Application* anApp =
|
||||
(SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
|
||||
anApp->selectionMgr()->GetIndexes( anIO, aMap );
|
||||
|
||||
if ( !aMap.IsEmpty() ) // subshape selection
|
||||
{
|
||||
@ -269,7 +274,6 @@ void RepairGUI_DivideEdgeDlg::DeactivateActiveDialog()
|
||||
GEOMBase_Skeleton::DeactivateActiveDialog();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : ActivateThisDialog()
|
||||
// purpose :
|
||||
@ -278,7 +282,7 @@ void RepairGUI_DivideEdgeDlg::ActivateThisDialog()
|
||||
{
|
||||
GEOMBase_Skeleton::ActivateThisDialog();
|
||||
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
|
||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||
|
||||
myObject = GEOM::GEOM_Object::_nil();
|
||||
myIndex = -1;
|
||||
@ -287,7 +291,6 @@ void RepairGUI_DivideEdgeDlg::ActivateThisDialog()
|
||||
initSelection();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : enterEvent()
|
||||
// purpose : Mouse enter onto the dialog to activate it
|
||||
@ -298,7 +301,6 @@ void RepairGUI_DivideEdgeDlg::enterEvent(QEvent* e)
|
||||
ActivateThisDialog();
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : closeEvent()
|
||||
// purpose :
|
||||
@ -309,6 +311,7 @@ void RepairGUI_DivideEdgeDlg::closeEvent(QCloseEvent* e)
|
||||
GEOMBase_Skeleton::closeEvent( e );
|
||||
}
|
||||
|
||||
|
||||
//=================================================================================
|
||||
// function : createOperation
|
||||
// purpose :
|
||||
@ -333,8 +336,8 @@ bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
|
||||
//=================================================================================
|
||||
bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects )
|
||||
{
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->DivideEdge(
|
||||
myObject, myIndex, myValEdt->value(), getIsByParameter() );
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->DivideEdge
|
||||
( myObject, myIndex, myValEdt->value(), getIsByParameter() );
|
||||
bool aResult = !anObj->_is_nil();
|
||||
if ( aResult )
|
||||
objects.push_back( anObj._retn() );
|
||||
@ -360,6 +363,3 @@ void RepairGUI_DivideEdgeDlg::initSelection()
|
||||
GEOM::GEOM_Object_var aNullGeomObject;
|
||||
localSelection( aNullGeomObject, TopAbs_EDGE ); // load local selection on ALL objects
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -47,7 +47,8 @@ class RepairGUI_DivideEdgeDlg : public GEOMBase_Skeleton
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RepairGUI_DivideEdgeDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent = 0,
|
||||
const char* name = 0, bool modal = FALSE, WFlags fl = 0);
|
||||
~RepairGUI_DivideEdgeDlg();
|
||||
|
||||
protected:
|
||||
@ -71,7 +72,7 @@ private :
|
||||
QButtonGroup* myIsParameterGr;
|
||||
QtxDblSpinBox* myValEdt;
|
||||
|
||||
private slots:
|
||||
protected slots:
|
||||
void ClickOnOk();
|
||||
bool ClickOnApply();
|
||||
void ClickOnCancel();
|
||||
|
Loading…
Reference in New Issue
Block a user