From: jfa Date: Thu, 30 Mar 2006 15:16:34 +0000 (+0000) Subject: Fix bug 10244: 'Display only' breaks local selection. X-Git-Tag: T3_2_0b1_pre1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e7ad1edfd4eb036ef55b519cb480673e9af62b1;p=modules%2Fgeom.git Fix bug 10244: 'Display only' breaks local selection. --- diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index 716117ed3..cdd13cfd6 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -55,9 +55,8 @@ using namespace std; //================================================================================= 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) + : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -108,7 +107,7 @@ BasicGUI_ArcDlg::~BasicGUI_ArcDlg() void BasicGUI_ArcDlg::Init() { /* init variables */ - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); globalSelection( GEOM_POINT ); myEditCurrentArgument = Group3Pnts->LineEdit1; @@ -118,8 +117,8 @@ void BasicGUI_ArcDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -255,7 +254,7 @@ void BasicGUI_ArcDlg::ActivateThisDialog() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); globalSelection( GEOM_POINT ); myEditCurrentArgument = Group3Pnts->LineEdit1; @@ -273,7 +272,7 @@ void BasicGUI_ArcDlg::ActivateThisDialog() //================================================================================= void BasicGUI_ArcDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -293,7 +292,7 @@ void BasicGUI_ArcDlg::enterEvent(QEvent* e) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_ArcDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); } //================================================================================= @@ -334,6 +333,5 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_ArcDlg.h b/src/BasicGUI/BasicGUI_ArcDlg.h index 42b1a454b..ba26bd443 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.h +++ b/src/BasicGUI/BasicGUI_ArcDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_ArcDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_ARC_H #define DIALOGBOX_ARC_H @@ -45,7 +44,8 @@ class BasicGUI_ArcDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~BasicGUI_ArcDlg(); protected: @@ -60,8 +60,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3; DlgRef_3Sel_QTD* Group3Pnts; diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 8c655edae..7882638ac 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -46,9 +46,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_CircleDlg::BasicGUI_CircleDlg(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) +BasicGUI_CircleDlg::BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CIRCLE_PV"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CIRCLE_PNTS"))); @@ -117,7 +118,7 @@ void BasicGUI_CircleDlg::Init() myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); @@ -129,8 +130,8 @@ void BasicGUI_CircleDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -146,7 +147,7 @@ void BasicGUI_CircleDlg::Init() connect(GroupPntVecR->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPntVecR->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPntVecR->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPntVecR->SpinBox_DX, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; @@ -320,7 +321,7 @@ void BasicGUI_CircleDlg::ActivateThisDialog() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); ConstructorsClicked( getConstructorId() ); } @@ -342,7 +343,7 @@ void BasicGUI_CircleDlg::enterEvent(QEvent* e) //================================================================================= void BasicGUI_CircleDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -370,7 +371,7 @@ double BasicGUI_CircleDlg::getRadius() const //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_CircleDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); } //================================================================================= @@ -431,7 +432,6 @@ bool BasicGUI_CircleDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_CircleDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_CircleDlg.h b/src/BasicGUI/BasicGUI_CircleDlg.h index 3a61f7edf..d3828b339 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.h +++ b/src/BasicGUI/BasicGUI_CircleDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_CircleDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CIRCLE_H #define DIALOGBOX_CIRCLE_H @@ -35,9 +34,8 @@ #include "BasicGUI.h" -//#include "GEOM_EdgeFilter.hxx" -//#include "GEOM_ShapeTypeFilter.hxx" #include + #if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS #define BASICGUI_WNT_EXPORT __declspec( dllexport ) #else @@ -49,11 +47,12 @@ // purpose : //================================================================================= class BasicGUI_CircleDlg : public GEOMBase_Skeleton -{ +{ Q_OBJECT public: - BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_CircleDlg(); protected: @@ -64,13 +63,11 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); double getRadius() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3; DlgRef_2Sel1Spin* GroupPntVecR; @@ -90,7 +87,6 @@ private slots: void LineEditReturnPressed(); void SetEditCurrentArgument(); void ValueChangedInSpinBox(); - }; #endif // DIALOGBOX_CIRCLE_H diff --git a/src/BasicGUI/BasicGUI_CurveDlg.cxx b/src/BasicGUI/BasicGUI_CurveDlg.cxx index 82fd598fb..e52dcb843 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.cxx +++ b/src/BasicGUI/BasicGUI_CurveDlg.cxx @@ -51,18 +51,19 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_CurveDlg::BasicGUI_CurveDlg(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) +BasicGUI_CurveDlg::BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POLYLINE"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPLINE"))); QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BEZIER"))); - + QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_CURVE_TITLE")); - + /***************************************************************/ RadioButton1->setPixmap( image0 ); RadioButton2->setPixmap( image3 ); @@ -72,7 +73,7 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* paren GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) ); GroupPoints->TextLabel1->setText( tr("GEOM_POINTS") ); GroupPoints->PushButton1->setPixmap(image1); - + GroupPoints->LineEdit1->setReadOnly( true ); Layout1->addWidget(GroupPoints, 2, 0); @@ -109,8 +110,8 @@ void BasicGUI_CurveDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -311,7 +312,7 @@ void BasicGUI_CurveDlg::ActivateThisDialog() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); globalSelection( GEOM_POINT ); ConstructorsClicked( getConstructorId() ); @@ -323,7 +324,7 @@ void BasicGUI_CurveDlg::ActivateThisDialog() //================================================================================= void BasicGUI_CurveDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -343,7 +344,7 @@ void BasicGUI_CurveDlg::enterEvent(QEvent* e) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_CurveDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); } //================================================================================= @@ -393,7 +394,6 @@ bool BasicGUI_CurveDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_CurveDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_CurveDlg.h b/src/BasicGUI/BasicGUI_CurveDlg.h index c8a501251..ec15cfd54 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.h +++ b/src/BasicGUI/BasicGUI_CurveDlg.h @@ -23,7 +23,6 @@ // File : BasicGUI_CurveDlg.h // Author : Alexander SLADKOV // Module : GEOM -// $Header$ #ifndef BASICGUI_CURVE_H #define BASICGUI_CURVE_H @@ -32,13 +31,14 @@ #include "DlgRef_1Sel_QTD.h" #include "BasicGUI.h" + #include + #if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS #define BASICGUI_WNT_EXPORT __declspec( dllexport ) #else #define BASICGUI_WNT_EXPORT #endif -//#include "GEOM_ShapeTypeFilter.hxx" //================================================================================= // class : BasicGUI_CurveDlg @@ -49,7 +49,8 @@ class BasicGUI_CurveDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_CurveDlg(); protected: @@ -64,8 +65,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - DlgRef_1Sel_QTD* GroupPoints; GEOM::ListOfGO_var myPoints; list myOrderedSel;//!< This list used for managing orderes selection diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index b4fb9ec4b..0caecc46d 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -47,14 +47,16 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(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) +BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ELLIPSE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_ELLIPSE_TITLE")); - + /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_ELLIPSE")); RadioButton1->setPixmap(image0); @@ -75,7 +77,7 @@ BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* p Layout1->addWidget(GroupPoints, 2, 0); /***************************************************************/ - + setHelpFileName("ellipse.htm"); Init(); @@ -103,7 +105,7 @@ void BasicGUI_EllipseDlg::Init() myPoint = myDir = GEOM::GEOM_Object::_nil(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); @@ -119,8 +121,8 @@ void BasicGUI_EllipseDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -134,8 +136,8 @@ void BasicGUI_EllipseDlg::Init() connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; @@ -274,7 +276,7 @@ void BasicGUI_EllipseDlg::ActivateThisDialog() //================================================================================= void BasicGUI_EllipseDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -303,7 +305,7 @@ void BasicGUI_EllipseDlg::ValueChangedInSpinBox(double newValue) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_EllipseDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() ); } //================================================================================= @@ -344,7 +346,6 @@ bool BasicGUI_EllipseDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_EllipseDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.h b/src/BasicGUI/BasicGUI_EllipseDlg.h index 86f2cb33e..888c3f4f2 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.h +++ b/src/BasicGUI/BasicGUI_EllipseDlg.h @@ -23,7 +23,6 @@ // File : BasicGUI_EllipseDlg.h // Author : Nicolas REJNERI // Module : GEOM -// $Header$ #ifndef BASICGUI_ELLIPSE_H #define BASICGUI_ELLIPSE_H @@ -33,14 +32,14 @@ #include "BasicGUI.h" -//#include "GEOM_ShapeTypeFilter.hxx" -//#include "GEOM_EdgeFilter.hxx" #include + #if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS #define BASICGUI_WNT_EXPORT __declspec( dllexport ) #else #define BASICGUI_WNT_EXPORT #endif + //================================================================================= // class : BasicGUI_EllipseDlg // purpose : @@ -50,7 +49,8 @@ class BasicGUI_EllipseDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_EllipseDlg(); protected: @@ -65,8 +65,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir; DlgRef_2Sel2Spin* GroupPoints; diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index 9e26a2d4f..e8d37aedd 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -48,8 +48,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_LineDlg::BasicGUI_LineDlg(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) +BasicGUI_LineDlg::BasicGUI_LineDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_SELECT"))); @@ -101,13 +103,13 @@ void BasicGUI_LineDlg::Init() myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); globalSelection( GEOM_POINT ); /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -225,7 +227,7 @@ void BasicGUI_LineDlg::ActivateThisDialog() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); globalSelection( GEOM_POINT ); myEditCurrentArgument = GroupPoints->LineEdit1; @@ -242,7 +244,7 @@ void BasicGUI_LineDlg::ActivateThisDialog() //================================================================================= void BasicGUI_LineDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -262,7 +264,7 @@ void BasicGUI_LineDlg::enterEvent(QEvent* e) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_LineDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); } //================================================================================= @@ -292,7 +294,6 @@ bool BasicGUI_LineDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_LineDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_LineDlg.h b/src/BasicGUI/BasicGUI_LineDlg.h index 7afed3c4e..d05c1a5b2 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.h +++ b/src/BasicGUI/BasicGUI_LineDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_LineDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_LINE_H #define DIALOGBOX_LINE_H @@ -47,7 +46,8 @@ class BasicGUI_LineDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_LineDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_LineDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_LineDlg(); protected: @@ -62,8 +62,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint1; GEOM::GEOM_Object_var myPoint2; diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 762423af9..6d0f74371 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -58,8 +58,8 @@ // purpose : Constructor //================================================================================= BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent ) -: GEOMBase_Skeleton( theParent, "BasicGUI_MarkerDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), myGeometryGUI(theGeometryGUI) + : GEOMBase_Skeleton(theGeometryGUI, theParent, "BasicGUI_MarkerDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) ); QPixmap iconCS2 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER2" ) ) ); @@ -160,8 +160,8 @@ void BasicGUI_MarkerDlg::Init() connect(Group2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( onClose() ) ); - connect( myGeometryGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ); - connect( myGeometryGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onClose() ) ); + connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ); + connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onClose() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( onOk() ) ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) ); @@ -322,7 +322,7 @@ void BasicGUI_MarkerDlg::onSelectionDone0() if ( aRes && !aSelectedObj->_is_nil() ) { TopoDS_Shape aShape; - if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) + if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { if ( aSelectedObj->GetType() == GEOM_MARKER && aShape.ShapeType() == TopAbs_FACE ) { @@ -404,7 +404,7 @@ void BasicGUI_MarkerDlg::onSelectionDone() if ( !CORBA::is_nil( aSelectedObj ) && aRes ) { aName = GEOMBase::GetName( aSelectedObj ); TopoDS_Shape aShape; - if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) { + if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) { GEOM::short_array anIndexes; TColStd_IndexedMapOfInteger aMap; @@ -645,7 +645,7 @@ void BasicGUI_MarkerDlg::enterEvent(QEvent* e) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.h b/src/BasicGUI/BasicGUI_MarkerDlg.h index 7b3cf3bde..ca2b93303 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.h +++ b/src/BasicGUI/BasicGUI_MarkerDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_MarkerDlg.h // Author : Sergey LITONIN // Module : GEOM -// $Header$ #ifndef DIALOGBOX_Marker_H #define DIALOGBOX_Marker_H @@ -66,12 +65,10 @@ protected: const bool toRemoveFromEngine = true, const double lineWidth = -1 ); -private : +private: void enterEvent( QEvent* e ); void onSelectionDone0(); - GeometryGUI* myGeometryGUI; - private slots: void onOk(); void onClose(); diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index a51e2f11c..75c9b5f84 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -46,8 +46,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(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) +BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_3PNTS"))); @@ -125,7 +127,7 @@ void BasicGUI_PlaneDlg::Init() myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); @@ -143,8 +145,8 @@ void BasicGUI_PlaneDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -168,9 +170,9 @@ void BasicGUI_PlaneDlg::Init() connect(Group3Pnts->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupFace->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPntDir->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Pnts->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupFace->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPntDir->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Pnts->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupFace->SpinBox_DX, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -375,7 +377,7 @@ void BasicGUI_PlaneDlg::ActivateThisDialog() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); ConstructorsClicked( getConstructorId() ); } @@ -386,7 +388,7 @@ void BasicGUI_PlaneDlg::ActivateThisDialog() //================================================================================= void BasicGUI_PlaneDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -431,7 +433,7 @@ double BasicGUI_PlaneDlg::getSize() const //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_PlaneDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); } //================================================================================= @@ -503,7 +505,6 @@ bool BasicGUI_PlaneDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_PlaneDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.h b/src/BasicGUI/BasicGUI_PlaneDlg.h index cf3c65c4b..96f7a0c94 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.h +++ b/src/BasicGUI/BasicGUI_PlaneDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_PlaneDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_PLANE_H #define DIALOGBOX_PLANE_H @@ -49,9 +48,10 @@ class BasicGUI_PlaneDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_PlaneDlg(); - + protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); @@ -65,8 +65,6 @@ private : void enterEvent(QEvent* e); double getSize() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3, myFace; DlgRef_2Sel1Spin* GroupPntDir; diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index f49b0d1d4..df16f8730 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -57,8 +57,9 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, fl ), myGeometryGUI(theGeometryGUI) +BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl ) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_EDGE"))); @@ -128,10 +129,10 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren } -//======================================================================= +//================================================================================= // function : ~BasicGUI_PointDlg() // purpose : Destructor -//======================================================================= +//================================================================================= BasicGUI_PointDlg::~BasicGUI_PointDlg() { } @@ -151,8 +152,6 @@ void BasicGUI_PointDlg::Init() myEditCurrentArgument = 0; - // myGeometryGUI->SetState( 0 ); - /* Get setting of step value from file configuration */ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); @@ -178,8 +177,8 @@ void BasicGUI_PointDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -196,13 +195,13 @@ void BasicGUI_PointDlg::Init() connect(GroupRefPoint->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupRefPoint->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupOnCurve->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DZ, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupOnCurve->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DZ, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -305,10 +304,10 @@ bool BasicGUI_PointDlg::ClickOnApply() } -//======================================================================= +//================================================================================= // function : ClickOnCancel() // purpose : -//======================================================================= +//================================================================================= void BasicGUI_PointDlg::ClickOnCancel() { GEOMBase_Skeleton::ClickOnCancel(); @@ -324,66 +323,68 @@ void BasicGUI_PointDlg::SelectionIntoArgument() const int id = getConstructorId(); if ( ( id == 1 || id == 2 ) && myEditCurrentArgument != 0 ) - { - myEditCurrentArgument->setText(""); - myX->setText( "" ); - myY->setText( "" ); - myZ->setText( "" ); - myRefPoint = myEdge = GEOM::GEOM_Object::_nil(); - } - + { + myEditCurrentArgument->setText(""); + myX->setText( "" ); + myY->setText( "" ); + myZ->setText( "" ); + myRefPoint = myEdge = GEOM::GEOM_Object::_nil(); + } + if ( IObjectCount() == 1 ) + { + Standard_Boolean aRes = Standard_False; + Handle(SALOME_InteractiveObject) anIO = firstIObject(); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); + if ( !CORBA::is_nil( aSelectedObject ) && aRes ) { - Standard_Boolean aRes = Standard_False; - Handle(SALOME_InteractiveObject) anIO = firstIObject(); - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); - if ( !CORBA::is_nil( aSelectedObject ) && aRes ) - { - if ( id == 0 ) - { - // get CORBA reference to data object - TopoDS_Shape aShape = myGeometryGUI->GetShapeReader().GetShape( myGeometryGUI->GetGeomGen(), aSelectedObject ); - if ( aShape.IsNull() ) - return; - - if ( aShape.ShapeType() != TopAbs_VERTEX ) - { - TColStd_IndexedMapOfInteger aMap; - - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); - - if ( aMap.Extent() == 1 ) - { - int anIndex = aMap( 1 ); - TopTools_IndexedMapOfShape aShapes; - TopExp::MapShapes( aShape, aShapes ); - aShape = aShapes.FindKey( anIndex ); - - if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX ) - return; - } - else - return; - } - - gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); - GroupXYZ->SpinBox_DX->SetValue( aPnt.X() ); - GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() ); - GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() ); - } - else if ( id == 1 ) - { - myRefPoint = aSelectedObject; - GroupRefPoint->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) ); - } - else if ( id == 2 ) - { - myEdge = aSelectedObject; - GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) ); - } - } + if ( id == 0 ) + { + // get CORBA reference to data object + TopoDS_Shape aShape = myGeomGUI->GetShapeReader().GetShape + ( myGeomGUI->GetGeomGen(), aSelectedObject ); + if ( aShape.IsNull() ) + return; + + if ( aShape.ShapeType() != TopAbs_VERTEX ) + { + TColStd_IndexedMapOfInteger aMap; + LightApp_Application* anApp = + (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + anApp->selectionMgr()->GetIndexes( anIO, aMap ); + + if ( aMap.Extent() == 1 ) + { + int anIndex = aMap( 1 ); + TopTools_IndexedMapOfShape aShapes; + TopExp::MapShapes( aShape, aShapes ); + aShape = aShapes.FindKey( anIndex ); + + if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX ) + return; + } + else + return; + } + + gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); + GroupXYZ->SpinBox_DX->SetValue( aPnt.X() ); + GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() ); + GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() ); + } + else if ( id == 1 ) + { + myRefPoint = aSelectedObject; + GroupRefPoint->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) ); + } + else if ( id == 2 ) + { + myEdge = aSelectedObject; + GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) ); + } } - + } + displayPreview(); } @@ -446,7 +447,7 @@ void BasicGUI_PointDlg::enterEvent(QEvent* e) void BasicGUI_PointDlg::ActivateThisDialog( ) { GEOMBase_Skeleton::ActivateThisDialog(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); ConstructorsClicked( getConstructorId() ); } @@ -457,7 +458,7 @@ void BasicGUI_PointDlg::ActivateThisDialog( ) //================================================================================= void BasicGUI_PointDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -471,10 +472,10 @@ void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue) displayPreview(); } -//======================================================================= +//================================================================================= // funcion : getParameter() // purpose : -//======================================================================= +//================================================================================= double BasicGUI_PointDlg::getParameter() const { return GroupOnCurve->SpinBox_DX->GetValue(); @@ -502,7 +503,7 @@ void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt ) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); } //================================================================================= @@ -549,12 +550,14 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects ) double dy = GroupRefPoint->SpinBox_DY->GetValue(); double dz = GroupRefPoint->SpinBox_DZ->GetValue(); - anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointWithReference( myRefPoint, dx, dy, dz ); + anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )-> + MakePointWithReference( myRefPoint, dx, dy, dz ); res = true; break; } case 2 : - anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointOnCurve( myEdge, getParameter() ); + anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )-> + MakePointOnCurve( myEdge, getParameter() ); res = true; break; } @@ -592,6 +595,5 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects ) //================================================================================= void BasicGUI_PointDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index d05367203..28bf591a1 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_PointDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_POINT_H #define DIALOGBOX_POINT_H @@ -51,13 +50,14 @@ class BasicGUI_PointDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_PointDlg(); bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); }; void OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress() - + protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); @@ -71,8 +71,6 @@ private : void enterEvent(QEvent* e); double getParameter() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myEdge; GEOM::GEOM_Object_var myRefPoint; diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 416e4e0a4..5b3a61e70 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -48,15 +48,16 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_VectorDlg::BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, fl ), myGeometryGUI(theGeometryGUI) +BasicGUI_VectorDlg::BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_VECTOR_TITLE")); - + /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_VECTOR")); RadioButton1->setPixmap(image0); @@ -130,8 +131,8 @@ void BasicGUI_VectorDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -147,9 +148,9 @@ void BasicGUI_VectorDlg::Init() connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); connect(GroupDimensions->CheckBox1, SIGNAL(stateChanged(int)), this, SLOT(ReverseVector(int))); @@ -325,7 +326,7 @@ void BasicGUI_VectorDlg::ActivateThisDialog() //================================================================================= void BasicGUI_VectorDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -371,7 +372,7 @@ void BasicGUI_VectorDlg::ReverseVector(int state) //================================================================================= GEOM::GEOM_IOperations_ptr BasicGUI_VectorDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); } //================================================================================= diff --git a/src/BasicGUI/BasicGUI_VectorDlg.h b/src/BasicGUI/BasicGUI_VectorDlg.h index 8e87f2b84..b9a2cdade 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.h +++ b/src/BasicGUI/BasicGUI_VectorDlg.h @@ -24,7 +24,6 @@ // File : BasicGUI_VectorDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_VECTOR_H #define DIALOGBOX_VECTOR_H @@ -34,13 +33,13 @@ #include "DlgRef_3Spin1Check.h" #include "BasicGUI.h" -//#include "GEOM_ShapeTypeFilter.hxx" #if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS #define BASICGUI_WNT_EXPORT __declspec( dllexport ) #else #define BASICGUI_WNT_EXPORT #endif + //================================================================================= // class : BasicGUI_VectorDlg // purpose : @@ -50,9 +49,10 @@ class BasicGUI_VectorDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BasicGUI_VectorDlg(); - + protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); @@ -63,8 +63,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint1; GEOM::GEOM_Object_var myPoint2; @@ -75,7 +73,7 @@ private slots: void ClickOnOk(); void ClickOnCancel(); bool ClickOnApply(); - + void ActivateThisDialog(); void DeactivateActiveDialog(); diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx index 900955a99..064ea93a7 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx @@ -61,8 +61,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(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) +BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_WPLANE_FACE"))); @@ -124,9 +126,9 @@ void BasicGUI_WorkingPlaneDlg::Init() { /* init variables */ myEditCurrentArgument = Group1->LineEdit1; - myWPlane = myGeometryGUI->GetWorkingPlane(); + myWPlane = myGeomGUI->GetWorkingPlane(); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); myFace = GEOM::GEOM_Object::_nil(); myVectX = GEOM::GEOM_Object::_nil(); @@ -139,8 +141,8 @@ void BasicGUI_WorkingPlaneDlg::Init() /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeometryGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeometryGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); + connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); @@ -170,7 +172,7 @@ void BasicGUI_WorkingPlaneDlg::Init() void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) { disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); - // myGeometryGUI->SetState( 0 ); + // myGeomGUI->SetState( 0 ); switch (constructorId) { @@ -251,7 +253,7 @@ void BasicGUI_WorkingPlaneDlg::ClickOnOk() bool BasicGUI_WorkingPlaneDlg::ClickOnApply() { buttonApply->setFocus(); - myGeometryGUI->application()->putInfo(tr("")); + myGeomGUI->application()->putInfo(tr("")); const int id = getConstructorId(); if (id == 0) { @@ -264,8 +266,8 @@ bool BasicGUI_WorkingPlaneDlg::ClickOnApply() gp_Pln aPln = aGPlane->Pln(); myWPlane = aPln.Position(); - myGeometryGUI->SetWorkingPlane(myWPlane); - myGeometryGUI->ActiveWorkingPlane(); + myGeomGUI->SetWorkingPlane(myWPlane); + myGeomGUI->ActiveWorkingPlane(); return true; } } @@ -307,8 +309,8 @@ bool BasicGUI_WorkingPlaneDlg::ClickOnApply() myWPlane = gp_Ax3(BRep_Tool::Pnt(V1), aDirZ, aDirX); - myGeometryGUI->SetWorkingPlane(myWPlane); - myGeometryGUI->ActiveWorkingPlane(); + myGeomGUI->SetWorkingPlane(myWPlane); + myGeomGUI->ActiveWorkingPlane(); return true; } } else if (id == 2) { @@ -330,8 +332,8 @@ bool BasicGUI_WorkingPlaneDlg::ClickOnApply() myWPlane = gp_Ax3(P1, aDirZ, aDirX); - myGeometryGUI->SetWorkingPlane(myWPlane); - myGeometryGUI->ActiveWorkingPlane(); + myGeomGUI->SetWorkingPlane(myWPlane); + myGeomGUI->ActiveWorkingPlane(); return true; } return false; @@ -436,7 +438,7 @@ void BasicGUI_WorkingPlaneDlg::ActivateThisDialog( ) //================================================================================= void BasicGUI_WorkingPlaneDlg::DeactivateActiveDialog() { - // myGeometryGUI->SetState( -1 ); + // myGeomGUI->SetState( -1 ); GEOMBase_Skeleton::DeactivateActiveDialog(); } @@ -465,6 +467,5 @@ void BasicGUI_WorkingPlaneDlg::enterEvent(QEvent* e) //================================================================================= void BasicGUI_WorkingPlaneDlg::closeEvent( QCloseEvent* e ) { - // myGeometryGUI->SetState( -1 ); GEOMBase_Skeleton::closeEvent( e ); } diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h index 4ee7a785d..f9a770e66 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h @@ -38,6 +38,7 @@ #else #define BASICGUI_WNT_EXPORT #endif + //================================================================================= // class : BasicGUI_WorkingPlaneDlg // purpose : @@ -47,7 +48,8 @@ class BASICGUI_WNT_EXPORT BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton Q_OBJECT public: - BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + BasicGUI_WorkingPlaneDlg( GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~BasicGUI_WorkingPlaneDlg(); virtual void closeEvent( QCloseEvent* e ); @@ -55,8 +57,6 @@ private: void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myFace; GEOM::GEOM_Object_var myVectX; GEOM::GEOM_Object_var myVectZ; diff --git a/src/BlocksGUI/BlocksGUI.cxx b/src/BlocksGUI/BlocksGUI.cxx index 30abf2a66..a30425313 100644 --- a/src/BlocksGUI/BlocksGUI.cxx +++ b/src/BlocksGUI/BlocksGUI.cxx @@ -30,7 +30,6 @@ #include "BlocksGUI_QuadFaceDlg.h" #include "BlocksGUI_BlockDlg.h" #include "BlocksGUI_TrsfDlg.h" -//#include "BlocksGUI_CheckMultiBlockDlg.h" #include "BlocksGUI_ExplodeDlg.h" #include "BlocksGUI_PropagateDlg.h" @@ -40,6 +39,8 @@ #include "SUIT_MessageBox.h" #include "SUIT_Session.h" +#include "SalomeApp_Application.h" + BlocksGUI* BlocksGUI::myGUIObject = 0; //======================================================================= @@ -83,35 +84,13 @@ bool BlocksGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) switch (theCommandID) { - case 9999: - aDlg = new BlocksGUI_BlockDlg (parent); - break; - - case 9998: - aDlg = new BlocksGUI_TrsfDlg (parent); - break; - - case 9997: - aDlg = new BlocksGUI_QuadFaceDlg (parent); - break; - - case 9996: -// aDlg = new BlocksGUI_CheckMultiBlockDlg (parent, Sel); - SUIT_MessageBox::warn1 (parent, - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_NOT_IMPLEMENTED"), - QObject::tr("BUT_OK")); - break; - - case 9995: - aDlg = new BlocksGUI_ExplodeDlg (parent); - break; - case 99991: - aDlg = new BlocksGUI_PropagateDlg (parent, ""); - break; - + case 9999: aDlg = new BlocksGUI_BlockDlg (getGeometryGUI(), parent); break; + case 9998: aDlg = new BlocksGUI_TrsfDlg (getGeometryGUI(), parent); break; + case 9997: aDlg = new BlocksGUI_QuadFaceDlg (getGeometryGUI(), parent); break; + case 9995: aDlg = new BlocksGUI_ExplodeDlg (getGeometryGUI(), parent); break; + case 99991: aDlg = new BlocksGUI_PropagateDlg (getGeometryGUI(), parent); break; default: - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } diff --git a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx index 2d99353d7..664c97894 100644 --- a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx @@ -41,9 +41,8 @@ using namespace std; // class : BlocksGUI_BlockDlg() // purpose : Constructs a BlocksGUI_BlockDlg which is a child of 'parent'. //================================================================================= -BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (QWidget* parent, - bool modal) - : GEOMBase_Skeleton(parent, "BlockDlg", modal, +BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, "BlockDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_2F"))); @@ -329,15 +328,6 @@ void BlocksGUI_BlockDlg::enterEvent (QEvent* e) ActivateThisDialog(); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -//void BlocksGUI_BlockDlg::DeactivateActiveDialog() -//{ -// GEOMBase_Skeleton::DeactivateActiveDialog(); -//} - //================================================================================= // function : createOperation // purpose : diff --git a/src/BlocksGUI/BlocksGUI_BlockDlg.h b/src/BlocksGUI/BlocksGUI_BlockDlg.h index 567538c32..efc266976 100644 --- a/src/BlocksGUI/BlocksGUI_BlockDlg.h +++ b/src/BlocksGUI/BlocksGUI_BlockDlg.h @@ -23,7 +23,6 @@ // File : BlocksGUI_BlockDlg.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BLOCK_H #define DIALOGBOX_BLOCK_H @@ -42,7 +41,7 @@ class BlocksGUI_BlockDlg : public GEOMBase_Skeleton Q_OBJECT public: - BlocksGUI_BlockDlg (QWidget* parent, + BlocksGUI_BlockDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal = FALSE); ~BlocksGUI_BlockDlg(); @@ -69,7 +68,6 @@ private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); -// void DeactivateActiveDialog(); void ConstructorsClicked (int constructorId); void SelectionIntoArgument(); diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx index 9d6180cb8..9aec37ed7 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx @@ -50,9 +50,8 @@ // class : BlocksGUI_ExplodeDlg() // purpose : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'. //================================================================================= -BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg (QWidget* parent, - bool modal) - : GEOMBase_Skeleton(parent, "ExplodeDlg", modal, +BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, "ExplodeDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BLOCK_EXPLODE"))); diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h index 7c83e73bf..1edd3f389 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h @@ -23,7 +23,6 @@ // File : BlocksGUI_ExplodeDlg.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BLOCK_EXPLODE_H #define DIALOGBOX_BLOCK_EXPLODE_H @@ -43,8 +42,7 @@ class BlocksGUI_ExplodeDlg : public GEOMBase_Skeleton Q_OBJECT public: - BlocksGUI_ExplodeDlg (QWidget* parent, - bool modal = FALSE); + BlocksGUI_ExplodeDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); ~BlocksGUI_ExplodeDlg(); protected: diff --git a/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx b/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx index e20031736..809bf154a 100644 --- a/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_PropagateDlg.cxx @@ -46,8 +46,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BlocksGUI_PropagateDlg::BlocksGUI_PropagateDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BlocksGUI_PropagateDlg::BlocksGUI_PropagateDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PROPAGATE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -74,13 +76,12 @@ BlocksGUI_PropagateDlg::BlocksGUI_PropagateDlg(QWidget* parent, const char* name Layout1->addWidget(aMainGrp, 1, 0); /***************************************************************/ - + setHelpFileName("propagate.htm"); - + Init(); } - //================================================================================= // function : ~BlocksGUI_PropagateDlg() // purpose : Destroys the object and frees any allocated resources @@ -89,7 +90,6 @@ BlocksGUI_PropagateDlg::~BlocksGUI_PropagateDlg() { } - //================================================================================= // function : Init() // purpose : @@ -104,10 +104,6 @@ void BlocksGUI_PropagateDlg::Init() //myGeomGUI->SetState( 0 ); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -128,8 +124,6 @@ void BlocksGUI_PropagateDlg::ClickOnOk() ClickOnCancel(); } - - //================================================================================= // function : ClickOnApply() // purpose : @@ -150,16 +144,6 @@ bool BlocksGUI_PropagateDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void BlocksGUI_PropagateDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection @@ -205,17 +189,6 @@ void BlocksGUI_PropagateDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void BlocksGUI_PropagateDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : @@ -318,4 +291,3 @@ GEOM::GEOM_Object_ptr BlocksGUI_PropagateDlg::getFather (GEOM::GEOM_Object_ptr) { return myObject; } - diff --git a/src/BlocksGUI/BlocksGUI_PropagateDlg.h b/src/BlocksGUI/BlocksGUI_PropagateDlg.h index db860194b..8082be70e 100644 --- a/src/BlocksGUI/BlocksGUI_PropagateDlg.h +++ b/src/BlocksGUI/BlocksGUI_PropagateDlg.h @@ -24,7 +24,6 @@ // File : BlocksGUI_PropagateDlg.h // Author : VKN // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BlocksGUI_PropagateDlg_H #define DIALOGBOX_BlocksGUI_PropagateDlg_H @@ -41,7 +40,8 @@ class BlocksGUI_PropagateDlg : public GEOMBase_Skeleton Q_OBJECT public: - BlocksGUI_PropagateDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BlocksGUI_PropagateDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = "", bool modal = FALSE, WFlags fl = 0); ~BlocksGUI_PropagateDlg(); protected: @@ -54,27 +54,23 @@ protected: private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); void activateSelection(); -private : - +private: GEOM::GEOM_Object_var myObject; QPushButton* mySelBtn; QLineEdit* mySelName; - }; #endif // DIALOGBOX_BlocksGUI_PropagateDlg_H diff --git a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx index fd7fe35dd..f9c320796 100644 --- a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx @@ -32,23 +32,21 @@ #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -//using namespace std; - #include //================================================================================= // class : BlocksGUI_QuadFaceDlg() // purpose : Constructs a BlocksGUI_QuadFaceDlg which is a child of 'parent'. //================================================================================= -BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (QWidget* parent, - bool modal) - : GEOMBase_Skeleton(parent, "QuadFaceDlg", modal, +BlocksGUI_QuadFaceDlg::BlocksGUI_QuadFaceDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, "QuadFaceDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_VERT"))); - QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_2_EDGE"))); - QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_EDGE"))); - QPixmap imageS (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image1 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_VERT"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_2_EDGE"))); + QPixmap image3 (aResMgr->loadPixmap("GEOM",tr("ICON_DLG_QUAD_FACE_4_EDGE"))); + QPixmap imageS (aResMgr->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_QUAD_FACE_TITLE")); diff --git a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.h b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.h index 0df8ae01c..652d34b18 100644 --- a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.h +++ b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.h @@ -23,7 +23,6 @@ // File : BlocksGUI_QuadFaceDlg.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef DIALOGBOX_QUAD_FACE_H #define DIALOGBOX_QUAD_FACE_H @@ -43,15 +42,14 @@ class BlocksGUI_QuadFaceDlg : public GEOMBase_Skeleton Edge14, Edge24, Edge34, Edge44 }; public: - BlocksGUI_QuadFaceDlg (QWidget* parent, - bool modal = FALSE); + BlocksGUI_QuadFaceDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); ~BlocksGUI_QuadFaceDlg(); protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid (QString& msg); - virtual bool execute (ObjectList& objects); + virtual bool isValid (QString& msg); + virtual bool execute (ObjectList& objects); private: void Init(); @@ -79,7 +77,6 @@ private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); -// void DeactivateActiveDialog(); void ConstructorsClicked( int constructorId ); void SelectionIntoArgument(); diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index 0a2baf0a7..a431b4129 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -42,14 +42,14 @@ // class : BlocksGUI_TrsfDlg() // purpose : Constructs a BlocksGUI_TrsfDlg which is a child of 'parent'. //================================================================================= -BlocksGUI_TrsfDlg::BlocksGUI_TrsfDlg (QWidget* parent, - bool modal) - : GEOMBase_Skeleton(parent, "TrsfDlg", modal, +BlocksGUI_TrsfDlg::BlocksGUI_TrsfDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, "TrsfDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BLOCK_MULTITRSF_SIMPLE"))); - QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BLOCK_MULTITRSF_DOUBLE"))); - QPixmap imageS (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_SIMPLE"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_DOUBLE"))); + QPixmap imageS (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); setCaption(tr("GEOM_BLOCK_MULTITRSF_TITLE")); @@ -349,16 +349,6 @@ void BlocksGUI_TrsfDlg::enterEvent (QEvent* e) this->ActivateThisDialog(); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -//void BlocksGUI_TrsfDlg::DeactivateActiveDialog() -//{ -// // disconnect selection -// GEOMBase_Skeleton::DeactivateActiveDialog(); -//} - //================================================================================= // function : ValueChangedInSpinBox() // purpose : diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.h b/src/BlocksGUI/BlocksGUI_TrsfDlg.h index a5bdc30d6..7c672b5ca 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.h +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.h @@ -23,7 +23,6 @@ // File : BlocksGUI_TrsfDlg.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BLOCK_MULTITRSF_H #define DIALOGBOX_BLOCK_MULTITRSF_H @@ -44,8 +43,7 @@ class BlocksGUI_TrsfDlg : public GEOMBase_Skeleton enum { SpinBox1, SpinBox2U, SpinBox2V }; public: - BlocksGUI_TrsfDlg (QWidget* parent, - bool modal = FALSE); + BlocksGUI_TrsfDlg (GeometryGUI*, QWidget* parent, bool modal = FALSE); ~BlocksGUI_TrsfDlg(); protected: @@ -79,7 +77,6 @@ private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); -// void DeactivateActiveDialog(); void ConstructorsClicked (int constructorId); void SelectionIntoArgument(); diff --git a/src/BooleanGUI/BooleanGUI.cxx b/src/BooleanGUI/BooleanGUI.cxx index 5f0865f6c..ecda41b9a 100644 --- a/src/BooleanGUI/BooleanGUI.cxx +++ b/src/BooleanGUI/BooleanGUI.cxx @@ -89,7 +89,7 @@ bool BooleanGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) else return false; - QDialog* aDlg = new BooleanGUI_Dialog( anOperation, parent, ""); + QDialog* aDlg = new BooleanGUI_Dialog( anOperation, getGeometryGUI(), parent, ""); aDlg->show(); return true; diff --git a/src/BooleanGUI/BooleanGUI_Dialog.cxx b/src/BooleanGUI/BooleanGUI_Dialog.cxx index 1ca3d0df3..2e8633adb 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.cxx +++ b/src/BooleanGUI/BooleanGUI_Dialog.cxx @@ -45,8 +45,9 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, fl), +BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGeometryGUI, + QWidget* parent, const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl), myOperation( theOperation ) { QPixmap image0; @@ -123,7 +124,6 @@ BooleanGUI_Dialog::~BooleanGUI_Dialog() } - //================================================================================= // function : Init() // purpose : @@ -220,7 +220,6 @@ void BooleanGUI_Dialog::SetEditCurrentArgument() } - //================================================================================= // function : LineEditReturnPressed() // purpose : diff --git a/src/BooleanGUI/BooleanGUI_Dialog.h b/src/BooleanGUI/BooleanGUI_Dialog.h index 70f6c4b75..bbf0ac580 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.h +++ b/src/BooleanGUI/BooleanGUI_Dialog.h @@ -24,7 +24,6 @@ // File : BooleanGUI_Dialog.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef BooleanGUI_Dialog_H #define BooleanGUI_Dialog_H @@ -42,7 +41,8 @@ class BooleanGUI_Dialog : public GEOMBase_Skeleton Q_OBJECT public: - BooleanGUI_Dialog( const int theOperation, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BooleanGUI_Dialog(); protected: @@ -69,7 +69,6 @@ private slots: void SelectionIntoArgument(); void LineEditReturnPressed(); void ActivateThisDialog(); - }; #endif // BooleanGUI_Dialog_H diff --git a/src/BuildGUI/BuildGUI.cxx b/src/BuildGUI/BuildGUI.cxx index bb0c98a2c..3e2d48c46 100644 --- a/src/BuildGUI/BuildGUI.cxx +++ b/src/BuildGUI/BuildGUI.cxx @@ -85,12 +85,12 @@ bool BuildGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) switch ( theCommandID ) { - case 4081: aDlg = new BuildGUI_EdgeDlg ( parent, "" ); break; - case 4082: aDlg = new BuildGUI_WireDlg ( parent, "" ); break; - case 4083: aDlg = new BuildGUI_FaceDlg ( parent, "" ); break; - case 4084: aDlg = new BuildGUI_ShellDlg ( parent, "" ); break; - case 4085: aDlg = new BuildGUI_SolidDlg ( parent, "" ); break; - case 4086: aDlg = new BuildGUI_CompoundDlg( parent, "" ); break; + case 4081: aDlg = new BuildGUI_EdgeDlg ( getGeometryGUI(), parent, "" ); break; + case 4082: aDlg = new BuildGUI_WireDlg ( getGeometryGUI(), parent, "" ); break; + case 4083: aDlg = new BuildGUI_FaceDlg ( getGeometryGUI(), parent, "" ); break; + case 4084: aDlg = new BuildGUI_ShellDlg ( getGeometryGUI(), parent, "" ); break; + case 4085: aDlg = new BuildGUI_SolidDlg ( getGeometryGUI(), parent, "" ); break; + case 4086: aDlg = new BuildGUI_CompoundDlg( getGeometryGUI(), parent, "" ); break; default: SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.cxx b/src/BuildGUI/BuildGUI_CompoundDlg.cxx index a1f9686d1..53e0d07ca 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.cxx +++ b/src/BuildGUI/BuildGUI_CompoundDlg.cxx @@ -42,8 +42,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_CompoundDlg::BuildGUI_CompoundDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_CompoundDlg::BuildGUI_CompoundDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_COMPOUND"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.h b/src/BuildGUI/BuildGUI_CompoundDlg.h index eef0b2fb1..6139a57a7 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.h +++ b/src/BuildGUI/BuildGUI_CompoundDlg.h @@ -24,7 +24,6 @@ // File : GEOMBase_CompoundDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_COMPOUND_H #define DIALOGBOX_COMPOUND_H @@ -41,7 +40,8 @@ class BuildGUI_CompoundDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_CompoundDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_CompoundDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_CompoundDlg(); protected: @@ -65,7 +65,6 @@ private slots: void ActivateThisDialog(); void SelectionIntoArgument(); void SetEditCurrentArgument(); - }; #endif // DIALOGBOX_COMPOUND_H diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.cxx b/src/BuildGUI/BuildGUI_EdgeDlg.cxx index 8472fa8c1..61ede1319 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.cxx +++ b/src/BuildGUI/BuildGUI_EdgeDlg.cxx @@ -47,8 +47,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_EdgeDlg::BuildGUI_EdgeDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_EdgeDlg::BuildGUI_EdgeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_EDGE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.h b/src/BuildGUI/BuildGUI_EdgeDlg.h index 2d3af1aba..241ff4616 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.h +++ b/src/BuildGUI/BuildGUI_EdgeDlg.h @@ -24,7 +24,6 @@ // File : BuildGUI_EdgeDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_EDGE_H #define DIALOGBOX_EDGE_H @@ -41,7 +40,8 @@ class BuildGUI_EdgeDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_EdgeDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_EdgeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_EdgeDlg(); protected: @@ -50,7 +50,7 @@ protected: virtual bool isValid( QString& msg ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); @@ -67,7 +67,6 @@ private slots: void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); - }; #endif // DIALOGBOX_EDGE_H diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index c974b1823..9ec5ff6c8 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -46,8 +46,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_FaceDlg::BuildGUI_FaceDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_FaceDlg::BuildGUI_FaceDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_FACE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_FaceDlg.h b/src/BuildGUI/BuildGUI_FaceDlg.h index f59189fd6..9caf4e7c2 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.h +++ b/src/BuildGUI/BuildGUI_FaceDlg.h @@ -24,7 +24,6 @@ // File : BuildGUI_FaceDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_FACE_H #define DIALOGBOX_FACE_H @@ -41,7 +40,8 @@ class BuildGUI_FaceDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_FaceDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_FaceDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_FaceDlg(); protected: @@ -64,7 +64,6 @@ private slots: void ActivateThisDialog(); void SelectionIntoArgument(); void SetEditCurrentArgument(); - }; #endif // DIALOGBOX_FACE_H diff --git a/src/BuildGUI/BuildGUI_ShellDlg.cxx b/src/BuildGUI/BuildGUI_ShellDlg.cxx index 8b4a10dad..31984a38b 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.cxx +++ b/src/BuildGUI/BuildGUI_ShellDlg.cxx @@ -24,7 +24,7 @@ // File : BuildGUI_ShellDlg.cxx // Author : Damien COQUERET // Module : GEOM -// $Header: +// $Header$ #include "BuildGUI_ShellDlg.h" #include "GEOMImpl_Types.hxx" @@ -44,8 +44,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_ShellDlg::BuildGUI_ShellDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_ShellDlg::BuildGUI_ShellDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SHELL"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_ShellDlg.h b/src/BuildGUI/BuildGUI_ShellDlg.h index 345fa7519..edfe6a567 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.h +++ b/src/BuildGUI/BuildGUI_ShellDlg.h @@ -24,7 +24,6 @@ // File : BuildGUI_ShellDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header: #ifndef DIALOGBOX_SHELL_H #define DIALOGBOX_SHELL_H @@ -41,7 +40,8 @@ class BuildGUI_ShellDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_ShellDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_ShellDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_ShellDlg(); protected: @@ -65,7 +65,6 @@ private slots: void SetEditCurrentArgument(); void SelectionIntoArgument(); void ActivateThisDialog(); - }; #endif // DIALOGBOX_SHELL_H diff --git a/src/BuildGUI/BuildGUI_SolidDlg.cxx b/src/BuildGUI/BuildGUI_SolidDlg.cxx index 61b357fa7..e8800edc3 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.cxx +++ b/src/BuildGUI/BuildGUI_SolidDlg.cxx @@ -24,7 +24,7 @@ // File : BuildGUI_SolidDlg.cxx // Author : Damien COQUERET // Module : GEOM -// $Header: +// $Header$ #include "BuildGUI_SolidDlg.h" #include "GEOMImpl_Types.hxx" @@ -44,8 +44,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_SolidDlg::BuildGUI_SolidDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_SolidDlg::BuildGUI_SolidDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_SOLID"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_SolidDlg.h b/src/BuildGUI/BuildGUI_SolidDlg.h index c85fef588..0402ad1cc 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.h +++ b/src/BuildGUI/BuildGUI_SolidDlg.h @@ -24,7 +24,6 @@ // File : BuildGUI_SolidDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header: #ifndef DIALOGBOX_SOLID_H #define DIALOGBOX_SOLID_H @@ -41,7 +40,8 @@ class BuildGUI_SolidDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_SolidDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_SolidDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_SolidDlg(); protected: @@ -67,7 +67,6 @@ private slots: void SelectionIntoArgument(); void ActivateThisDialog(); void EnableNameField(bool toEnable); - }; #endif // DIALOGBOX_SOLID_H diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index 1f20514cc..f1b23af51 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -44,8 +44,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -BuildGUI_WireDlg::BuildGUI_WireDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +BuildGUI_WireDlg::BuildGUI_WireDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_WIRE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); diff --git a/src/BuildGUI/BuildGUI_WireDlg.h b/src/BuildGUI/BuildGUI_WireDlg.h index 2f53e2534..27ba3fb40 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.h +++ b/src/BuildGUI/BuildGUI_WireDlg.h @@ -24,7 +24,6 @@ // File : BuildGUI_WireDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_WIRE_H #define DIALOGBOX_WIRE_H @@ -41,7 +40,8 @@ class BuildGUI_WireDlg : public GEOMBase_Skeleton Q_OBJECT public: - BuildGUI_WireDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + BuildGUI_WireDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~BuildGUI_WireDlg(); protected: @@ -65,7 +65,6 @@ private slots: void ActivateThisDialog(); void SelectionIntoArgument(); void SetEditCurrentArgument(); - }; #endif // DIALOGBOX_WIRE_H diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index 82fa8a094..f3e695e6d 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -35,10 +35,8 @@ #include "SUIT_ViewWindow.h" #include "OCCViewer_ViewModel.h" #include "OCCViewer_ViewManager.h" -//#include "SVTK_ViewModel.h" #include "SalomeApp_Study.h" #include "SalomeApp_Tools.h" -//#include "SALOMEGUI_ImportOperation.h" #include #include @@ -73,14 +71,10 @@ EntityGUI* EntityGUI::GetEntityGUI( GeometryGUI* parent ) //======================================================================= EntityGUI::EntityGUI( GeometryGUI* parent ) : GEOMGUI( parent ) { - myGeomBase = new GEOMBase(); - myGeom = GEOM::GEOM_Gen::_duplicate( GeometryGUI::GetGeomGen() ); - mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); mySimulationShape2 = new AIS_Shape(TopoDS_Shape()); } - //======================================================================= // function : ~EntityGUI() // purpose : Destructor @@ -106,7 +100,7 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) aDlg = new EntityGUI_SketcherDlg(getGeometryGUI(), parent, ""); break; case 407: // EXPLODE : use ic - aDlg = new EntityGUI_SubShapeDlg(parent, ""); + aDlg = new EntityGUI_SubShapeDlg(getGeometryGUI(), parent, ""); break; default: SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); @@ -114,35 +108,8 @@ bool EntityGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) } if ( aDlg ) aDlg->show(); - - return true; -} - - -//======================================================================= -// function : OnSketchEnd() -// purpose : -//======================================================================= -void EntityGUI::OnSketchEnd(const char *Cmd) -{ - /* QAD_Application::getDesktop()->putInfo("Create sketch functionality is NOT implemented in new GEOM kernel - (no such Corba interface method). Waiting for SRN to create it..."); - try { - GEOM::GEOM_Shape_var result = myGeom->MakeSketcher(Cmd); - if(result->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE")); - return; - } - result->NameType(tr("GEOM_WIRE")); - if(myGeomBase->Display(result)) - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - */ - return; + return true; } @@ -152,20 +119,19 @@ void EntityGUI::OnSketchEnd(const char *Cmd) //===================================================================================== void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2) { - //NRI DEBUG : 14/02/2002 - if( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() - != OCCViewer_Viewer::Type() ) + SUIT_ViewManager* aVM = + SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager(); + if (aVM->getType() != OCCViewer_Viewer::Type()) return; - OCCViewer_Viewer* v3d = - ((OCCViewer_ViewManager*)(SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()))->getOCCViewer(); + OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)aVM)->getOCCViewer(); Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); try { - if(!S1.IsNull()) { + if (!S1.IsNull()) { /* erase any previous */ ic->Erase(mySimulationShape1, Standard_True, Standard_False); ic->ClearPrs(mySimulationShape1); - + mySimulationShape1 = new AIS_Shape(TopoDS_Shape()); mySimulationShape1->Set(S1); mySimulationShape1->SetColor(Quantity_NOC_RED); @@ -174,7 +140,7 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap ic->Display(mySimulationShape1, Standard_False); mySimulationShape1->UnsetColor(); } - if(!S2.IsNull()) { + if (!S2.IsNull()) { ic->Erase(mySimulationShape2, Standard_True, Standard_False); ic->ClearPrs(mySimulationShape2); @@ -194,7 +160,6 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap return; } - //================================================================================== // function : EraseSimulationShape() // purpose : Clears the display of 'mySimulationShape' a pure graphical shape @@ -229,7 +194,8 @@ void EntityGUI::EraseSimulationShape() //===================================================================================== bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR) { - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + SalomeApp_Study* appStudy = dynamic_cast + ( SUIT_Session::session()->activeApplication()->activeStudy() ); if ( !appStudy ) return false; _PTR(Study) aStudy = appStudy->studyDS(); _PTR(ChildIterator) it ( aStudy->NewChildIterator(theFatherObject) ); @@ -254,416 +220,6 @@ bool EntityGUI::SObjectExist(const _PTR(SObject)& theFatherObject, const char* I } -//===================================================================================== -// function : OnSubShapeGetAll() -// purpose : Explode a shape in all sub shapes with a SubShapeType -//===================================================================================== -bool EntityGUI::OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType) -{ - SUIT_Session::session()->activeApplication()->putInfo("OnSubShapeGetAll method from EntityGUI should be reimplemented ..."); - /* - SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument(); - SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR); - if(theObj->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")); - return false; - } - - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry()); - SALOMEDS::GenericAttribute_var anAttr; - SALOMEDS::AttributeName_var aName; - SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::AttributePixMap_var aPixmap; - - // We create a sub object for each sub shape as attribute of the main object - // Each sub object contains list (length=1) containing its index in the main shape - GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(ShapeTopoIOR); - GEOM::GEOM_Gen::ListOfGeomShapes_var listGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes; - GEOM::GEOM_Shape_var aResult; - - try { - listGeomShapes = myGeom->SubShapeAll(aShape, SubShapeType); - if(listGeomShapes->length() < 1) { - QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT")); - return false; - } - } - catch(const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - - // open transaction - QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy()); - op->start(); - - TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape); - TopoDS_Shape mainShape; - bool main = false; - while(!main) { - if(aShape->IsMainShape()) { - mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape); - main = true; - } - else - aShape = myGeom->GetIORFromString(aShape->MainName()); - } - - // Loop on each sub shape created - // int i = 1 ; index for the nameType - for(int j=0; jlength(); j++) { - // Get each sub shape extracted CORBA and OCC - aResult = listGeomShapes[j] ; - TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, aResult); - - if (S.IsNull()) { - QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_ABORT")); - return false; - } - - // Set the nameType of sub shape - char* nameG = (char *)malloc(20); - Standard_CString Type; - if(myGeomBase->GetShapeTypeString(S, Type)) { - aResult->NameType(Type); - sprintf(nameG, "%s_%d", Type, myGeomBase->GetIndex(S, mainShape, SubShapeType)); - } - else { - aResult->NameType(tr("GEOM_SHAPE")); - sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); - } - SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name()); - - bool allreadyexist = false; - - if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) { - OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); - Handle (AIS_InteractiveContext) ic = v3d->getAISContext(); - - Handle(GEOM_AISShape) result = new GEOM_AISShape(S, nameG); - Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); - - MESSAGE ("SO->_is_nil() " << SO->_is_nil()) - - if(SO->_is_nil()) { - SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj); - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(nameG); - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(aResult->Name()); - - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - MESSAGE(" Type " << S.ShapeType()) - if (S.ShapeType() == TopAbs_COMPOUND) - aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND"); - else if(S.ShapeType() == TopAbs_COMPSOLID) - aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID"); - else if(S.ShapeType() == TopAbs_SOLID) - aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID"); - else if(S.ShapeType() == TopAbs_SHELL) - aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL"); - else if(S.ShapeType() == TopAbs_FACE) - aPixmap->SetPixMap("ICON_OBJBROWSER_FACE"); - else if(S.ShapeType() == TopAbs_WIRE) - aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE"); - else if(S.ShapeType() == TopAbs_EDGE) - aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE"); - else if(S.ShapeType() == TopAbs_VERTEX) - aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX"); - - MESSAGE(" aPixmap->GetPixMap " << aPixmap->GetPixMap()) - - SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF); - aStudyBuilder->Addreference(newObj1, newObj); - IO->setEntry(newObj->GetID()); - - aResult->StudyShapeId(newObj->GetID()); - } - else { - allreadyexist = true; - if(!this->SObjectExist(theObj, aResult->Name())) { - SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj); - aStudyBuilder->Addreference(newObj1, SO); - IO->setEntry(SO->GetID()); - aResult->StudyShapeId(SO->GetID()); - } - } - - result->setIO(IO); - result->setName(nameG); - if(!allreadyexist) - ic->Display(result); - - } - else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) { - SVTK_ViewFrame* vf = dynamic_cast( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame() ); - SVTK_RenderWindowInteractor* myRenderInter= vf ? vf->getRWInteractor() : 0; - - int themode = myRenderInter->GetDisplayMode(); - vtkRenderer *theRenderer = vf->getRenderer(); - vtkRenderWindow *renWin = theRenderer->GetRenderWindow(); - - Handle(GEOM_InteractiveObject) IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); - - if(SO->_is_nil()) { - SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj); - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"); - anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - anIOR->SetValue(aResult->Name()); - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName"); - aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(nameG); - - anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap"); - aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); - if(S.ShapeType() == TopAbs_COMPOUND) - aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND"); - else if(S.ShapeType() == TopAbs_COMPSOLID) - aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID"); - else if(S.ShapeType() == TopAbs_SOLID) - aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID"); - else if(S.ShapeType() == TopAbs_SHELL) - aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL"); - else if(S.ShapeType() == TopAbs_FACE) - aPixmap->SetPixMap("ICON_OBJBROWSER_FACE"); - else if(S.ShapeType() == TopAbs_WIRE) - aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE"); - else if(S.ShapeType() == TopAbs_EDGE) - aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE"); - else if(S.ShapeType() == TopAbs_VERTEX) - aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX"); - - SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF); - aStudyBuilder->Addreference(newObj1, newObj); - IO->setEntry(newObj->GetID()); - } - else { - allreadyexist = true; - if(!this->SObjectExist(theObj, aResult->Name())) { - SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj); - aStudyBuilder->Addreference(newObj1, SO); - IO->setEntry(SO->GetID()); - } - } - - if(!allreadyexist) { - vtkActorCollection* theActors = GEOM_AssemblyBuilder::BuildActors(S,0,themode,Standard_True); - theActors->InitTraversal(); - vtkActor* anActor = (vtkActor*)theActors->GetNextActor(); - while(!(anActor==NULL)) { - GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor); - GActor->setIO(IO); - GActor->setName(nameG); - theRenderer->AddActor(GActor); - renWin->Render(); - anActor = (vtkActor*)theActors->GetNextActor(); - } - } - } - } - - // commit transaction - op->finish(); - - QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(); - QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY")); - */ - return true; -} - - -//===================================================================================== -// function : OnSubShapeGetSelected() -// purpose : -//===================================================================================== -bool EntityGUI::OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, Standard_Integer& aLocalContextId, bool& myUseLocalContext) -{ - SUIT_Session::session()->activeApplication()->putInfo("OnSubShapeGetSelected method from EntityGUI should be reimplemented ..."); - // //* Test the type of viewer */ -// if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC) -// return false; - -// SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument(); -// SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(ShapeTopoIOR); -// if(theObj->_is_nil()) { -// QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY")); -// return false; -// } - -// OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer(); -// Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); - -// if( myUseLocalContext == false ) { -// /* local context is from DialogBox */ -// MESSAGE("Error : No local context opened for sub shapes method" << endl ) ; -// return false ; -// } - -// GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString( ShapeTopoIOR ); -// TopoDS_Shape mainTopo = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape); - -// TopoDS_Shape mainShape; -// bool main = false; -// while(!main) { -// if(aShape->IsMainShape()) { -// mainShape = myGeomGUI->GetShapeReader().GetShape(myGeom, aShape); -// main = true; -// } -// else -// aShape = myGeom->GetIORFromString(aShape->MainName()); -// } - -// GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID; -// ic->InitSelected(); -// int nbSelected = ic->NbSelected(); -// ListOfID->length(nbSelected); - -// TopoDS_Compound compound; -// ic->InitSelected(); /* to init again */ -// BRep_Builder B; -// B.MakeCompound(compound); - -// int i = 0; -// /* We create a unique compound containing all the sub shapes selected by user as attribute of the main shape */ -// /* the compound is homogenous by selection */ -// while(ic->MoreSelected()) { -// int index = myGeomBase->GetIndex(ic->SelectedShape(), mainShape, SubShapeType); -// ListOfID[i] = index; -// B.Add(compound, ic->SelectedShape()); -// i++; -// ic->NextSelected(); -// } - -// /* Test if user has selected sub shapes */ -// if(ListOfID->length() < 1) -// return false; - -// GEOM::GEOM_Shape_var aResult; -// try { -// aResult = myGeom->SubShape(aShape, SubShapeType, ListOfID); -// } -// catch (const SALOME::SALOME_Exception& S_ex) { -// SalomeApp_Tools::QtCatchCorbaException(S_ex); -// } - -// /* local context from DialogBox */ -// ic->CloseLocalContext(aLocalContextId); -// myUseLocalContext = false ; - -// char* nameG = (char *)malloc(20); -// Standard_CString Type; - -// Handle(GEOM_AISShape) result; -// Handle(GEOM_InteractiveObject) IO; - -// if(nbSelected == 1) { -// TopExp_Explorer Exp (compound, TopAbs_ShapeEnum(SubShapeType)); -// if(Exp.More()) { -// if(myGeomBase->GetShapeTypeString(Exp.Current(),Type)) { -// aResult->NameType(Type); -// sprintf (nameG, "%s_%d", Type, myGeomBase->GetIndex( Exp.Current(), mainTopo, SubShapeType)); -// } -// else { -// aResult->NameType(tr("GEOM_SHAPE")); -// sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); -// } -// result = new GEOM_AISShape(Exp.Current(), nameG); -// IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); -// } -// } -// else { -// if ( myGeomBase->GetShapeTypeString(compound,Type)) { -// aResult->NameType(Type); -// sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++); -// } else { -// aResult->NameType(tr("GEOM_SHAPE")); -// sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++); -// } -// result = new GEOM_AISShape(compound, nameG); -// IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM"); -// } - -// SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name()); - -// /* open transaction */ -// QAD_Operation* op = new SALOMEGUI_ImportOperation(QAD_Application::getDesktop()->getActiveStudy()); -// op->start(); - -// SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); -// SALOMEDS::SObject_var fatherSF = aStudy->FindObjectID(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->entry()); -// SALOMEDS::GenericAttribute_var anAttr; -// SALOMEDS::AttributeName_var aName; -// SALOMEDS::AttributeIOR_var anIOR; -// SALOMEDS::AttributePixMap_var aPixmap; - -// bool allreadyexist = false; - -// if(SO->_is_nil()) { -// SALOMEDS::SObject_var newObj = aStudyBuilder->NewObject(theObj); -// anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"); -// anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); -// anIOR->SetValue(aResult->Name()); -// anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName"); -// aName = SALOMEDS::AttributeName::_narrow(anAttr); -// aName->SetValue(result->getName()); - -// anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePixMap"); -// aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); -// if(result->Shape().ShapeType() == TopAbs_COMPOUND) -// aPixmap->SetPixMap("ICON_OBJBROWSER_COMPOUND"); -// else if(result->Shape().ShapeType() == TopAbs_COMPSOLID) -// aPixmap->SetPixMap("ICON_OBJBROWSER_COMPSOLID"); -// else if(result->Shape().ShapeType() == TopAbs_SOLID) -// aPixmap->SetPixMap("ICON_OBJBROWSER_SOLID"); -// else if(result->Shape().ShapeType() == TopAbs_SHELL) -// aPixmap->SetPixMap("ICON_OBJBROWSER_SHELL"); -// else if(result->Shape().ShapeType() == TopAbs_FACE) -// aPixmap->SetPixMap("ICON_OBJBROWSER_FACE"); -// else if(result->Shape().ShapeType() == TopAbs_WIRE) -// aPixmap->SetPixMap("ICON_OBJBROWSER_WIRE"); -// else if(result->Shape().ShapeType() == TopAbs_EDGE) -// aPixmap->SetPixMap("ICON_OBJBROWSER_EDGE"); -// else if(result->Shape().ShapeType() == TopAbs_VERTEX) -// aPixmap->SetPixMap("ICON_OBJBROWSER_VERTEX"); - -// SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(fatherSF); -// aStudyBuilder->Addreference(newObj1, newObj); - -// IO->setEntry(newObj->GetID()); -// aResult->StudyShapeId(newObj->GetID()); -// } -// else { -// allreadyexist = true; -// if(!this->SObjectExist(theObj, aResult->Name())) { -// SALOMEDS::SObject_var newObj1 = aStudyBuilder->NewObject(theObj); -// aStudyBuilder->Addreference(newObj1, SO); - -// IO->setEntry(SO->GetID()); -// aResult->StudyShapeId(SO->GetID()); -// } -// } - -// /* commit transaction */ -// op->finish(); - -// result->setIO(IO); -// result->setName(nameG); - -// if(!allreadyexist) -// ic->Display(result); - -// DisplayGUI* myDisplayGUI = new DisplayGUI(); -// myDisplayGUI->OnDisplayAll(true); - -// QAD_Application::getDesktop()->getActiveStudy()->updateObjBrowser(); -// QAD_Application::getDesktop()->putInfo (tr("GEOM_PRP_READY")); - return true; -} - - //===================================================================================== // EXPORTED METHODS //===================================================================================== diff --git a/src/EntityGUI/EntityGUI.h b/src/EntityGUI/EntityGUI.h index fe2f7d816..be82e32fc 100644 --- a/src/EntityGUI/EntityGUI.h +++ b/src/EntityGUI/EntityGUI.h @@ -24,16 +24,17 @@ // File : EntityGUI.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef ENTITYGUI_H #define ENTITYGUI_H #include "GEOMGUI.h" -#include "GEOMBase.h" #include "SALOMEDSClient.hxx" +#include +#include + //================================================================================= // class : EntityGUI // purpose : @@ -51,29 +52,18 @@ public : bool OnGUIEvent(int theCommandID, SUIT_Desktop* parent); - void OnSketchEnd(const char *Cmd); - void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2); void EraseSimulationShape(); - void MakeInterpolAndDisplay(GEOM::string_array& listShapesIOR); - void MakeBezierAndDisplay(GEOM::string_array& listShapesIOR); - - /* Methods for sub shapes explode */ + // Methods for sub shapes explode bool SObjectExist(const _PTR(SObject)& theFatherObject, const char* IOR); - bool OnSubShapeGetAll(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType); - bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType, - Standard_Integer& aLocalContextId, bool& myUseLocalContext); - /* AIS shape used only during topo/geom simulations */ + // AIS shape used only during topo/geom simulations Handle(AIS_Shape) mySimulationShape1; Handle(AIS_Shape) mySimulationShape2; - GEOMBase* myGeomBase; - GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */ - private: - static EntityGUI* myGUIObject; // the only EntityGUI object + static EntityGUI* myGUIObject; //!< the only EntityGUI object }; #endif diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 4e021b2f3..6a7d7e679 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -29,6 +29,7 @@ #include "EntityGUI_SketcherDlg.h" #include "Sketcher_Profile.hxx" #include "GEOM_Displayer.h" +#include "GEOMBase.h" #include "SUIT_Desktop.h" #include "SUIT_Session.h" @@ -62,8 +63,11 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, const char* name, bool modal, WFlags fl) - :EntityGUI_Skeleton_QTD(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), myIsAllAdded( false ), +EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :EntityGUI_Skeleton_QTD(parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), + myIsAllAdded( false ), GEOMBase_Helper( dynamic_cast( parent ) ), myGeometryGUI( GUI ) { diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.h b/src/EntityGUI/EntityGUI_SketcherDlg.h index c9702e5b1..0d6956f48 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.h +++ b/src/EntityGUI/EntityGUI_SketcherDlg.h @@ -24,7 +24,6 @@ // File : EntityGUI_SketcherDlg.h // Author : Damine COQUERET // Module : GEOM -// $Header: #ifndef ENTITYGUI_SKETCHERDLG_H #define ENTITYGUI_SKETCHERDLG_H @@ -63,7 +62,8 @@ class EntityGUI_SketcherDlg : public EntityGUI_Skeleton_QTD, public GEOMBase_Hel Q_OBJECT public: - EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + EntityGUI_SketcherDlg(GeometryGUI* GUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~EntityGUI_SketcherDlg(); protected: @@ -89,9 +89,9 @@ private : int mySketchState; bool myIsAllAdded; - + QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - + QStringList myCommand; QStringList myUndoCommand; @@ -131,6 +131,7 @@ private : bool createShapes( GEOM::GEOM_Object_ptr theObject, TopoDS_Shape& theApplyedWire, TopoDS_Shape& theLastSegment ); + private slots: void ClickOnEnd(); void ClickOnCancel(); @@ -149,7 +150,6 @@ private slots: void Dir1Clicked(int constructorId); void Dir2Clicked(int constructorId); void ValueChangedInSpinBox(double newValue); - }; #endif // ENTITYGUI_SKETCHERDLG_H diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx index 73efe51f1..03a640c79 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.cxx +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.cxx @@ -52,8 +52,9 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, fl) +EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUBSHAPE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -120,9 +121,7 @@ void EntityGUI_SubShapeDlg::Init() GroupPoints->CheckButton1->setEnabled(false); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -132,10 +131,10 @@ void EntityGUI_SubShapeDlg::Init() connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged())); connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled())); - + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - + updateButtonState(); SelectionIntoArgument(); @@ -207,7 +206,7 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument() return; } - if ( !myGeomBase->GetTopoFromSelection( selectedIO(), S ) || + if ( !GEOMBase::GetTopoFromSelection( selectedIO(), S ) || S.IsNull() || S.ShapeType() == TopAbs_VERTEX ) { @@ -328,7 +327,7 @@ void EntityGUI_SubShapeDlg::LineEditReturnPressed() //================================================================================= void EntityGUI_SubShapeDlg::DeactivateActiveDialog() { - if(GroupConstructors->isEnabled()) { + if (GroupConstructors->isEnabled()) { GEOMBase_Skeleton::DeactivateActiveDialog(); } } @@ -354,9 +353,8 @@ void EntityGUI_SubShapeDlg::ActivateThisDialog() //================================================================================= void EntityGUI_SubShapeDlg::enterEvent(QEvent* e) { - if(GroupConstructors->isEnabled()) - return; - ActivateThisDialog(); + if (!GroupConstructors->isEnabled()) + ActivateThisDialog(); } //================================================================================= diff --git a/src/EntityGUI/EntityGUI_SubShapeDlg.h b/src/EntityGUI/EntityGUI_SubShapeDlg.h index 59fa1e016..c159539d5 100644 --- a/src/EntityGUI/EntityGUI_SubShapeDlg.h +++ b/src/EntityGUI/EntityGUI_SubShapeDlg.h @@ -24,7 +24,6 @@ // File : EntityGUI_SubShapeDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_SUBSHAPE_H #define DIALOGBOX_SUBSHAPE_H @@ -42,11 +41,9 @@ class EntityGUI_SubShapeDlg : public GEOMBase_Skeleton Q_OBJECT public: - EntityGUI_SubShapeDlg( QWidget* parent = 0, - const char* name = 0, - bool modal = FALSE, - WFlags fl = 0 ); - ~EntityGUI_SubShapeDlg(); + EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); + ~EntityGUI_SubShapeDlg(); protected: // redefined from GEOMBase_Helper diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 049432031..1539bb563 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -89,23 +89,6 @@ using namespace std; #include "SALOMEDSClient.hxx" -//======================================================================= -// function : GEOMBase() -// purpose : Constructor -//======================================================================= -GEOMBase::GEOMBase() -{ -} - - -//======================================================================= -// function : ~GEOMBase() -// purpose : Destructor -//======================================================================= -GEOMBase::~GEOMBase() -{ -} - //===================================================================================== // function : GetShapeFromIOR() // purpose : exist also as static method ! diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h index c118ac737..372144172 100644 --- a/src/GEOMBase/GEOMBase.h +++ b/src/GEOMBase/GEOMBase.h @@ -24,7 +24,6 @@ // File : GEOMBase.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef GEOMBASE_H #define GEOMBASE_H @@ -65,53 +64,45 @@ class QWidget; class GEOMBASE_WNT_EXPORT GEOMBase { public : - GEOMBase(); - ~GEOMBase(); - - // SAN -- TO BE REMOVED !!! - static bool Display( GEOM::GEOM_Object_ptr ) {return false;} - static bool AddInStudy( GEOM::GEOM_Object_ptr ) {return false;} - static void DisplaySimulationShape(const TopoDS_Shape& S) {}; - static void EraseSimulationShape() {}; - // SAN -- TO BE REMOVED !!! - /* Selection and objects management */ static int GetIndex(const TopoDS_Shape& subshape, const TopoDS_Shape& shape, int ShapeType); static TopoDS_Shape GetShapeFromIOR(QString IOR); - static bool GetShape( const GEOM::GEOM_Object_ptr&, TopoDS_Shape&, const TopAbs_ShapeEnum = TopAbs_SHAPE ); + static bool GetShape(const GEOM::GEOM_Object_ptr&, TopoDS_Shape&, + const TopAbs_ShapeEnum = TopAbs_SHAPE); static bool GetTopoFromSelection(const SALOME_ListIO& aList, TopoDS_Shape& tds); - static int GetNameOfSelectedIObjects(const SALOME_ListIO& aList, QString& aName, const bool theShapesOnly = false ); + static int GetNameOfSelectedIObjects(const SALOME_ListIO& aList, QString& aName, + const bool theShapesOnly = false); static bool GetShapeTypeString(const TopoDS_Shape& aShape, Standard_CString& aTypeString); /* Convertions */ static GEOM::GEOM_Object_ptr ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO, - Standard_Boolean& testResult); + Standard_Boolean& testResult); static Handle(GEOM_AISShape) ConvertIOinGEOMAISShape(const Handle(SALOME_InteractiveObject)& IO, - Standard_Boolean& testResult, - bool onlyInActiveView = false); + Standard_Boolean& testResult, + bool onlyInActiveView = false); - static Handle(AIS_InteractiveObject) GetAIS( const Handle(SALOME_InteractiveObject)& theIO, - const bool isOnlyInActiveView = false ); + static Handle(AIS_InteractiveObject) GetAIS(const Handle(SALOME_InteractiveObject)& theIO, + const bool isOnlyInActiveView = false); static void ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, - GEOM::string_array& listIOR); + GEOM::string_array& listIOR); static Handle(GEOM_AISShape) ConvertIORinGEOMAISShape(const char * IOR, - Standard_Boolean& testResult, - bool onlyInActiveView = false); + Standard_Boolean& testResult, + bool onlyInActiveView = false); static GEOM_Actor* ConvertIORinGEOMActor(const char * IOR, Standard_Boolean& testResult, - bool onlyInActiveView = false); + bool onlyInActiveView = false); static GEOM::GEOM_Object_ptr ConvertIOinGEOMObject(const Handle(SALOME_InteractiveObject)& IO, - Standard_Boolean& testResult); + Standard_Boolean& testResult); - static void ConvertListOfIOInListOfGO( const SALOME_ListIO& aList, - GEOM::ListOfGO& listGO, - const bool theShapesOnly = false ); + static void ConvertListOfIOInListOfGO(const SALOME_ListIO& aList, + GEOM::ListOfGO& listGO, + const bool theShapesOnly = false); - static GEOM::GEOM_Object_ptr GetObjectFromIOR( const char* theIOR ); + static GEOM::GEOM_Object_ptr GetObjectFromIOR(const char* theIOR); + + static char* GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject); - static char* GetIORFromObject( const GEOM::GEOM_Object_ptr& theObject ); - /* Geometry */ static bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P); @@ -121,15 +112,16 @@ public : /* User dialog 1 parameter returned */ static double Parameter(Standard_Boolean& res, - const char* aValue1 = 0, const char* aTitle1 = 0, - const char* aTitle = 0, const double bottom = -1E6, - const double top = +1E6, const int decimals = 6); + const char* aValue1 = 0, const char* aTitle1 = 0, + const char* aTitle = 0, const double bottom = -1E6, + const double top = +1E6, const int decimals = 6); /* Simulation management */ static bool CreateArrowForLinearEdge(const TopoDS_Shape& tds, TopoDS_Shape& ArrowCone); /* Generates default names */ - static bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, const SALOME_ListIO& aList); + static bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, + const SALOME_ListIO& aList); /* Shows message box with error code */ static bool DefineDlgPosition(QWidget* aDlg, int& x, int& y); @@ -139,10 +131,9 @@ public : static void ShowErrorMessage(const char* theErrorCode, const char* theComment = 0); /* Gets name of object */ - static QString GetName( GEOM::GEOM_Object_ptr ); + static QString GetName(GEOM::GEOM_Object_ptr); - static bool IsShape( GEOM::GEOM_Object_ptr theObj ); + static bool IsShape(GEOM::GEOM_Object_ptr theObj); }; #endif - diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index f48979a4e..c8201fc5f 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -109,7 +109,8 @@ GEOMBase_Helper::~GEOMBase_Helper() globalSelection( GEOM_ALLOBJECTS, true ); - delete myDisplayer; + if (myDisplayer) + delete myDisplayer; } //================================================================ diff --git a/src/GEOMBase/GEOMBase_Skeleton.cxx b/src/GEOMBase/GEOMBase_Skeleton.cxx index 2c111e605..8053618ba 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.cxx +++ b/src/GEOMBase/GEOMBase_Skeleton.cxx @@ -27,12 +27,13 @@ // $Header$ #include "GEOMBase_Skeleton.h" + #include "GeometryGUI.h" -#include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" #include @@ -46,9 +47,12 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -GEOMBase_Skeleton::GEOMBase_Skeleton(QWidget* parent, const char* name, bool modal, WFlags fl) - :DlgRef_Skeleton_QTD( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), - GEOMBase_Helper( dynamic_cast( parent ) ) +GEOMBase_Skeleton::GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + : DlgRef_Skeleton_QTD( parent, name, modal, WStyle_Customize | WStyle_NormalBorder + | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), + GEOMBase_Helper( dynamic_cast( parent ) ), + myGeomGUI( theGeometryGUI ) { if (!name) setName("GEOMBase_Skeleton"); @@ -82,15 +86,13 @@ GEOMBase_Skeleton::~GEOMBase_Skeleton() //================================================================================= void GEOMBase_Skeleton::Init() { - myGeomGUI = 0; SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication()); - if( app ) + if (!myGeomGUI && app) myGeomGUI = dynamic_cast( app->module( "Geometry" ) ); - + /* init variables */ - myGeomBase = new GEOMBase(); // SAN -- TO BE REMOVED !!! myGeomGUI->SetActiveDialogBox(this); - + /* signals and slots connections */ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); if (myGeomGUI) @@ -101,10 +103,6 @@ void GEOMBase_Skeleton::Init() // connect help button on a private slot that displays help information connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); - - /* Move widget on the botton right corner of main widget */ -// int x, y; -// myGeomBase->DefineDlgPosition( this, x, y ); /* displays Dialog */ RadioButton1->setChecked(TRUE); diff --git a/src/GEOMBase/GEOMBase_Skeleton.h b/src/GEOMBase/GEOMBase_Skeleton.h index 8163822e4..af609eb58 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.h +++ b/src/GEOMBase/GEOMBase_Skeleton.h @@ -24,7 +24,6 @@ // File : GEOMBase_Skeleton.h // Author : Damine COQUERET // Module : GEOM -// $Header$ #ifndef GEOMBASE_SKELETON_H #define GEOMBASE_SKELETON_H @@ -54,29 +53,36 @@ #endif class GEOMBASE_WNT_EXPORT GEOMBase_Skeleton : public DlgRef_Skeleton_QTD, public GEOMBase_Helper -{ +{ Q_OBJECT public: - GEOMBase_Skeleton(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GEOMBase_Skeleton(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GEOMBase_Skeleton(); -// int getConstructorId() const; // returns id of a selected "constructor" radio button or '-1' in case of error -private : +private: void Init(); protected: void closeEvent(QCloseEvent* e); - void initName( const char* thePrefix = 0 ); // initialize "Name" field with a string "thePrefix_X" (Vertex_3) - virtual const char* getNewObjectName() const; // returns contents of "Name" field - int getConstructorId() const; // returns id of a selected "constructor" radio button or '-1' in case of error - + /*! initialize "Name" field with a string "thePrefix_X" (Vertex_3) + */ + void initName( const char* thePrefix = 0 ); + + /*! returns contents of "Name" field + */ + virtual const char* getNewObjectName() const; + + /*! returns id of a selected "constructor" radio button or '-1' in case of error + */ + int getConstructorId() const; + void setHelpFileName( const QString& ); - QLineEdit* myEditCurrentArgument; /* Current LineEdit */ - GEOMBase* myGeomBase; // SAN -- TO BE REMOVED !!! - GeometryGUI* myGeomGUI; /* reference GEOM GUI */ + QLineEdit* myEditCurrentArgument; //!< Current LineEdit + GeometryGUI* myGeomGUI; //!< reference GEOM GUI QString myHelpFileName; protected slots: @@ -85,7 +91,6 @@ protected slots: void DeactivateActiveDialog(); void ActivateThisDialog(); void ClickOnHelp(); - }; #endif // GEOMBASE_SKELETON_H diff --git a/src/GenerationGUI/GenerationGUI.cxx b/src/GenerationGUI/GenerationGUI.cxx index 4d52198f5..0f47042a9 100644 --- a/src/GenerationGUI/GenerationGUI.cxx +++ b/src/GenerationGUI/GenerationGUI.cxx @@ -85,7 +85,7 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case 4031: aDlg = new GenerationGUI_PrismDlg ( getGeometryGUI(), parent, ""); break; case 4032: aDlg = new GenerationGUI_RevolDlg ( getGeometryGUI(), parent, ""); break; case 4033: aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent, ""); break; - case 4034: aDlg = new GenerationGUI_PipeDlg ( parent, ""); break; + case 4034: aDlg = new GenerationGUI_PipeDlg ( getGeometryGUI(), parent, ""); break; default: SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; } diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 990063dd5..f65be950e 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -59,9 +59,8 @@ //================================================================================= 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) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FILLING"))); QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); @@ -150,11 +149,11 @@ void GenerationGUI_FillingDlg::Init() connect(GroupPoints->SpinBox_4, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupPoints->SpinBox_5, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_2, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_3, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_4, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_5, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_3, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_4, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_5, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.h b/src/GenerationGUI/GenerationGUI_FillingDlg.h index d562c5275..bec037754 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.h +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.h @@ -24,7 +24,6 @@ // File : GenerationGUI_FillingDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_FILLING_H #define DIALOGBOX_FILLING_H @@ -41,7 +40,8 @@ class GenerationGUI_FillingDlg : public GEOMBase_Skeleton Q_OBJECT public: - GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GenerationGUI_FillingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GenerationGUI_FillingDlg(); protected: @@ -54,8 +54,6 @@ private: void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myCompound; /* compound of curves */ Standard_Integer myMinDeg; Standard_Integer myMaxDeg; @@ -74,7 +72,6 @@ private slots: void SelectionIntoArgument(); void SetEditCurrentArgument(); void ValueChangedInSpinBox(double newValue); - }; #endif // DIALOGBOX_FILLING_H diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index 6d93a34c5..091fc7dff 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -55,8 +55,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PIPE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.h b/src/GenerationGUI/GenerationGUI_PipeDlg.h index 4f525f343..472e90799 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.h +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.h @@ -24,7 +24,6 @@ // File : GenerationGUI_PipeDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_PIPE_H #define DIALOGBOX_PIPE_H @@ -41,7 +40,8 @@ class GenerationGUI_PipeDlg : public GEOMBase_Skeleton Q_OBJECT public: - GenerationGUI_PipeDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GenerationGUI_PipeDlg(); protected: @@ -57,7 +57,7 @@ private: GEOM::GEOM_Object_var myBase; /* Base shape */ GEOM::GEOM_Object_var myPath; /* Shape, defining the path */ bool myOkBase; - bool myOkPath ; /* to check when arguments are defined */ + bool myOkPath; /* to check when arguments are defined */ DlgRef_2Sel_QTD* GroupPoints; @@ -68,7 +68,6 @@ private slots: void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); - }; #endif // DIALOGBOX_PIPE_H diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index f48a3ca41..a088ce904 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -50,8 +50,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(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) +GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -128,10 +130,10 @@ void GenerationGUI_PrismDlg::Init() connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse())); - + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; @@ -175,39 +177,38 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument() erasePreview(); myEditCurrentArgument->setText(""); - if(IObjectCount() != 1) - { - if(myEditCurrentArgument == GroupPoints->LineEdit1) - myOkBase = false; - else if(myEditCurrentArgument == GroupPoints->LineEdit2) - myOkVec = false; - return; - } - + if (IObjectCount() != 1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1) + myOkBase = false; + else if (myEditCurrentArgument == GroupPoints->LineEdit2) + myOkVec = false; + return; + } + // nbSel == 1 Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); - + GEOM::GEOM_Object_ptr aSelectedObject = + GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult ); + if (!testResult) return; - if(myEditCurrentArgument == GroupPoints->LineEdit1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1) { myOkBase = false; TopoDS_Shape S; - if ( !GEOMBase::GetShape(aSelectedObject, S) || + if (!GEOMBase::GetShape(aSelectedObject, S) || S.ShapeType() <= 2) return; - + myBase = aSelectedObject; myOkBase = true; - } - else if(myEditCurrentArgument == GroupPoints->LineEdit2) { + } else if (myEditCurrentArgument == GroupPoints->LineEdit2) { myVec = aSelectedObject; myOkVec = true; } myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); - + displayPreview(); } @@ -286,7 +287,6 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox() } - //================================================================================= // function : getHeight() // purpose : @@ -321,9 +321,10 @@ bool GenerationGUI_PrismDlg::isValid( QString& ) bool GenerationGUI_PrismDlg::execute( ObjectList& objects ) { GEOM::GEOM_Object_var anObj; - - anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation() )->MakePrismVecH ( myBase, myVec, getHeight() ); - + + anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> + MakePrismVecH(myBase, myVec, getHeight()); + if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); @@ -340,6 +341,3 @@ void GenerationGUI_PrismDlg::onReverse() double anOldValue = GroupPoints->SpinBox_DX->GetValue(); GroupPoints->SpinBox_DX->SetValue( -anOldValue ); } - - - diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.h b/src/GenerationGUI/GenerationGUI_PrismDlg.h index ee946ae77..b6b7ba17d 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.h +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.h @@ -24,7 +24,6 @@ // File : GenerationGUI_PrismDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_PRISM_H #define DIALOGBOX_PRISM_H @@ -41,7 +40,8 @@ class GenerationGUI_PrismDlg : public GEOMBase_Skeleton Q_OBJECT public: - GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GenerationGUI_PrismDlg(); protected: @@ -55,8 +55,6 @@ private : void enterEvent(QEvent* e); double getHeight() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myBase; /* Base shape */ GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */ diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index f6a83f432..d29b3ed84 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -52,8 +52,10 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(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) +GenerationGUI_RevolDlg::GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REVOL"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -129,10 +131,10 @@ void GenerationGUI_RevolDlg::Init() connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName(tr("GEOM_REVOLUTION")); diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.h b/src/GenerationGUI/GenerationGUI_RevolDlg.h index f5d7637f3..03d079f46 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.h +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.h @@ -24,7 +24,6 @@ // File : GenerationGUI_RevolDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_REVOLUTION_H #define DIALOGBOX_REVOLUTION_H @@ -43,7 +42,8 @@ class GenerationGUI_RevolDlg : public GEOMBase_Skeleton Q_OBJECT public: - GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GenerationGUI_RevolDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~GenerationGUI_RevolDlg(); protected: @@ -57,8 +57,6 @@ private : void enterEvent(QEvent* e); double getAngle() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myBase; /* Base shape */ GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */ bool myOkBase; @@ -75,7 +73,6 @@ private slots: void SetEditCurrentArgument(); void ValueChangedInSpinBox(); void onReverse(); - }; #endif // DIALOGBOX_REVOLUTION_H diff --git a/src/GroupGUI/GroupGUI.cxx b/src/GroupGUI/GroupGUI.cxx index 5bfaf9fca..54a91f951 100644 --- a/src/GroupGUI/GroupGUI.cxx +++ b/src/GroupGUI/GroupGUI.cxx @@ -61,7 +61,6 @@ GroupGUI::GroupGUI(GeometryGUI* parent) { } - //======================================================================= // function : ~GroupGUI() // purpose : Destructor @@ -78,13 +77,14 @@ GroupGUI::~GroupGUI() bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { getGeometryGUI()->EmitSignalDeactivateDialog(); - + QDialog* aDlg = NULL; - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + SUIT_Application* suitApp = SUIT_Session::session()->activeApplication(); + SalomeApp_Study* appStudy = dynamic_cast(suitApp->activeStudy()); if ( !appStudy ) return false; _PTR(Study) aStudy = appStudy->studyDS(); - + if ( aStudy->GetProperties()->IsLocked() ) { SUIT_MessageBox::warn1 ( parent, QObject::tr("WRN_WARNING"), @@ -95,45 +95,42 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) switch ( theCommandID ) { case 800: - case 8001: - aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::CreateGroup, parent, ""); + case 8001: // CREATE GROUP + aDlg = new GroupGUI_GroupDlg (GroupGUI_GroupDlg::CreateGroup, getGeometryGUI(), parent); break; - case 801: + case 801: // EDIT GROUP { SALOME_ListIO aList; aList.Clear(); - - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - if ( app ) { + + SalomeApp_Application* app = dynamic_cast(suitApp); + if (app) { LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); - if ( aSelMgr ) - aSelMgr->selectedObjects( aList ); + if (aSelMgr) + aSelMgr->selectedObjects(aList); } - if ( aList.Extent() == 1 ) { + if (aList.Extent() == 1) { Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult ); - if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) { - aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, parent, "" ); + if (aResult && !CORBA::is_nil(anObj) && anObj->GetType() == GEOM_GROUP) { + aDlg = new GroupGUI_GroupDlg (GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent); break; } } - SUIT_MessageBox::warn1 ( parent, - tr("WRN_WARNING"), - tr("NO_GROUP"), - tr("BUT_OK") ); + SUIT_MessageBox::warn1(parent, tr("WRN_WARNING"), tr("NO_GROUP"), tr("BUT_OK") ); break; } default: - SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); + suitApp->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; } - - if ( aDlg != NULL ) + + if (aDlg != NULL) aDlg->show(); - + return true; } diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index 0c4842861..8333a1ed3 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -47,12 +47,8 @@ #include -GroupGUI_GroupDlg::GroupGUI_GroupDlg(Mode mode, - QWidget* parent, - const char* name, - bool modal, - WFlags fl) - :GEOMBase_Skeleton( parent, "GroupGUI_GroupDlg", false, +GroupGUI_GroupDlg::GroupGUI_GroupDlg(Mode mode, GeometryGUI* theGeometryGUI, QWidget* parent) + :GEOMBase_Skeleton( theGeometryGUI, parent, "GroupGUI_GroupDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), myMode( mode ), myBusy( false ) @@ -207,7 +203,6 @@ void GroupGUI_GroupDlg::ClickOnOk() ClickOnCancel(); } - //================================================================================= // function : ClickOnApply() // purpose : diff --git a/src/GroupGUI/GroupGUI_GroupDlg.h b/src/GroupGUI/GroupGUI_GroupDlg.h index 75879c54d..879920b2d 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.h +++ b/src/GroupGUI/GroupGUI_GroupDlg.h @@ -24,7 +24,6 @@ // File : GroupGUI_GroupDlg.h // Author : Sergey ANIKIN // Module : GEOM -// $Header$ #ifndef GROUPGUI_GROUPDLG_H #define GROUPGUI_GROUPDLG_H @@ -50,7 +49,7 @@ public: EditGroup } Mode; - GroupGUI_GroupDlg(Mode mode, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + GroupGUI_GroupDlg(Mode mode, GeometryGUI*, QWidget* parent = 0); ~GroupGUI_GroupDlg(); protected: @@ -60,7 +59,6 @@ protected: virtual bool execute( ObjectList& objects ); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj ); - private slots: void ClickOnOk(); bool ClickOnApply(); @@ -90,7 +88,7 @@ private: bool myBusy; GEOM::GEOM_Object_var myMainObj; GEOM::GEOM_Object_var myGroup; - + QPushButton* mySelBtn; QLineEdit* myMainName; QPushButton* mySelSubBtn; diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index b49f9eed5..c2f45cbc7 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -87,17 +87,17 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) switch ( theCommandID ) { - case 701 : new MeasureGUI_PropertiesDlg ( getGeometryGUI(), parent ); break; // LENGTH, AREA AND VOLUME - case 702 : new MeasureGUI_CenterMassDlg ( parent ); break; // CENTER MASS - case 703 : new MeasureGUI_InertiaDlg ( getGeometryGUI(), parent ); break; // INERTIA - case 7041 : new MeasureGUI_BndBoxDlg ( getGeometryGUI(), parent ); break; // BOUNDING BOX - case 7042 : new MeasureGUI_DistanceDlg ( getGeometryGUI(), parent ); break; // MIN DISTANCE - case 705 : new MeasureGUI_MaxToleranceDlg( getGeometryGUI(), parent ); break; // MAXTOLERANCE - case 706 : new MeasureGUI_WhatisDlg ( getGeometryGUI(), parent ); break; // WHATIS - case 707 : new MeasureGUI_CheckShapeDlg ( getGeometryGUI(), parent ); break; // CHECKSHAPE - case 7072 : new MeasureGUI_CheckCompoundOfBlocksDlg ( getGeometryGUI(), parent ); break; // CHECKCOMPOUND - case 708 : new MeasureGUI_PointDlg ( getGeometryGUI(), parent ); break; // POINT COORDINATES - + case 701 : new MeasureGUI_PropertiesDlg (getGeometryGUI(), parent); break; // LENGTH, AREA AND VOLUME + case 702 : new MeasureGUI_CenterMassDlg (getGeometryGUI(), parent); break; // CENTER MASS + case 703 : new MeasureGUI_InertiaDlg (getGeometryGUI(), parent); break; // INERTIA + case 7041: new MeasureGUI_BndBoxDlg (getGeometryGUI(), parent); break; // BOUNDING BOX + case 7042: new MeasureGUI_DistanceDlg (getGeometryGUI(), parent); break; // MIN DISTANCE + case 705 : new MeasureGUI_MaxToleranceDlg(getGeometryGUI(), parent); break; // MAXTOLERANCE + case 706 : new MeasureGUI_WhatisDlg (getGeometryGUI(), parent); break; // WHATIS + case 707 : new MeasureGUI_CheckShapeDlg (getGeometryGUI(), parent); break; // CHECKSHAPE + case 7072: new MeasureGUI_CheckCompoundOfBlocksDlg (getGeometryGUI(), parent); break; // CHECKCOMPOUND + case 708 : new MeasureGUI_PointDlg (getGeometryGUI(), parent); break; // POINT COORDINATES + default: SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; @@ -106,33 +106,6 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) } -//===================================================================================== -// function : MakeCDGAndDisplay() -// purpose : -//===================================================================================== -/*void MeasureGUI::MakeCDGAndDisplay(GEOM::GEOM_Shape_ptr Shape) -{ - QAD_Application::getDesktop()->putInfo("MakeCDGAndDisplay method from MeasureGUI should be reimplemented ..."); - - try { - GEOM::GEOM_Shape_var result = myGeom->MakeCDG(Shape); - if(result->_is_nil()) { - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT")); - return; - } - result->NameType(tr("GEOM_POINT")); - if(myGeomBase->Display(result)) - QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE")); - } - catch(const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - - return; -} -*/ - - //===================================================================================== // EXPORTED METHODS //===================================================================================== diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 179f51047..1c62ec922 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -191,22 +191,3 @@ SALOME_Prs* MeasureGUI_BndBoxDlg::buildPrs() return !aShape.IsNull() ? getDisplayer()->BuildPrs( aShape ) : 0; } - - - - - - - - - - - - - - - - - - - diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h index a4da9046c..b9f25f457 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.h +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.h @@ -24,7 +24,6 @@ // File : MeasureGUI_BndBoxDlg.h // Author : Nicolas REJNERI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BNDBOX_H #define DIALOGBOX_BNDBOX_H @@ -48,39 +47,23 @@ class MEASUREGUI_EXPORT MeasureGUI_BndBoxDlg : public MeasureGUI_Skeleton Q_OBJECT public: - MeasureGUI_BndBoxDlg( GeometryGUI* GUI, - QWidget* parent ); - ~MeasureGUI_BndBoxDlg(); -protected: + MeasureGUI_BndBoxDlg(GeometryGUI* GUI, + QWidget* parent); + ~MeasureGUI_BndBoxDlg(); +protected: // redefined from GEOMBase_Helper and MeasureGUI_Skeleton virtual void processObject(); virtual SALOME_Prs* buildPrs(); private: - void Init(); bool getParameters( double& Xmin, double& Xmax, double& Ymin, double& Ymax, double& Zmin, double& Zmax ); private: - MeasureGUI_1Sel6LineEdit_QTD* myGrp; }; #endif // DIALOGBOX_BNDBOX_H - - - - - - - - - - - - - - diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index 0c89bb0aa..7fd7c774b 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -49,17 +49,16 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg( QWidget* parent ) -: GEOMBase_Skeleton( parent, "MeasureGUI_CenterMassDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +MeasureGUI_CenterMassDlg::MeasureGUI_CenterMassDlg( GeometryGUI* theGeometryGUI, QWidget* parent ) + : GEOMBase_Skeleton(theGeometryGUI, parent, "MeasureGUI_CenterMassDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr( "ICON_DLG_CENTERMASS" ) ) ); - QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr( "ICON_SELECT" ) ) ); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CENTERMASS"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); setCaption( tr( "GEOM_CMASS_TITLE" ) ); /***************************************************************/ - GroupConstructors->setTitle( tr( "GEOM_CMASS" ) ); RadioButton1->setPixmap( image0 ); RadioButton2->close( TRUE ); @@ -339,5 +338,3 @@ bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects ) return true; } - - diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.h b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h index 1cee7d357..f0c14f84f 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.h +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.h @@ -47,11 +47,11 @@ class MEASUREGUI_EXPORT MeasureGUI_CenterMassDlg : public GEOMBase_Skeleton Q_OBJECT public: - MeasureGUI_CenterMassDlg( QWidget* parent ); - ~MeasureGUI_CenterMassDlg(); + MeasureGUI_CenterMassDlg( GeometryGUI* GUI, + QWidget* parent ); + ~MeasureGUI_CenterMassDlg(); protected: - // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& msg ); @@ -63,17 +63,15 @@ private slots: void ActivateThisDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); - void SetEditCurrentArgument(); + void SetEditCurrentArgument(); private: - void Init( ); void enterEvent( QEvent* e ); void processObject(); bool getParameters( double&, double&, double& ); private: - GEOM::GEOM_Object_var myObj; MeasureGUI_1Sel3LineEdit_QTD* myGrp; }; diff --git a/src/OperationGUI/OperationGUI.cxx b/src/OperationGUI/OperationGUI.cxx index 6838a57d7..67d9339f3 100644 --- a/src/OperationGUI/OperationGUI.cxx +++ b/src/OperationGUI/OperationGUI.cxx @@ -30,6 +30,7 @@ #include "SUIT_Session.h" #include "SUIT_Desktop.h" +#include "SalomeApp_Application.h" #include #include @@ -84,29 +85,18 @@ OperationGUI::~OperationGUI() bool OperationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { getGeometryGUI()->EmitSignalDeactivateDialog(); - - switch ( theCommandID ) + + switch (theCommandID) { - case 503: // PARTITION - ( new OperationGUI_PartitionDlg( parent, "" ) )->show(); - break; - case 504: // ARCHIMEDE - new OperationGUI_ArchimedeDlg( getGeometryGUI(), parent ); - break; - case 505: // FILLET - new OperationGUI_FilletDlg( parent ); - break; - case 506: // CHAMFER - new OperationGUI_ChamferDlg( parent ); - break; - case 507: // CLIPPING RANGE - ( new OperationGUI_ClippingDlg( parent, "" ) )->show(); - break; - default: - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); - break; + case 503: (new OperationGUI_PartitionDlg(getGeometryGUI(), parent))->show(); break; + case 504: (new OperationGUI_ArchimedeDlg(getGeometryGUI(), parent))->show(); break; + case 505: (new OperationGUI_FilletDlg (getGeometryGUI(), parent))->show(); break; + case 506: (new OperationGUI_ChamferDlg (getGeometryGUI(), parent))->show(); break; + case 507: (new OperationGUI_ClippingDlg (getGeometryGUI(), parent))->show(); break; + default: + getGeometryGUI()->getApp()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); } - + return true; } diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 292dbd64d..e552f385e 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -44,8 +44,8 @@ // TRUE to construct a modal dialog. //================================================================================= OperationGUI_ArchimedeDlg::OperationGUI_ArchimedeDlg( GeometryGUI* theGeometryGUI, QWidget* parent ) -: GEOMBase_Skeleton( parent, "ArchimedeDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), myGeometryGUI(theGeometryGUI) + : GEOMBase_Skeleton(theGeometryGUI, parent, "ArchimedeDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARCHIMEDE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -117,22 +117,18 @@ void OperationGUI_ArchimedeDlg::Init() connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_ARCHIMEDE" ) ); globalSelection( GEOM_ALLSHAPES ); SelectionIntoArgument(); - - /* displays Dialog */ - GroupPoints->show(); - this->show(); } @@ -210,7 +206,7 @@ void OperationGUI_ArchimedeDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); globalSelection( GEOM_ALLSHAPES ); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); return; } diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.h b/src/OperationGUI/OperationGUI_ArchimedeDlg.h index f1c1fd7d7..02ad8ba62 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.h +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.h @@ -24,7 +24,6 @@ // File : OperationGUI_ArchimedeDlg.h // Author : Nicolas REJNERI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_ARCHIMEDE_H #define DIALOGBOX_ARCHIMEDE_H @@ -42,13 +41,11 @@ class OperationGUI_ArchimedeDlg : public GEOMBase_Skeleton Q_OBJECT public: - OperationGUI_ArchimedeDlg( GeometryGUI* theGeometryGUI, QWidget* parent ); + OperationGUI_ArchimedeDlg(GeometryGUI* theGeometryGUI, QWidget* parent); ~OperationGUI_ArchimedeDlg(); protected: - // redefined from GEOMBase_Helper - virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& msg ); virtual bool execute( ObjectList& objects ); @@ -61,7 +58,6 @@ private: GEOM::GEOM_Object_var myShape; DlgRef_1Sel3Spin* GroupPoints; double myStep; - GeometryGUI* myGeometryGUI; private slots: void ClickOnOk(); diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 41849dcd4..8ff20d322 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -24,7 +24,6 @@ // File : OperationGUI_ChamferDlg.cxx // Author : Damien COQUERET // Module : GEOM - // $Header$ #include "OperationGUI_ChamferDlg.h" @@ -51,9 +50,9 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -OperationGUI_ChamferDlg::OperationGUI_ChamferDlg( QWidget* parent ) -: GEOMBase_Skeleton(parent, "ChamferDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, "ChamferDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { myConstructorId = -1; @@ -205,16 +204,14 @@ void OperationGUI_ChamferDlg::Init() this, SLOT( ValueChangedInSpinBox( double ) ) ); // selection - connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); + connect(myGeomGUI->getApp()->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_CHAMFER" ) ); myGrp2->hide(); myGrp3->hide(); myGrp1->show(); - - this->show(); } @@ -225,14 +222,14 @@ void OperationGUI_ChamferDlg::Init() void OperationGUI_ChamferDlg::ConstructorsClicked( int constructorId ) { // Activate next widget - if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() - != OCCViewer_Viewer::Type() ) - { - RadioButton1->setChecked( true ); - return; - } - - if ( myConstructorId == constructorId ) + if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType() + != OCCViewer_Viewer::Type()) + { + RadioButton1->setChecked( true ); + return; + } + + if (myConstructorId == constructorId) return; // Get values from previous widget @@ -465,17 +462,6 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void OperationGUI_ChamferDlg::DeactivateActiveDialog() -{ - // disconnect selection - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.h b/src/OperationGUI/OperationGUI_ChamferDlg.h index cb69ad24b..a422ace16 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.h +++ b/src/OperationGUI/OperationGUI_ChamferDlg.h @@ -24,7 +24,6 @@ // File : OperationGUI_ChamferDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CHAMFER_H #define DIALOGBOX_CHAMFER_H @@ -46,8 +45,8 @@ class OperationGUI_ChamferDlg : public GEOMBase_Skeleton enum { SpinBox1, SpinBox21, SpinBox22, SpinBox31, SpinBox32 }; public: - OperationGUI_ChamferDlg( QWidget* parent ); - virtual ~OperationGUI_ChamferDlg(); + OperationGUI_ChamferDlg(GeometryGUI* theGeometryGUI, QWidget* parent); + virtual ~OperationGUI_ChamferDlg(); protected: // redefined from GEOMBase_Helper @@ -56,19 +55,16 @@ protected: virtual bool execute( ObjectList& objects ); private slots: - void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ValueChangedInSpinBox( double newValue ); void ConstructorsClicked( int constructorId ); -private : - +private: void Init(); void enterEvent( QEvent* e ); void reset(); @@ -78,7 +74,6 @@ private : void enableWidgets(); private: - int myConstructorId; GEOM::GEOM_Object_var myShape; @@ -95,4 +90,3 @@ private: }; #endif // DIALOGBOX_CHAMFER_H - diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index a52f04d3b..7bbafa785 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -57,12 +57,12 @@ // class : OperationGUI_ClippingDlg() // purpose : //================================================================================= -OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) - : GEOMBase_Skeleton( parent, "OperationGUI_ClippingDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +OperationGUI_ClippingDlg::OperationGUI_ClippingDlg(GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, "OperationGUI_ClippingDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption( tr( "Change clipping range" ) ); - + GroupConstructors->close(); GroupBoxName->close(); @@ -75,7 +75,7 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* GroupArgumentsLayout->setAlignment( Qt::AlignTop ); GroupArgumentsLayout->setSpacing( 6 ); GroupArgumentsLayout->setMargin( 11 ); - + // Controls TextLabelNear = new QLabel( GroupArguments, "TextLabelNear" ); TextLabelNear->setText( tr( "Near" ) ); @@ -89,10 +89,10 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* TextLabelFar->setText( tr( "Far" ) ); TextLabelFar->setFixedWidth(74); GroupArgumentsLayout->addWidget( TextLabelFar, 0, 2 ); - + SpinBox_Far = new DlgRef_SpinBox( GroupArguments, "SpinBox_Far"); GroupArgumentsLayout->addWidget( SpinBox_Far, 0, 3 ); - + resetButton = new QPushButton( GroupArguments, "resetButton" ); resetButton->setText( tr( "Reset" ) ); GroupArgumentsLayout->addWidget( resetButton, 0, 4 ); @@ -103,24 +103,18 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* TypeCB->insertItem(tr("FRONT")); TypeCB->insertItem(tr("SLICE")); GroupArgumentsLayout->addMultiCellWidget( TypeCB, 1, 1, 0, 4 ); - + Layout1->addWidget( GroupArguments, 2, 0 ); - + /* Initialisations */ SpinBox_Near->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); SpinBox_Far->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - - //GeometryGUI* aGeomGUI = GeometryGUI::GetGeomGUI(); - + /* signals and slots connections */ - connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ; - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - + connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); + connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); + connect( resetButton, SIGNAL (clicked() ), this, SLOT( onReset() ) ) ; - - // connect( aGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ) ; - //connect( aGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ; setHelpFileName("none.htm"); @@ -136,7 +130,6 @@ OperationGUI_ClippingDlg::~ OperationGUI_ClippingDlg() // no need to delete child widgets, Qt does it all for us } - //================================================================================= // function : Init() // purpose : @@ -276,17 +269,6 @@ void OperationGUI_ClippingDlg::ClickOnOk() ClickOnCancel(); } - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void OperationGUI_ClippingDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : onActivate() // purpose : @@ -296,27 +278,16 @@ void OperationGUI_ClippingDlg::onActivate() GEOMBase_Skeleton::ActivateThisDialog(); } - -//================================================================================= -// function : onDeactivate() -// purpose : public slot to deactivate if active -//================================================================================= -void OperationGUI_ClippingDlg::DeactivateActiveDialog() -{ - return; -} - //================================================================================= // function : enterEvent() // purpose : //================================================================================= -void OperationGUI_ClippingDlg::enterEvent(QEvent* e) +void OperationGUI_ClippingDlg::enterEvent(QEvent*) { this->setEnabled(true); return; } - //================================================================================= // function : closeEvent // purpose : @@ -326,14 +297,14 @@ void OperationGUI_ClippingDlg::closeEvent( QCloseEvent* e ) QDialog::closeEvent( e ); } - //================================================================================= // function : onReset() // purpose : //================================================================================= void OperationGUI_ClippingDlg::onReset() { - SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SUIT_ViewWindow* anActiveWindow = + SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); if (!anActiveWindow) return; @@ -399,7 +370,5 @@ void OperationGUI_ClippingDlg::onReset() TypeCB->setCurrentItem(ztype); } - - return; } diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.h b/src/OperationGUI/OperationGUI_ClippingDlg.h index ba5e6ee07..49e262448 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.h +++ b/src/OperationGUI/OperationGUI_ClippingDlg.h @@ -24,7 +24,6 @@ // File : OperationGUI_ClippingDlg.h // Author : Michael Zorin // Module : GEOM -// $Header: #ifndef DIALOGBOX_CLIPPINGRANGE_H #define DIALOGBOX_CLIPPING_H @@ -46,20 +45,19 @@ enum ViewerTypes { VTK, OCC, OTHER }; class OperationGUI_ClippingDlg : public GEOMBase_Skeleton { Q_OBJECT - - public: - OperationGUI_ClippingDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + +public: + OperationGUI_ClippingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0); ~OperationGUI_ClippingDlg(); - -private : +private: void Init(); ViewerTypes myViewerType; virtual void closeEvent( QCloseEvent* e ); void enterEvent(QEvent* e); - + QGroupBox* GroupArguments; QLabel* TextLabelNear; DlgRef_SpinBox* SpinBox_Near; @@ -71,10 +69,7 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void onActivate(); - void DeactivateActiveDialog(); - void onReset(); }; diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 52182e28d..2daeb7121 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -51,19 +51,20 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -OperationGUI_FilletDlg::OperationGUI_FilletDlg( QWidget* parent ) - :GEOMBase_Skeleton( parent, "OperationGUI_FilletDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +OperationGUI_FilletDlg::OperationGUI_FilletDlg(GeometryGUI* theGeometryGUI, QWidget* parent) + :GEOMBase_Skeleton(theGeometryGUI, parent, "OperationGUI_FilletDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { myConstructorId = -1; - - QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLET_ALL" ) ) ); - QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLET_EDGE" ) ) ); - QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FILLET_FACE" ) ) ); - - QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) ); - setCaption( tr( "GEOM_FILLET_TITLE" ) ); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_ALL"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_EDGE"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FILLET_FACE"))); + + QPixmap iconSelect(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setCaption(tr("GEOM_FILLET_TITLE")); /***************************************************************/ GroupConstructors->setTitle( tr( "GEOM_FILLET" ) ); @@ -160,17 +161,14 @@ void OperationGUI_FilletDlg::Init() connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); // selection - connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - + connect(myGeomGUI->getApp()->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_FILLET" ) ); Group2->hide(); Group3->hide(); Group1->show(); - - this->show(); } @@ -310,31 +308,31 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() if ( aResult && !anObj->_is_nil() ) { - TColStd_IndexedMapOfInteger anIndexes; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), anIndexes ); - - if ( anIndexes.Extent() > 0 ) - { - QString aName; - if ( anIndexes.Extent() == 1 ) - { - int anIndex = anIndexes( 1 ); - - aName = QString( GEOMBase::GetName( anObj ) ) + QString( ":%1" ).arg( anIndex ); - } - else - aName = tr( "GEOM_MEN_POPUP_NAME" ).arg( anIndexes.Extent() ); - - myEditCurrentArgument->setText( aName ); - - if ( myConstructorId == 1 ) - myEdges = anIndexes; - else - myFaces = anIndexes; - - displayPreview(); - return; - } + TColStd_IndexedMapOfInteger anIndexes; + myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), anIndexes ); + + if ( anIndexes.Extent() > 0 ) + { + QString aName; + if ( anIndexes.Extent() == 1 ) + { + int anIndex = anIndexes( 1 ); + + aName = QString( GEOMBase::GetName( anObj ) ) + QString( ":%1" ).arg( anIndex ); + } + else + aName = tr( "GEOM_MEN_POPUP_NAME" ).arg( anIndexes.Extent() ); + + myEditCurrentArgument->setText( aName ); + + if ( myConstructorId == 1 ) + myEdges = anIndexes; + else + myFaces = anIndexes; + + displayPreview(); + return; + } } } myFaces.Clear(); @@ -402,17 +400,6 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void OperationGUI_FilletDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); - return; -} - - //================================================================================= // function : ActivateThisDialog() // purpose : @@ -421,8 +408,8 @@ void OperationGUI_FilletDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument() ) ); + connect(myGeomGUI->getApp()->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); activateSelection(); displayPreview(); @@ -628,10 +615,3 @@ double OperationGUI_FilletDlg::getRadius() const else if ( anId == 1 ) return Group2->SpinBox_DX->GetValue(); else return Group3->SpinBox_DX->GetValue(); } - - - - - - - diff --git a/src/OperationGUI/OperationGUI_FilletDlg.h b/src/OperationGUI/OperationGUI_FilletDlg.h index d794e834d..996aee91d 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.h +++ b/src/OperationGUI/OperationGUI_FilletDlg.h @@ -24,7 +24,6 @@ // File : OperationGUI_FilletDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef DIALOGBOX_FILLET_H #define DIALOGBOX_FILLET_H @@ -45,8 +44,8 @@ class OperationGUI_FilletDlg : public GEOMBase_Skeleton Q_OBJECT public: - OperationGUI_FilletDlg( QWidget* parent ); - ~OperationGUI_FilletDlg(); + OperationGUI_FilletDlg(GeometryGUI* theGeometryGUI, QWidget* parent); + ~OperationGUI_FilletDlg(); protected: // redefined from GEOMBase_Helper @@ -55,19 +54,16 @@ protected: virtual bool execute( ObjectList& objects ); private slots: - void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ValueChangedInSpinBox( double newValue ); void ConstructorsClicked( int constructorId ); -private : - +private: void Init(); void enterEvent( QEvent* e ); void reset(); @@ -76,18 +72,16 @@ private : void enableWidgets(); double getRadius() const; -private : - +private: int myConstructorId; GEOM::GEOM_Object_var myShape; TColStd_IndexedMapOfInteger myEdges; TColStd_IndexedMapOfInteger myFaces; - + DlgRef_1Sel1Spin* Group1; DlgRef_2Sel1Spin* Group2; DlgRef_2Sel1Spin* Group3; }; #endif // DIALOGBOX_FILLET_H - diff --git a/src/OperationGUI/OperationGUI_MaterialDlg.cxx b/src/OperationGUI/OperationGUI_MaterialDlg.cxx index f45286053..b92dd5efb 100644 --- a/src/OperationGUI/OperationGUI_MaterialDlg.cxx +++ b/src/OperationGUI/OperationGUI_MaterialDlg.cxx @@ -47,15 +47,16 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -OperationGUI_MaterialDlg::OperationGUI_MaterialDlg (QWidget* parent, const char* name, - GEOM::ListOfGO ListShapes, +OperationGUI_MaterialDlg::OperationGUI_MaterialDlg (GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, GEOM::ListOfGO ListShapes, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { myListShapes = ListShapes; myParentDlg = parent; - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PARTITION"))); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PARTITION"))); setCaption(tr("GEOM_MATERIAL_TITLE")); @@ -79,11 +80,10 @@ OperationGUI_MaterialDlg::OperationGUI_MaterialDlg (QWidget* parent, const char* /***************************************************************/ setHelpFileName("none.htm"); - + Init(); } - //================================================================================= // function : ~OperationGUI_MaterialDlg() // purpose : Destroys the object and frees any allocated resources @@ -93,7 +93,6 @@ OperationGUI_MaterialDlg::~OperationGUI_MaterialDlg() // no need to delete child widgets, Qt does it all for us } - //================================================================================= // function : Init() // purpose : @@ -130,20 +129,8 @@ void OperationGUI_MaterialDlg::Init() connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetMaterial())); -// connect(GroupPoints->ListView1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); -// connect(GroupPoints->SpinBox1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - /* displays Dialog */ - MESSAGE("GroupPoints->show() ..."); - GroupPoints->show(); - MESSAGE("this->show() ..."); - this->show(); - MESSAGE("return"); - - return; } @@ -184,17 +171,17 @@ void OperationGUI_MaterialDlg::ClickOnOk() //================================================================================= void OperationGUI_MaterialDlg::SelectionIntoArgument() { - QString aString = ""; /* name of selection */ + /*QString aString = ""; // name of selection - int nbSel = myGeomBase->GetNameOfSelectedIObjects(selectedIO(), aString); - if(nbSel < 1) { + int nbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aString); + if (nbSel < 1) { return; } //myGeomBase->ConvertListOfIOInListOfIOR(selectedIO(), myListShapes); - /* no simulation */ - return; + // no simulation + return;*/ } @@ -235,6 +222,6 @@ void OperationGUI_MaterialDlg::ActivateThisDialog() //================================================================================= void OperationGUI_MaterialDlg::enterEvent(QEvent* e) { - if(!GroupConstructors->isEnabled()) + if (!GroupConstructors->isEnabled()) this->ActivateThisDialog(); } diff --git a/src/OperationGUI/OperationGUI_MaterialDlg.h b/src/OperationGUI/OperationGUI_MaterialDlg.h index a57dfe514..ae073e4f1 100644 --- a/src/OperationGUI/OperationGUI_MaterialDlg.h +++ b/src/OperationGUI/OperationGUI_MaterialDlg.h @@ -23,7 +23,6 @@ // File : OperationGUI_MaterialDlg.h // Author : Julia DOROVSKIKH // Module : GEOM -// $Header$ #ifndef DIALOGBOX_MATERIAL_H #define DIALOGBOX_MATERIAL_H @@ -41,8 +40,8 @@ class OperationGUI_MaterialDlg : public GEOMBase_Skeleton Q_OBJECT public: - OperationGUI_MaterialDlg (QWidget* parent, const char* name, - GEOM::ListOfGO ListShapes, + OperationGUI_MaterialDlg (GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, GEOM::ListOfGO ListShapes, bool modal = FALSE, WFlags fl = 0); ~OperationGUI_MaterialDlg(); @@ -52,8 +51,8 @@ private: QWidget* myParentDlg; - GEOM::ListOfGO myListShapes; - GEOM::ListOfLong myListMaterials; + GEOM::ListOfGO myListShapes; + GEOM::ListOfLong myListMaterials; DlgRef_1List1Spin1Btn_QTD* GroupPoints; @@ -65,7 +64,6 @@ private slots: void ActivateThisDialog(); void SelectionIntoArgument(); void SetMaterial(); - }; #endif // DIALOGBOX_MATERIAL_H diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index fc2281467..f27e91962 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -49,12 +49,14 @@ // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI, QWidget* parent) + :GEOMBase_Skeleton(theGeometryGUI, parent, "OperationGUI_PartitionDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PARTITION"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PARTITION_PLANE"))); - QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION_PLANE"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); setCaption(tr("GEOM_PARTITION_TITLE")); @@ -137,7 +139,7 @@ void OperationGUI_PartitionDlg::Init() connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_PARTITION" ) ); @@ -151,7 +153,7 @@ void OperationGUI_PartitionDlg::Init() //================================================================================= void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId) { - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); globalSelection(); myListShapes.length(0); @@ -188,14 +190,14 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId) break; } } - + myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->LineEdit1->clear(); GroupPoints->LineEdit2->clear(); onRemoveWebs(false); myEditCurrentArgument->setFocus(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); MESSAGE(width()<<" "<LineEdit1 || send == GroupPoints->LineEdit2 || send == GroupPoints->LineEdit3 || @@ -355,30 +347,20 @@ void OperationGUI_PartitionDlg::LineEditReturnPressed() void OperationGUI_PartitionDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void OperationGUI_PartitionDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : //================================================================================= void OperationGUI_PartitionDlg::enterEvent(QEvent* e) { - if(!GroupConstructors->isEnabled()) + if (!GroupConstructors->isEnabled()) this->ActivateThisDialog(); } @@ -399,8 +381,8 @@ GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation() //================================================================================= bool OperationGUI_PartitionDlg::isValid( QString& msg ) { - return (myListShapes.length() || myListTools.length() || - myListKeepInside.length() || myListRemoveInside.length()); + return (myListShapes.length() || myListTools.length() || + myListKeepInside.length() || myListRemoveInside.length()); } @@ -411,35 +393,30 @@ bool OperationGUI_PartitionDlg::isValid( QString& msg ) bool OperationGUI_PartitionDlg::execute( ObjectList& objects ) { bool res = false; - + GEOM::GEOM_Object_var anObj; QString msg; - + int aLimit = GetLimit(); int aConstructorId = getConstructorId(); - - if (aConstructorId==1) + + if (aConstructorId == 1) aLimit = GEOM::SHAPE; - - if (isValid( msg )) - { - - if ( aConstructorId==0 && !toRemoveWebs() ) - myListMaterials.length(0); - - anObj = GEOM::GEOM_IBooleanOperations::_narrow( getOperation() )->MakePartition(myListShapes, - myListTools, - myListKeepInside, - myListRemoveInside, - aLimit, - toRemoveWebs(), - myListMaterials); - res = true; - } - - if ( !anObj->_is_nil() ) + + if (isValid( msg )) { + if (aConstructorId == 0 && !toRemoveWebs()) + myListMaterials.length(0); + + anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())-> + MakePartition(myListShapes, myListTools, + myListKeepInside, myListRemoveInside, + aLimit, toRemoveWebs(), myListMaterials); + res = true; + } + + if (!anObj->_is_nil()) objects.push_back( anObj._retn() ); - + return res; } @@ -458,7 +435,6 @@ void OperationGUI_PartitionDlg::closeEvent( QCloseEvent* e ) //function : ComboTextChanged //purpose : //======================================================================= - void OperationGUI_PartitionDlg::ComboTextChanged() { bool IsEnabled = GroupPoints->ComboBox1->currentItem() < 3; @@ -477,11 +453,9 @@ void OperationGUI_PartitionDlg::ComboTextChanged() //================================================================================= void OperationGUI_PartitionDlg::SetMaterials() { - MESSAGE("OperationGUI_MaterialDlg ..."); - OperationGUI_MaterialDlg *aDlg = - new OperationGUI_MaterialDlg(this, "", myListShapes, true); - MESSAGE("OperationGUI_MaterialDlg"); - return; + OperationGUI_MaterialDlg* aDlg = + new OperationGUI_MaterialDlg(myGeomGUI, this, "", myListShapes, true); + aDlg->show(); } @@ -515,42 +489,17 @@ bool OperationGUI_PartitionDlg::toRemoveWebs() const int OperationGUI_PartitionDlg::GetLimit() const { int aLimit = GroupPoints->ComboBox1->currentItem(); - + switch(aLimit) - { - case 0 : - { - aLimit = GEOM::SOLID; - break; - } - case 1 : - { - aLimit = GEOM::SHELL; - break; - } - case 2 : - { - aLimit = GEOM::FACE; - break; - } - case 3 : - { - aLimit = GEOM::WIRE; - break; - } - case 4 : - { - aLimit = GEOM::EDGE; - break; - } - case 5 : - { - aLimit = GEOM::VERTEX; - break; - } - default : - aLimit = GEOM::SHAPE; - } - + { + case 0: aLimit = GEOM::SOLID ; break; + case 1: aLimit = GEOM::SHELL ; break; + case 2: aLimit = GEOM::FACE ; break; + case 3: aLimit = GEOM::WIRE ; break; + case 4: aLimit = GEOM::EDGE ; break; + case 5: aLimit = GEOM::VERTEX; break; + default: aLimit = GEOM::SHAPE ; + } + return aLimit; } diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.h b/src/OperationGUI/OperationGUI_PartitionDlg.h index 1599bf1a8..2bf96727e 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.h +++ b/src/OperationGUI/OperationGUI_PartitionDlg.h @@ -24,7 +24,6 @@ // File : OperationGUI_PartitionDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_PARTITION_H #define DIALOGBOX_PARTITION_H @@ -32,7 +31,6 @@ #include "GEOMBase_Skeleton.h" #include "DlgRef_4Sel1List1Check_QTD.h" - //================================================================================= // class : OperationGUI_PartitionDlg // purpose : @@ -42,7 +40,7 @@ class OperationGUI_PartitionDlg : public GEOMBase_Skeleton Q_OBJECT public: - OperationGUI_PartitionDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0); ~OperationGUI_PartitionDlg(); void SetListMaterials(GEOM::ListOfLong ListMaterials) @@ -64,21 +62,19 @@ private: void enterEvent(QEvent* e); bool toRemoveWebs() const; int GetLimit() const; - - GEOM::ListOfGO myListShapes; - GEOM::ListOfLong myListMaterials; - GEOM::ListOfGO myListTools; - GEOM::ListOfGO myListRemoveInside; - GEOM::ListOfGO myListKeepInside; - + + GEOM::ListOfGO myListShapes; + GEOM::ListOfLong myListMaterials; + GEOM::ListOfGO myListTools; + GEOM::ListOfGO myListRemoveInside; + GEOM::ListOfGO myListKeepInside; + DlgRef_4Sel1List1Check_QTD* GroupPoints; private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 93695ad27..ea5ead082 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -49,8 +49,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(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) +PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ"))); @@ -127,6 +129,7 @@ void PrimitiveGUI_BoxDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int))); connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); @@ -139,9 +142,9 @@ void PrimitiveGUI_BoxDlg::Init() connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -217,16 +220,6 @@ bool PrimitiveGUI_BoxDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void PrimitiveGUI_BoxDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed @@ -325,16 +318,6 @@ void PrimitiveGUI_BoxDlg::enterEvent(QEvent* e) } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void PrimitiveGUI_BoxDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ValueChangedInSpinBox() // purpose : diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h index 51d8ecedd..85bcdba10 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h @@ -24,7 +24,6 @@ // File : PrimitiveGUI_BoxDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_BOX_H #define DIALOGBOX_BOX_H @@ -43,8 +42,9 @@ class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton { Q_OBJECT - public: - PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); +public: + PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~PrimitiveGUI_BoxDlg(); protected: @@ -59,8 +59,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */ DlgRef_2Sel_QTD* GroupPoints; @@ -69,15 +67,12 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ConstructorsClicked(int); void ValueChangedInSpinBox(); - }; #endif // DIALOGBOX_BOX_H diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 8b2d5ac53..ef84b1033 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -48,8 +48,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(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) +PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_DXYZ"))); @@ -150,12 +152,12 @@ void PrimitiveGUI_ConeDlg::Init() connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DZ, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h index 17d913e25..8699feafe 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h @@ -24,7 +24,6 @@ // File : PrimitiveGUI_ConeDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CONE_H #define DIALOGBOX_CONE_H @@ -42,7 +41,8 @@ class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton Q_OBJECT public: - PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~PrimitiveGUI_ConeDlg(); protected: @@ -60,8 +60,6 @@ private: double getRadius2() const; double getHeight() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir; DlgRef_2Sel3Spin* GroupPoints; @@ -78,7 +76,6 @@ private slots: void SetEditCurrentArgument(); void ConstructorsClicked(int); void ValueChangedInSpinBox(); - }; #endif // DIALOGBOX_CONE_H diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 44dda14d4..69ca3cb23 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -48,8 +48,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(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) +PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ"))); @@ -145,10 +147,10 @@ void PrimitiveGUI_CylinderDlg::Init() connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h index 3ed400a0e..f4e4384d2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h @@ -24,7 +24,6 @@ // File : PrimitiveGUI_CylinderDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CYLINDER_H #define DIALOGBOX_CYLINDER_H @@ -43,7 +42,8 @@ class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton Q_OBJECT public: - PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~PrimitiveGUI_CylinderDlg(); protected: @@ -60,8 +60,6 @@ private: double getRadius() const; double getHeight() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir; DlgRef_2Sel2Spin* GroupPoints; diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 49785f86f..debdb9a85 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -48,8 +48,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(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) +PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_DXYZ"))); @@ -126,9 +128,9 @@ void PrimitiveGUI_SphereDlg::Init() connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h index 10042e22f..03d34cff3 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h @@ -24,7 +24,6 @@ // File : PrimitiveGUI_SphereDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_SPHERE_H #define DIALOGBOX_SPHERE_H @@ -43,7 +42,8 @@ class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton Q_OBJECT public: - PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~PrimitiveGUI_SphereDlg(); protected: @@ -54,13 +54,11 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); double getRadius() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint; /* Center point */ DlgRef_1Sel1Spin* GroupPoints; diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index 0e41fb4c1..9c32c9b64 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -48,13 +48,15 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(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) +PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - + setCaption(tr("GEOM_TORUS_TITLE")); /***************************************************************/ @@ -141,10 +143,10 @@ void PrimitiveGUI_TorusDlg::Init() connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double))); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; @@ -154,7 +156,6 @@ void PrimitiveGUI_TorusDlg::Init() } - //================================================================================= // function : ConstructorsClicked() // purpose : Radio button management diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index ef90ffbdf..5dace29e3 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -24,7 +24,6 @@ // File : PrimitiveGUI_TorusDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_TORUS_H #define DIALOGBOX_TORUS_H @@ -43,7 +42,8 @@ class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton Q_OBJECT public: - PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~PrimitiveGUI_TorusDlg(); protected: @@ -53,20 +53,18 @@ protected: virtual bool execute( ObjectList& objects ); virtual void closeEvent( QCloseEvent* e ); - + private: void Init(); void enterEvent(QEvent* e); double getRadius1() const; double getRadius2() const; - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myPoint, myDir; - + DlgRef_2Sel2Spin* GroupPoints; DlgRef_2Spin* GroupDimensions; - + private slots: void ClickOnOk(); bool ClickOnApply(); @@ -78,7 +76,6 @@ private: void SetEditCurrentArgument(); void ConstructorsClicked(int); void ValueChangedInSpinBox(); - }; #endif // DIALOGBOX_TORUS_H diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index fa4187134..9f0acb911 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -86,39 +86,19 @@ RepairGUI::~RepairGUI() bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) { getGeometryGUI()->EmitSignalDeactivateDialog(); - + QDialog* aDlg = NULL; switch (theCommandID) { - case 601: // SEWING - aDlg = new RepairGUI_SewingDlg( parent, "" ); - break; - case 602: // GLUE FACES - aDlg = new RepairGUI_GlueDlg( parent, "" ); - break; - case 603: // SUPPRESS FACES - aDlg = new RepairGUI_SuppressFacesDlg( parent, "" ); - break; - case 604: // SUPPRESS HOLES - aDlg = new RepairGUI_RemoveHolesDlg( parent, "" ); - break; - case 605: // SHAPE PROCESSING - aDlg = new RepairGUI_ShapeProcessDlg( parent, "" ); - break; - case 606: // CLOSE CONTOUR - aDlg = new RepairGUI_CloseContourDlg( parent, "" ); - break; - case 607: // REMOVE INTERNAL WIRES - aDlg = new RepairGUI_RemoveIntWiresDlg( parent, "" ); - break; - case 608: // ADD POINT ON EDGE - aDlg = new RepairGUI_DivideEdgeDlg( getGeometryGUI(), parent, "" ); - break; - case 609: // FREE BOUNDARIES - aDlg = new RepairGUI_FreeBoundDlg( getGeometryGUI(), parent ); - break; - case 610: // FREE FACES - aDlg = new RepairGUI_FreeFacesDlg( getGeometryGUI(), parent, "" ); - break; + case 601: aDlg = new RepairGUI_SewingDlg (getGeometryGUI(), parent, ""); break; + case 602: aDlg = new RepairGUI_GlueDlg (getGeometryGUI(), parent, ""); break; + case 603: aDlg = new RepairGUI_SuppressFacesDlg (getGeometryGUI(), parent, ""); break; + case 604: aDlg = new RepairGUI_RemoveHolesDlg (getGeometryGUI(), parent, ""); break; + case 605: aDlg = new RepairGUI_ShapeProcessDlg (getGeometryGUI(), parent, ""); break; + case 606: aDlg = new RepairGUI_CloseContourDlg (getGeometryGUI(), parent, ""); break; + case 607: aDlg = new RepairGUI_RemoveIntWiresDlg(getGeometryGUI(), parent, ""); break; + case 608: aDlg = new RepairGUI_DivideEdgeDlg (getGeometryGUI(), parent, ""); break; + case 609: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent, ""); break; + case 610: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent, ""); break; default: SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; @@ -126,7 +106,7 @@ bool RepairGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) if ( aDlg ) aDlg->show(); - + return true; } diff --git a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx index 8855ba7cb..76a818eaf 100644 --- a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx +++ b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx @@ -50,8 +50,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_CloseContourDlg::RepairGUI_CloseContourDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_CloseContourDlg::RepairGUI_CloseContourDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CLOSECONTOUR"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -133,10 +135,6 @@ void RepairGUI_CloseContourDlg::Init() initSelection(); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -145,7 +143,7 @@ void RepairGUI_CloseContourDlg::Init() connect(mySelectWiresBtn, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(mySelectWiresEdt, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "CLOSE_CONTOUR_NEW_OBJ_NAME" ) ); @@ -185,16 +183,6 @@ bool RepairGUI_CloseContourDlg::ClickOnApply() return true; } - -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_CloseContourDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -223,7 +211,7 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument() { myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) ); TopoDS_Shape aShape; - if ( myGeomBase->GetShape( myObject, aShape, TopAbs_WIRE ) ) + if ( GEOMBase::GetShape( myObject, aShape, TopAbs_WIRE ) ) mySelectWiresEdt->setText( myEditCurrentArgument->text() ); } else @@ -232,7 +220,7 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument() else if ( myEditCurrentArgument == mySelectWiresEdt ) { TColStd_IndexedMapOfInteger aMap; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); + myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap ); const int n = aMap.Extent(); myWiresInd->length( n ); for ( int i = 1; i <= n; i++ ) @@ -278,17 +266,6 @@ void RepairGUI_CloseContourDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_CloseContourDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : @@ -296,7 +273,7 @@ void RepairGUI_CloseContourDlg::DeactivateActiveDialog() void RepairGUI_CloseContourDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); myEditCurrentArgument = GroupPoints->LineEdit1; @@ -347,7 +324,7 @@ GEOM::GEOM_IOperations_ptr RepairGUI_CloseContourDlg::createOperation() bool RepairGUI_CloseContourDlg::isValid( QString& msg ) { TopoDS_Shape aTmpShape; - return !myObject->_is_nil() && ( myWiresInd->length() || myGeomBase->GetShape( myObject, aTmpShape, TopAbs_WIRE ) ); + return !myObject->_is_nil() && ( myWiresInd->length() || GEOMBase::GetShape( myObject, aTmpShape, TopAbs_WIRE ) ); } //================================================================================= @@ -396,5 +373,3 @@ void RepairGUI_CloseContourDlg::initSelection() localSelection( myObject, TopAbs_WIRE ); } } - - diff --git a/src/RepairGUI/RepairGUI_CloseContourDlg.h b/src/RepairGUI/RepairGUI_CloseContourDlg.h index 08c183664..a0470db76 100644 --- a/src/RepairGUI/RepairGUI_CloseContourDlg.h +++ b/src/RepairGUI/RepairGUI_CloseContourDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_CloseContourDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_CloseContour_H #define DIALOGBOX_CloseContour_H @@ -46,7 +45,8 @@ class RepairGUI_CloseContourDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_CloseContourDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_CloseContourDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_CloseContourDlg(); protected: @@ -55,7 +55,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); @@ -75,10 +75,8 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 1a0cb04cb..0a719ca7d 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -50,11 +50,9 @@ using namespace std; //================================================================================= RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) - : GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | + : GEOMBase_Skeleton(theGeometryGUI, 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"))); @@ -97,7 +95,6 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, Q Init(); } - //================================================================================= // function : ~RepairGUI_DivideEdgeDlg() // purpose : Destroys the object and frees any allocated resources @@ -106,7 +103,6 @@ RepairGUI_DivideEdgeDlg::~RepairGUI_DivideEdgeDlg() { } - //================================================================================= // function : Init() // purpose : @@ -123,10 +119,6 @@ void RepairGUI_DivideEdgeDlg::Init() initSelection(); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -172,16 +164,6 @@ bool RepairGUI_DivideEdgeDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_DivideEdgeDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -202,7 +184,7 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument() if ( !CORBA::is_nil( aSelectedObj ) && aRes ) { TopoDS_Shape aShape; - if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) + if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) ) { const int aType = aShape.ShapeType(); if ( aType <= TopAbs_EDGE ) // edge, wire, face, shell, solid, compound @@ -266,16 +248,6 @@ void RepairGUI_DivideEdgeDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_DivideEdgeDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h index 02cf3a262..b8f7ee85b 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_DivideEdgeDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_DivideEdge_H #define DIALOGBOX_DivideEdge_H @@ -57,7 +56,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); @@ -75,10 +74,8 @@ private : protected slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx index 136bbfe43..07ef99fb7 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx @@ -49,21 +49,20 @@ #define SPACING 5 #define MARGIN 10 -/* - Calss : RepairGUI_FreeBoundDlg +/*! + Class : RepairGUI_FreeBoundDlg Description : Dialog for displaying free boundaries of selected face, shell or solid */ - //================================================================================= // function : RepairGUI_FreeBoundDlg // purpose : Constructor //================================================================================= -RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg( GeometryGUI* theGUI, QWidget* theParent ) +RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg(GeometryGUI* theGUI, QWidget* theParent, const char*) : QDialog( theParent, "RepairGUI_FreeBoundDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), GEOMBase_Helper( dynamic_cast( theParent ) ), - myGeomGUI ( theGUI ) + myGeomGUI( theGUI ) { setCaption( tr( "CAPTION" ) ); @@ -137,10 +136,10 @@ void RepairGUI_FreeBoundDlg::onHelp() if (app) app->onHelpContextModule(myGeomGUI ? app->moduleName(myGeomGUI->moduleName()) : QString(""), myHelpFileName); else { - SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), - QObject::tr("BUT_OK")); + SUIT_MessageBox::warn1 + (0, tr("WRN_WARNING"), tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + tr("BUT_OK")); } } @@ -152,7 +151,7 @@ void RepairGUI_FreeBoundDlg::onDeactivate() { setEnabled(false); globalSelection(); - disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 ); + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); myGeomGUI->SetActiveDialogBox( 0 ); } @@ -191,7 +190,6 @@ void RepairGUI_FreeBoundDlg::onSelectionDone() myObj = anObj; displayPreview( false, true, true, 3 ); } - } //================================================================================= @@ -300,6 +298,3 @@ bool RepairGUI_FreeBoundDlg::execute( ObjectList& objects ) return result; } - - - diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.h b/src/RepairGUI/RepairGUI_FreeBoundDlg.h index b52c4f86a..8e82a1054 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.h +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_FreeBoundDlg.h // Author : Sergey LITONIN // Module : GEOM -// $Header$ #ifndef DIALOGBOX_WHATIS_H #define DIALOGBOX_WHATIS_H @@ -47,11 +46,10 @@ class RepairGUI_FreeBoundDlg : public QDialog, Q_OBJECT public: - RepairGUI_FreeBoundDlg( GeometryGUI*, QWidget* ); - ~RepairGUI_FreeBoundDlg(); + RepairGUI_FreeBoundDlg(GeometryGUI*, QWidget*, const char* name = 0); + ~RepairGUI_FreeBoundDlg(); private slots: - void onClose(); void onHelp(); void onDeactivate(); @@ -59,7 +57,6 @@ private slots: void onSelectionDone(); private: - void Init(); void enterEvent( QEvent* e ); void closeEvent( QCloseEvent* e ); @@ -70,7 +67,6 @@ private: virtual bool isValid( QString& ); private: - QLineEdit* myEdit; QLabel* myClosedLbl; QLabel* myOpenLbl; @@ -82,13 +78,3 @@ private: }; #endif // DIALOGBOX_WHATIS_H - - - - - - - - - - diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index 7481ae42a..a3565996e 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -66,11 +66,12 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg(GeometryGUI* GUI, QWidget* parent, const char* name, bool modal, WFlags fl) -:QDialog( parent, "RepairGUI_FreeBoundDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ), - GEOMBase_Helper( dynamic_cast( parent ) ), - myGeomGUI( GUI ) +RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg(GeometryGUI* GUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :QDialog(parent, "RepairGUI_FreeBoundDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose), + GEOMBase_Helper(dynamic_cast(parent)), + myGeomGUI(GUI) { myDisplayer = 0; diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.h b/src/RepairGUI/RepairGUI_FreeFacesDlg.h index 9376cc9a9..69b830314 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.h +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_FreeFacesDlg.h // Author : VKN // Module : GEOM -// $Header$ #ifndef DIALOGBOX_FreeFaces_H #define DIALOGBOX_FreeFaces_H @@ -47,7 +46,8 @@ class RepairGUI_FreeFacesDlg : public QDialog, Q_OBJECT public: - RepairGUI_FreeFacesDlg(GeometryGUI* GUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_FreeFacesDlg(GeometryGUI* GUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_FreeFacesDlg(); protected: @@ -56,32 +56,28 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : - +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); void activateSelection(); - GEOM_Displayer* getDisplayer(); + GEOM_Displayer* getDisplayer(); private slots: + void onClose(); + void onHelp(); + void onDeactivate(); + void onActivate(); + void onSelectionDone(); + void onSetEditCurrentArgument(); - void onClose(); - void onHelp(); - void onDeactivate(); - void onActivate(); - void onSelectionDone(); - void onSetEditCurrentArgument(); - -private : - +private: GEOM_Displayer* myDisplayer; GEOM::GEOM_Object_var myObj; QPushButton* mySelBtn; QLineEdit* myEdit; GeometryGUI* myGeomGUI; QString myHelpFileName; - }; #endif // DIALOGBOX_FreeFaces_H diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index 35aa7d6e2..aec6d8cdb 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -58,11 +58,13 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_GlueDlg::RepairGUI_GlueDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_GlueDlg::RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_GLUE_TITLE")); @@ -82,7 +84,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg(QWidget* parent, const char* name, bool mod QGridLayout* aLay = new QGridLayout( 0, 2, 2, 0, 6, "aLay" ); QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->GroupBox1 ); - myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, GroupPoints->GroupBox1 );//QAD_SpinBoxDbl( GroupPoints->GroupBox1, 0, 100, 1e-7, 10, 1e-10 ); + myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, GroupPoints->GroupBox1 ); myTolEdt->setPrecision( 10 ); myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE ); @@ -122,10 +124,6 @@ void RepairGUI_GlueDlg::Init() globalSelection( GEOM_COMPOUND ); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -150,7 +148,6 @@ void RepairGUI_GlueDlg::ClickOnOk() } - //================================================================================= // function : ClickOnApply() // purpose : @@ -171,16 +168,6 @@ bool RepairGUI_GlueDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_GlueDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection @@ -228,17 +215,6 @@ void RepairGUI_GlueDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_GlueDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/RepairGUI/RepairGUI_GlueDlg.h b/src/RepairGUI/RepairGUI_GlueDlg.h index 2c493dfa5..9e505c3d1 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.h +++ b/src/RepairGUI/RepairGUI_GlueDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_GlueDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_Glue_H #define DIALOGBOX_Glue_H @@ -43,7 +42,8 @@ class RepairGUI_GlueDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_GlueDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_GlueDlg(); protected: @@ -52,7 +52,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); @@ -70,10 +70,8 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx index 6ef473a8a..0bc38c1df 100644 --- a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx @@ -49,8 +49,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_RemoveHolesDlg::RepairGUI_RemoveHolesDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_RemoveHolesDlg::RepairGUI_RemoveHolesDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPPRESS_HOLES"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -138,10 +140,6 @@ void RepairGUI_RemoveHolesDlg::Init() myOpen = -1; /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -170,8 +168,6 @@ void RepairGUI_RemoveHolesDlg::ClickOnOk() ClickOnCancel(); } - - //================================================================================= // function : ClickOnApply() // purpose : @@ -195,16 +191,6 @@ bool RepairGUI_RemoveHolesDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_RemoveHolesDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection @@ -278,17 +264,6 @@ void RepairGUI_RemoveHolesDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_RemoveHolesDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/RepairGUI/RepairGUI_RemoveHolesDlg.h b/src/RepairGUI/RepairGUI_RemoveHolesDlg.h index 42edf5b6e..fca7592b2 100644 --- a/src/RepairGUI/RepairGUI_RemoveHolesDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveHolesDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_RemoveHolesDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_RemoveHoles_H #define DIALOGBOX_RemoveHoles_H @@ -48,7 +47,8 @@ class RepairGUI_RemoveHolesDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_RemoveHolesDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_RemoveHolesDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_RemoveHolesDlg(); protected: @@ -57,7 +57,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); @@ -73,16 +73,14 @@ private : QLineEdit* mySelectWiresEdt; QPushButton* myFreeBoundBtn; - int myClosed; // number of free closed boundaries detected. calculated in execute(), used in onDetect(). - int myOpen; // number of free open boundaries detected. calculated in execute(), used in onDetect(). + int myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect(). + int myOpen; // Number of free open boundaries detected. Calculated in execute(), used in onDetect(). private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx index d053ce9af..3acf067e1 100644 --- a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx @@ -47,11 +47,13 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_RemoveIntWiresDlg::RepairGUI_RemoveIntWiresDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_RemoveIntWiresDlg::RepairGUI_RemoveIntWiresDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPPRESS_INT_WIRES"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + QPixmap image0 (myGeomGUI->getApp()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPPRESS_INT_WIRES"))); + QPixmap image1 (myGeomGUI->getApp()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_REMOVE_INTERNAL_WIRES_TITLE")); @@ -126,10 +128,6 @@ void RepairGUI_RemoveIntWiresDlg::Init() initSelection(); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -157,8 +155,6 @@ void RepairGUI_RemoveIntWiresDlg::ClickOnOk() ClickOnCancel(); } - - //================================================================================= // function : ClickOnApply() // purpose : @@ -182,16 +178,6 @@ bool RepairGUI_RemoveIntWiresDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_RemoveIntWiresDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection @@ -265,17 +251,6 @@ void RepairGUI_RemoveIntWiresDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_RemoveIntWiresDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : @@ -296,7 +271,6 @@ void RepairGUI_RemoveIntWiresDlg::ActivateThisDialog() initSelection(); } - //================================================================================= // function : enterEvent() // purpose : Mouse enter onto the dialog to activate it @@ -307,7 +281,6 @@ void RepairGUI_RemoveIntWiresDlg::enterEvent(QEvent* e) ActivateThisDialog(); } - //================================================================================= // function : closeEvent() // purpose : @@ -342,12 +315,13 @@ bool RepairGUI_RemoveIntWiresDlg::isValid( QString& msg ) //================================================================================= bool RepairGUI_RemoveIntWiresDlg::execute( ObjectList& objects ) { - GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->RemoveIntWires( myObject, myWiresInd ); - bool aResult = !anObj->_is_nil(); - if ( aResult ) - objects.push_back( anObj._retn() ); + GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )-> + RemoveIntWires( myObject, myWiresInd ); + bool aResult = !anObj->_is_nil(); + if ( aResult ) + objects.push_back( anObj._retn() ); - return aResult; + return aResult; } //================================================================================= @@ -356,7 +330,7 @@ bool RepairGUI_RemoveIntWiresDlg::execute( ObjectList& objects ) //================================================================================= void RepairGUI_RemoveIntWiresDlg::onRemoveAllClicked() { - bool b = myAllChk->isOn(); + bool b = myAllChk->isOn(); mySelectWiresLbl->setEnabled( !b ); mySelectWiresBtn->setEnabled( !b ); mySelectWiresEdt->setEnabled( !b ); @@ -389,5 +363,3 @@ void RepairGUI_RemoveIntWiresDlg::initSelection() localSelection( myObject, TopAbs_WIRE ); } } - - diff --git a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.h b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.h index 2142784a3..051bfd97a 100644 --- a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_RemoveIntWiresDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_RemoveIntWires_H #define DIALOGBOX_RemoveIntWires_H @@ -48,7 +47,8 @@ class RepairGUI_RemoveIntWiresDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_RemoveIntWiresDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_RemoveIntWiresDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_RemoveIntWiresDlg(); protected: @@ -57,14 +57,14 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); void initSelection(); - GEOM::GEOM_Object_var myObject; - GEOM::short_array_var myWiresInd; + GEOM::GEOM_Object_var myObject; + GEOM::short_array_var myWiresInd; DlgRef_1Sel_Ext* GroupPoints; QCheckBox* myAllChk; @@ -75,10 +75,8 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index c7d1fc76f..fe1c1ef5e 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -50,8 +50,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_SewingDlg::RepairGUI_SewingDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_SewingDlg::RepairGUI_SewingDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SEWING"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -120,10 +122,6 @@ void RepairGUI_SewingDlg::Init() myOpen = -1; /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -149,8 +147,6 @@ void RepairGUI_SewingDlg::ClickOnOk() ClickOnCancel(); } - - //================================================================================= // function : ClickOnApply() // purpose : @@ -171,16 +167,6 @@ bool RepairGUI_SewingDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_SewingDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection @@ -231,17 +217,6 @@ void RepairGUI_SewingDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_SewingDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/RepairGUI/RepairGUI_SewingDlg.h b/src/RepairGUI/RepairGUI_SewingDlg.h index c2c459507..9331db1a4 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.h +++ b/src/RepairGUI/RepairGUI_SewingDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_SewingDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_Sewing_H #define DIALOGBOX_Sewing_H @@ -49,7 +48,8 @@ class RepairGUI_SewingDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_SewingDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_SewingDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_SewingDlg(); protected: @@ -58,7 +58,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& objects ); -private : +private: void Init(); void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); @@ -70,16 +70,14 @@ private : QtxDblSpinBox* myTolEdt; QPushButton* myFreeBoundBtn; - int myClosed; // number of free closed boundaries detected. calculated in execute(), used in onDetect(). - int myOpen; // number of free open boundaries detected. calculated in execute(), used in onDetect(). + int myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect(). + int myOpen; // Number of free open boundaries detected. Calculated in execute(), used in onDetect(). private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 2d063a434..d8f8fa39d 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -52,14 +52,15 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_ShapeProcessDlg::RepairGUI_ShapeProcessDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_ShapeProcessDlg::RepairGUI_ShapeProcessDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setHelpFileName("shape_processing.htm"); init(); } - //================================================================================= // function : ~RepairGUI_ShapeProcessDlg() // purpose : Destroys the object and frees any allocated resources @@ -68,7 +69,6 @@ RepairGUI_ShapeProcessDlg::~RepairGUI_ShapeProcessDlg() { } - //================================================================================= // function : Init() // purpose : @@ -297,10 +297,6 @@ void RepairGUI_ShapeProcessDlg::init() myStack->addWidget( aFrame, myOpLst.findIndex( "SameParameter" ) ); // signals and slots connections - connect( myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(deactivate()) ); - connect( myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onCancel()) ); - - connect( buttonCancel, SIGNAL(clicked()), this, SLOT(onCancel()) ); connect( buttonOk, SIGNAL(clicked()), this, SLOT(onOk()) ); connect( buttonApply, SIGNAL(clicked()), this, SLOT(onApply()) ); @@ -342,12 +338,10 @@ void RepairGUI_ShapeProcessDlg::operationChanged() //================================================================================= void RepairGUI_ShapeProcessDlg::onOk() { - if ( onApply() ) - onCancel(); + if (onApply()) + ClickOnCancel(); } - - //================================================================================= // function : onApply() // purpose : @@ -366,16 +360,6 @@ bool RepairGUI_ShapeProcessDlg::onApply() } -//================================================================================= -// function : onCancel() -// purpose : -//================================================================================= -void RepairGUI_ShapeProcessDlg::onCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : selectionChanged() // purpose : Called when selection as changed or other case @@ -424,17 +408,6 @@ void RepairGUI_ShapeProcessDlg::lineEditReturnPressed() } -//================================================================================= -// function : deactivate() -// purpose : -//================================================================================= -void RepairGUI_ShapeProcessDlg::deactivate() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : activate() // purpose : @@ -843,6 +816,8 @@ void RepairGUI_ShapeProcessDlg::advOptionToggled( bool on ) { QButton* btn = (QButton*)sender(); if ( on && btn->isToggleButton() && - QMessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(), tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) + QMessageBox::warning(myGeomGUI->getApp()->desktop(), + tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ), + QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) btn->toggle(); } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h index 656ab7afa..adf359577 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_ShapeProcessDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_ShapeProcess_H #define DIALOGBOX_ShapeProcess_H @@ -52,7 +51,8 @@ class RepairGUI_ShapeProcessDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_ShapeProcessDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_ShapeProcessDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_ShapeProcessDlg(); protected: @@ -63,14 +63,15 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void init(); void reset(); void loadDefaults(); // initialize all controls with default values (from resource file) - GEOM::string_array* getActiveOperators(); - GEOM::string_array* getParameters( const GEOM::string_array& theOperators ); - GEOM::string_array* getValues( const GEOM::string_array& theParameters ); - + + GEOM::string_array* getActiveOperators(); + GEOM::string_array* getParameters( const GEOM::string_array& theOperators ); + GEOM::string_array* getValues( const GEOM::string_array& theParameters ); + void enterEvent(QEvent* e); QWidget* getControl( const char* ); @@ -78,7 +79,7 @@ private : // (analize its class and convert the value string) const char* getValue( QWidget* theControl ) const; // retrieve value of the control in the proper way - QStringList myOpLst; // list of available Shape Healing Operators + QStringList myOpLst; // list of available Shape Healing Operators QMap myValMap; // map of parameters of operators //QDict myCtrlMap; // map of controls (values) of parameters void initParamsValues(); // initialize the data structures @@ -90,27 +91,27 @@ private : QListView* myOpList; QWidgetStack* myStack; - QtxDblSpinBox* myFixShapeTol3D; - QtxDblSpinBox* myFixShapeMaxTol3D; - - QtxDblSpinBox* myFixFaceSizeTol; + QtxDblSpinBox* myFixShapeTol3D; + QtxDblSpinBox* myFixShapeMaxTol3D; - QtxDblSpinBox* myDropSmallEdgesTol3D; + QtxDblSpinBox* myFixFaceSizeTol; - QtxDblSpinBox* mySplitAngleAngle; - QtxDblSpinBox* mySplitAngleMaxTol; + QtxDblSpinBox* myDropSmallEdgesTol3D; + + QtxDblSpinBox* mySplitAngleAngle; + QtxDblSpinBox* mySplitAngleMaxTol; QSpinBox* mySplitClosedFacesNum; - QtxDblSpinBox* mySplitContTol3D; + QtxDblSpinBox* mySplitContTol3D; QComboBox* mySplitContSurfCont; QComboBox* mySplitContCurvCont; QCheckBox* myBSplineSurfModeChk; QCheckBox* myBSpline3DCurveChk; QCheckBox* myBSpline2DCurveChk; - QtxDblSpinBox* myBSplineTol3D; - QtxDblSpinBox* myBSplineTol2D; + QtxDblSpinBox* myBSplineTol3D; + QtxDblSpinBox* myBSplineTol2D; QSpinBox* myBSplineDegree; QSpinBox* myBSplineSegments; QComboBox* myBSpline2DCont; @@ -119,17 +120,15 @@ private : QCheckBox* myToBezierSurfModeChk; QCheckBox* myToBezier3DCurveChk; QCheckBox* myToBezier2DCurveChk; - QtxDblSpinBox* myToBezierMaxTol; + QtxDblSpinBox* myToBezierMaxTol; - QtxDblSpinBox* mySameParameterTol3D; + QtxDblSpinBox* mySameParameterTol3D; private slots: void onOk(); bool onApply(); - void onCancel(); - + void activate(); - void deactivate(); void lineEditReturnPressed(); void selectionChanged(); diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 3e2c0205e..945f0714b 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -48,8 +48,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +RepairGUI_SuppressFacesDlg::RepairGUI_SuppressFacesDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SUPRESS_FACE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -102,10 +104,6 @@ void RepairGUI_SuppressFacesDlg::Init() initSelection(); /* signals and slots connections */ - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -129,8 +127,6 @@ void RepairGUI_SuppressFacesDlg::ClickOnOk() ClickOnCancel(); } - - //================================================================================= // function : ClickOnApply() // purpose : @@ -152,16 +148,6 @@ bool RepairGUI_SuppressFacesDlg::ClickOnApply() } -//================================================================================= -// function : ClickOnCancel() -// purpose : -//================================================================================= -void RepairGUI_SuppressFacesDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -183,14 +169,14 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() if ( !CORBA::is_nil( aSelectedObject ) && aRes ) { TopoDS_Shape aShape; - if ( myGeomBase->GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) ) + if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) ) { if ( aShape.ShapeType() <= TopAbs_FACE ) // FACE, SHELL, SOLID, COMPOUND { GEOM::short_array anIndexes; TColStd_IndexedMapOfInteger aMap; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); + myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap ); if ( !aMap.IsEmpty() ) { @@ -249,17 +235,6 @@ void RepairGUI_SuppressFacesDlg::LineEditReturnPressed() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void RepairGUI_SuppressFacesDlg::DeactivateActiveDialog() -{ - //myGeomGUI->SetState( -1 ); - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h index e725f0e64..0c54ab681 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h @@ -24,7 +24,6 @@ // File : RepairGUI_SuppressFacesDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_SUPPRESSFACES_H #define DIALOGBOX_SUPPRESSFACES_H @@ -43,7 +42,8 @@ class RepairGUI_SuppressFacesDlg : public GEOMBase_Skeleton Q_OBJECT public: - RepairGUI_SuppressFacesDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + RepairGUI_SuppressFacesDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~RepairGUI_SuppressFacesDlg(); protected: @@ -57,25 +57,23 @@ private : void enterEvent(QEvent* e); void closeEvent(QCloseEvent* e); - GEOM::ListOfGO_var myObjects; - QValueList myFaces; - // GEOM::short_array-s contain indexes of selected faces, - // index of a GEOM::short_array in myFaces list equals to index of - // GEOM::GEOM_Object in myObjects list to which the faces belong to. - - void Convert( const TColStd_IndexedMapOfInteger&, GEOM::short_array& ); + GEOM::ListOfGO_var myObjects; + QValueList myFaces; + // GEOM::short_array-s contain indexes of selected faces, + // index of a GEOM::short_array in myFaces list equals to index of + // GEOM::GEOM_Object in myObjects list to which the faces belong to. + + void Convert( const TColStd_IndexedMapOfInteger&, GEOM::short_array& ); + + void initSelection(); - void initSelection(); - DlgRef_1Sel_QTD* GroupPoints; private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); - + void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 84c79078f..5dfdd8955 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -86,53 +86,35 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) QDialog* aDlg = NULL; switch (theCommandID) - { - case 5021: // TRANSLATION - { - aDlg = new TransformationGUI_TranslationDlg( getGeometryGUI(), parent, "" ); - break; - } - case 5022: // ROTATION - { - aDlg = new TransformationGUI_RotationDlg( parent, "" ); - break; - } - case 5023: // POSITION - { - aDlg = new TransformationGUI_PositionDlg( parent, "" ); - break; - } - case 5024: // MIRROR - { - aDlg = new TransformationGUI_MirrorDlg( parent, "" ); - break; - } - case 5025: // SCALE - { - aDlg = new TransformationGUI_ScaleDlg( getGeometryGUI(), parent, "" ); - break; - } - case 5026: // OFFSET - { - aDlg = new TransformationGUI_OffsetDlg( parent, "" ); - break; - } - case 5027: // MULTI TRANSLATION - { - aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent, "" ); - break; - } - case 5028: // MULTI ROTATION - { - aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" ); - break; - } - default: - { - SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); - break; - } - } + { + case 5021: // TRANSLATION + aDlg = new TransformationGUI_TranslationDlg( getGeometryGUI(), parent, "" ); + break; + case 5022: // ROTATION + aDlg = new TransformationGUI_RotationDlg( getGeometryGUI(), parent, "" ); + break; + case 5023: // POSITION + aDlg = new TransformationGUI_PositionDlg( getGeometryGUI(), parent, "" ); + break; + case 5024: // MIRROR + aDlg = new TransformationGUI_MirrorDlg( getGeometryGUI(), parent, "" ); + break; + case 5025: // SCALE + aDlg = new TransformationGUI_ScaleDlg( getGeometryGUI(), parent, "" ); + break; + case 5026: // OFFSET + aDlg = new TransformationGUI_OffsetDlg( getGeometryGUI(), parent, "" ); + break; + case 5027: // MULTI TRANSLATION + aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent, "" ); + break; + case 5028: // MULTI ROTATION + aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" ); + break; + default: + SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); + break; + } if ( aDlg != NULL ) aDlg->show(); diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index bfd31321d..240550bae 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -49,8 +49,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_MirrorDlg::TransformationGUI_MirrorDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +TransformationGUI_MirrorDlg::TransformationGUI_MirrorDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_MIRROR_POINT"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_MIRROR_AXE"))); @@ -125,7 +127,7 @@ void TransformationGUI_MirrorDlg::Init() connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_MIRROR" ) ); @@ -133,14 +135,13 @@ void TransformationGUI_MirrorDlg::Init() } - //================================================================================= // function : ConstructorsClicked() // purpose : Radio button management //================================================================================= void TransformationGUI_MirrorDlg::ConstructorsClicked(int constructorId) { - disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 ); + disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 ); globalSelection(); myEditCurrentArgument = GroupPoints->LineEdit1; @@ -165,7 +166,7 @@ void TransformationGUI_MirrorDlg::ConstructorsClicked(int constructorId) break; } } - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); } @@ -197,16 +198,6 @@ bool TransformationGUI_MirrorDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_MirrorDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection has changed @@ -311,22 +302,12 @@ void TransformationGUI_MirrorDlg::SetEditCurrentArgument() void TransformationGUI_MirrorDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_MirrorDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : when mouse enter onto the QWidget diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.h b/src/TransformationGUI/TransformationGUI_MirrorDlg.h index 150d3edae..44d71b1da 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.h +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_MirrorDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_MIRROR_H #define DIALOGBOX_MIRROR_H @@ -44,7 +43,8 @@ class TransformationGUI_MirrorDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_MirrorDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_MirrorDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_MirrorDlg(); protected: @@ -55,7 +55,7 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); @@ -67,9 +67,7 @@ private : private slots : void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 6a49dd150..c437f06e1 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -49,12 +49,15 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg(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) +TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg + (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_SIMPLE"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_DOUBLE"))); - QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_SIMPLE"))); + QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_MULTIROTATION_DOUBLE"))); + QPixmap image2(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_MULTIROTATION_TITLE")); @@ -154,15 +157,15 @@ void TransformationGUI_MultiRotationDlg::Init() connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX2, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double))); connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_MULTIROTATION" ) ); @@ -176,12 +179,12 @@ void TransformationGUI_MultiRotationDlg::Init() //================================================================================= void TransformationGUI_MultiRotationDlg::ConstructorsClicked(int constructorId) { - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); - + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + myAng = 45.0; myStep = 50.0; myNbTimes1 = myNbTimes2 = 2; - + globalSelection( GEOM_ALLSHAPES ); switch (constructorId) @@ -221,7 +224,8 @@ void TransformationGUI_MultiRotationDlg::ConstructorsClicked(int constructorId) myEditCurrentArgument->setFocus(); myBase = myVector = GEOM::GEOM_Object::_nil(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); } @@ -251,16 +255,6 @@ bool TransformationGUI_MultiRotationDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_MultiRotationDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -268,28 +262,32 @@ void TransformationGUI_MultiRotationDlg::ClickOnCancel() void TransformationGUI_MultiRotationDlg::SelectionIntoArgument() { myEditCurrentArgument->setText(""); - - if(IObjectCount() != 1) { - if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1) + + if (IObjectCount() != 1) { + if (myEditCurrentArgument == GroupPoints->LineEdit1 || + myEditCurrentArgument == GroupDimensions->LineEdit1) myBase = GEOM::GEOM_Object::_nil(); - else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2) + else if (myEditCurrentArgument == GroupPoints->LineEdit2 || + myEditCurrentArgument == GroupDimensions->LineEdit2) myVector = GEOM::GEOM_Object::_nil(); return; } - + // nbSel == 1 Standard_Boolean testResult = Standard_False;; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult ); + GEOM::GEOM_Object_var aSelectedObject = + GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult ); - if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) ) + if (!testResult || CORBA::is_nil(aSelectedObject) || !GEOMBase::IsShape(aSelectedObject)) return; - - if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1) + if (myEditCurrentArgument == GroupPoints->LineEdit1 || + myEditCurrentArgument == GroupDimensions->LineEdit1) myBase = aSelectedObject; - else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2) + else if (myEditCurrentArgument == GroupPoints->LineEdit2 || + myEditCurrentArgument == GroupDimensions->LineEdit2) myVector = aSelectedObject; - + myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) ); displayPreview(); @@ -349,23 +347,13 @@ void TransformationGUI_MultiRotationDlg::LineEditReturnPressed() void TransformationGUI_MultiRotationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_MultiRotationDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : @@ -423,7 +411,7 @@ void TransformationGUI_MultiRotationDlg::ReverseAngle() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); } @@ -451,7 +439,8 @@ bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects ) case 0 : { if ( !CORBA::is_nil( myBase ) && !CORBA::is_nil( myVector ) ) { - anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MultiRotate1D( myBase, myVector, myNbTimes1 ); + anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> + MultiRotate1D( myBase, myVector, myNbTimes1 ); res = true; } break; @@ -460,7 +449,8 @@ bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects ) { if ( !CORBA::is_nil( myBase ) && !CORBA::is_nil( myVector ) ) { - anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->MultiRotate2D( myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2 ); + anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )-> + MultiRotate2D( myBase, myVector, myAng, myNbTimes1, myStep, myNbTimes2 ); res = true; } break; diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index c122bc3eb..328819119 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_MultiRotationDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef DIALOGBOX_MULTIROTATION_H #define DIALOGBOX_MULTIROTATION_H @@ -43,7 +42,8 @@ class TransformationGUI_MultiRotationDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_MultiRotationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_MultiRotationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_MultiRotationDlg(); protected: @@ -58,8 +58,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myBase, myVector; int myNbTimes1; int myNbTimes2; @@ -72,16 +70,13 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void ReverseAngle(); void ValueChangedInSpinBox(double newValue); void ConstructorsClicked(int constructorId); - }; #endif // DIALOGBOX_MULTIROTATION_H diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 67cd8b213..7b67ebe5f 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -50,12 +50,15 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_MultiTranslationDlg::TransformationGUI_MultiTranslationDlg(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) +TransformationGUI_MultiTranslationDlg::TransformationGUI_MultiTranslationDlg + (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_SIMPLE"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_DLG_MULTITRANSLATION_DOUBLE"))); - QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTITRANSLATION_SIMPLE"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_MULTITRANSLATION_DOUBLE"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); setCaption(tr("GEOM_MULTITRANSLATION_TITLE")); @@ -165,18 +168,18 @@ void TransformationGUI_MultiTranslationDlg::Init() connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX2, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double))); connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU())); connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU())); connect(GroupDimensions->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(ReverseStepV())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -191,7 +194,7 @@ void TransformationGUI_MultiTranslationDlg::Init() //================================================================================= void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId) { - disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0); + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); myStepU = myStepV = 50.0; myNbTimesU = myNbTimesV = 2; @@ -238,7 +241,7 @@ void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorI myEditCurrentArgument->setFocus(); myBase = myVectorU = GEOM::GEOM_Object::_nil(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); } @@ -269,16 +272,6 @@ bool TransformationGUI_MultiTranslationDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_MultiTranslationDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -376,23 +369,13 @@ void TransformationGUI_MultiTranslationDlg::LineEditReturnPressed() void TransformationGUI_MultiTranslationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_MultiTranslationDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : @@ -479,7 +462,7 @@ void TransformationGUI_MultiTranslationDlg::ReverseStepV() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_MultiTranslationDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); } diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 8fd449628..792e19d1e 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_MultiTranslationDlg.h // Author : Damien COQUERET // Module : GEOM -// $Header$ #ifndef DIALOGBOX_MULTITRANSLATION_H #define DIALOGBOX_MULTITRANSLATION_H @@ -43,7 +42,8 @@ class TransformationGUI_MultiTranslationDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_MultiTranslationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_MultiTranslationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_MultiTranslationDlg(); protected: @@ -58,8 +58,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myBase, myVectorU, myVectorV ; int myNbTimesU; int myNbTimesV; @@ -72,9 +70,7 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); @@ -82,7 +78,6 @@ private slots: void ReverseStepV(); void ValueChangedInSpinBox(double newValue); void ConstructorsClicked(int constructorId); - }; #endif // DIALOGBOX_MULTITRANSLATION_H diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index f28000a1b..28713cbab 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -47,8 +47,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +TransformationGUI_OffsetDlg::TransformationGUI_OffsetDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_OFFSET"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -120,7 +122,7 @@ void TransformationGUI_OffsetDlg::Init() connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); @@ -158,16 +160,6 @@ bool TransformationGUI_OffsetDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_OffsetDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection has changed @@ -245,7 +237,7 @@ void TransformationGUI_OffsetDlg::enterEvent(QEvent * e) void TransformationGUI_OffsetDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); globalSelection( GEOM_ALLSHAPES ); myEditCurrentArgument = GroupPoints->LineEdit1; @@ -253,16 +245,6 @@ void TransformationGUI_OffsetDlg::ActivateThisDialog() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_OffsetDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : ValueChangedInSpinBox() // purpose : diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.h b/src/TransformationGUI/TransformationGUI_OffsetDlg.h index da127fbc0..2fd6a4a28 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.h +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_OffsetDlg.h // Author : Michael Zorin // Module : GEOM -// $Header: /dn05/salome/PAL/GEOM/GEOM_SRC/src/TransformationGUI/TransformationGUI_Offset.h #ifndef DIALOGBOX_OFFSET_H #define DIALOGBOX_OFFSET_H @@ -42,7 +41,8 @@ class TransformationGUI_OffsetDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_OffsetDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_OffsetDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_OffsetDlg(); protected: @@ -53,7 +53,7 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); double GetOffset() const; @@ -62,12 +62,10 @@ private : DlgRef_1Sel1Spin1Check* GroupPoints; -private slots : +private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void SelectionIntoArgument(); void LineEditReturnPressed(); void SetEditCurrentArgument(); @@ -76,4 +74,3 @@ private slots : }; #endif // DIALOGBOX_OFFSET_H - diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index 1de63e48d..c7c440693 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -51,12 +51,15 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_PositionDlg::TransformationGUI_PositionDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +TransformationGUI_PositionDlg::TransformationGUI_PositionDlg + (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) + : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POSITION"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POSITION2"))); - QPixmap imageselect(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_POSITION"))); + QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_POSITION2"))); + QPixmap imageselect(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT"))); setCaption(tr("GEOM_POSITION_TITLE")); @@ -135,7 +138,7 @@ void TransformationGUI_PositionDlg::Init() connect(Group1->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); initName( tr( "GEOM_POSITION" ) ); @@ -150,7 +153,7 @@ void TransformationGUI_PositionDlg::Init() //================================================================================= void TransformationGUI_PositionDlg::ConstructorsClicked(int constructorId) { - disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 ); + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); globalSelection(); myEditCurrentArgument = Group1->LineEdit1; @@ -176,13 +179,12 @@ void TransformationGUI_PositionDlg::ConstructorsClicked(int constructorId) break; } } - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SelectionIntoArgument(); } - //================================================================================= // function : ClickOnOk() // purpose : @@ -209,16 +211,6 @@ bool TransformationGUI_PositionDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_PositionDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection has changed @@ -330,22 +322,12 @@ void TransformationGUI_PositionDlg::SetEditCurrentArgument() void TransformationGUI_PositionDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); ConstructorsClicked( getConstructorId() ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_PositionDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : when mouse enter onto the QWidget diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.h b/src/TransformationGUI/TransformationGUI_PositionDlg.h index 2e5e499b4..0f064952d 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.h +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_PositionDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_POSITION_H #define DIALOGBOX_POSITION_H @@ -44,7 +43,8 @@ class TransformationGUI_PositionDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_PositionDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_PositionDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_PositionDlg(); protected: @@ -55,7 +55,7 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); @@ -65,12 +65,10 @@ private : DlgRef_3Sel3Spin1Check* Group1; -private slots : +private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index f373847d6..5cb4dc03f 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -49,8 +49,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_RotationDlg::TransformationGUI_RotationDlg(QWidget* parent, const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +TransformationGUI_RotationDlg::TransformationGUI_RotationDlg + (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ROTATION"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -101,7 +103,7 @@ TransformationGUI_RotationDlg::TransformationGUI_RotationDlg(QWidget* parent, c connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse())); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; setHelpFileName("rotation.htm"); @@ -161,16 +163,6 @@ bool TransformationGUI_RotationDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_RotationDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -256,7 +248,7 @@ void TransformationGUI_RotationDlg::LineEditReturnPressed() void TransformationGUI_RotationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); globalSelection(); GroupPoints->LineEdit1->setFocus(); @@ -266,16 +258,6 @@ void TransformationGUI_RotationDlg::ActivateThisDialog() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_RotationDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.h b/src/TransformationGUI/TransformationGUI_RotationDlg.h index 173ce35de..420a21bc9 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_RotationDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_ROTATION_H #define DIALOGBOX_ROTATION_H @@ -41,7 +40,8 @@ class TransformationGUI_RotationDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_RotationDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_RotationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_RotationDlg(); protected: @@ -52,7 +52,7 @@ protected: virtual void closeEvent( QCloseEvent* e ); -private : +private: void Init(); void enterEvent(QEvent* e); double GetAngle() const; @@ -65,9 +65,7 @@ private : private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 8a7313bc4..4256a3e58 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -49,8 +49,10 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(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) +TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(GeometryGUI* theGeometryGUI, QWidget* parent, + const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SCALE"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); @@ -101,10 +103,10 @@ TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(GeometryGUI* theGeometryG connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double))); connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; setHelpFileName("scale_transform.htm"); @@ -163,16 +165,6 @@ bool TransformationGUI_ScaleDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_ScaleDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -258,7 +250,7 @@ void TransformationGUI_ScaleDlg::SetEditCurrentArgument() void TransformationGUI_ScaleDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); globalSelection(); GroupPoints->LineEdit1->setFocus(); @@ -266,16 +258,6 @@ void TransformationGUI_ScaleDlg::ActivateThisDialog() } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_ScaleDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); -} - - //================================================================================= // function : enterEvent() // purpose : @@ -303,7 +285,7 @@ void TransformationGUI_ScaleDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.h b/src/TransformationGUI/TransformationGUI_ScaleDlg.h index 8f0e61c07..277de85e2 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.h +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_ScaleDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_SCALE_H #define DIALOGBOX_SCALE_H @@ -42,7 +41,8 @@ class TransformationGUI_ScaleDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_ScaleDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_ScaleDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_ScaleDlg(); protected: @@ -58,19 +58,15 @@ private : void enterEvent(QEvent* e); double GetFactor() const; - GeometryGUI* myGeometryGUI; - GEOM::ListOfGO myObjects; GEOM::GEOM_Object_var myPoint; /* Central Point */ DlgRef_2Sel1Spin2Check* GroupPoints; -private slots : +private slots: void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 2f41d5120..3e296be67 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -49,13 +49,16 @@ using namespace std; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg(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) +TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg + (GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { - QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TRANSLATION_DXYZ"))); - QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TRANSLATION_POINTS"))); - QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TRANSLATION_VECTOR"))); - QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); + SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_DXYZ"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_POINTS"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_VECTOR"))); + QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); setCaption(tr("GEOM_TRANSLATION_TITLE")); @@ -144,13 +147,13 @@ void TransformationGUI_TranslationDlg::Init() connect(GroupPoints->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); connect(GroupPoints->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox())); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox1, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox2, SLOT(SetStep(double))); - connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox3, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox1, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox2, SLOT(SetStep(double))); + connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox3, SLOT(SetStep(double))); connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool))); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; initName( tr( "GEOM_TRANSLATION" ) ); @@ -164,7 +167,7 @@ void TransformationGUI_TranslationDlg::Init() //================================================================================= void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId) { - disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 ); + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); myEditCurrentArgument = GroupPoints->LineEdit1; globalSelection(); @@ -202,7 +205,7 @@ void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId) } myEditCurrentArgument->setFocus(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); } @@ -233,16 +236,6 @@ bool TransformationGUI_TranslationDlg::ClickOnApply() } -//======================================================================= -// function : ClickOnCancel() -// purpose : -//======================================================================= -void TransformationGUI_TranslationDlg::ClickOnCancel() -{ - GEOMBase_Skeleton::ClickOnCancel(); -} - - //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection as changed or other case @@ -351,20 +344,10 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument() void TransformationGUI_TranslationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - ConstructorsClicked( getConstructorId() ); -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void TransformationGUI_TranslationDlg::DeactivateActiveDialog() -{ - GEOMBase_Skeleton::DeactivateActiveDialog(); + ConstructorsClicked( getConstructorId() ); } @@ -395,7 +378,7 @@ void TransformationGUI_TranslationDlg::ValueChangedInSpinBox() //================================================================================= GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation() { - return myGeometryGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() ); } diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index 069c33435..1d4008098 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -24,7 +24,6 @@ // File : TransformationGUI_TranslationDlg.h // Author : Lucien PIGNOLONI // Module : GEOM -// $Header$ #ifndef DIALOGBOX_TRANSLATION_H #define DIALOGBOX_TRANSLATION_H @@ -42,7 +41,8 @@ class TransformationGUI_TranslationDlg : public GEOMBase_Skeleton Q_OBJECT public: - TransformationGUI_TranslationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); + TransformationGUI_TranslationDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, + const char* name = 0, bool modal = FALSE, WFlags fl = 0); ~TransformationGUI_TranslationDlg(); protected: @@ -57,8 +57,6 @@ private : void Init(); void enterEvent(QEvent* e); - GeometryGUI* myGeometryGUI; - GEOM::GEOM_Object_var myVector, myPoint1, myPoint2; GEOM::ListOfGO myObjects; @@ -67,9 +65,7 @@ private : private slots : void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ActivateThisDialog(); - void DeactivateActiveDialog(); void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument();