#include "GenerationGUI_PrismDlg.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_SelectionMgr.h"
+
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <gp_Lin.hxx>
-#include "QAD_Config.h"
-#include "QAD_Desktop.h"
#include "GEOMImpl_Types.hxx"
+#include <qlabel.h>
#include <qcheckbox.h>
#include "utilities.h"
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+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)
{
- QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
+ QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_PRISM_TITLE"));
myOkBase = myOkVec = false;
/* Get setting of step value from file configuration */
- QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
- double step = St.toDouble();
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, +999.999, step, 3);
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeometryGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
initName(tr("GEOM_PRISM"));
erasePreview();
myEditCurrentArgument->setText("");
- if(mySelection->IObjectCount() != 1)
+ if(IObjectCount() != 1)
{
if(myEditCurrentArgument == GroupPoints->LineEdit1)
myOkBase = false;
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), testResult );
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if (!testResult)
return;
{
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
- connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
displayPreview();