using namespace std;
#include "RepairGUI_FreeFacesDlg.h"
-#include "QAD_Desktop.h"
-#include "QAD_WaitCursor.h"
+#include "SalomeApp_Application.h"
+#include "SalomeApp_SelectionMgr.h"
+#include "SalomeApp_Tools.h"
+#include "SUIT_Session.h"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "GEOMImpl_Types.hxx"
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TColStd_MapOfInteger.hxx>
#include <TopExp.hxx>
#include "GEOMBase.h"
#include "GeometryGUI.h"
#include "GEOM_Displayer.h"
-#include "SALOMEGUI_QtCatchCorbaException.hxx"
-#include "SALOME_Selection.h"
-#include "SALOME_Prs.h"
-
+#include <qapplication.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qlayout.h>
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg(QWidget* parent, const char* name, SALOME_Selection* theSelection, bool modal, WFlags fl)
+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 )
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
+ myGeomGUI( GUI )
{
myDisplayer = 0;
setSizeGripEnabled( TRUE );
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_FREE_FACES_TITLE"));
this, SLOT ( onSetEditCurrentArgument() ) );
/***************************************************************/
- Init( theSelection );
+ Init();
}
void RepairGUI_FreeFacesDlg::onClose()
{
globalSelection();
- disconnect( mySelection, 0, this, 0 );
- GeometryGUI::GetGeomGUI()->SetActiveDialogBox( 0 );
+ disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 );
+ myGeomGUI->SetActiveDialogBox( 0 );
reject();
erasePreview();
}
{
setEnabled(false);
globalSelection();
- disconnect( mySelection, 0, this, 0 );
- GeometryGUI::GetGeomGUI()->SetActiveDialogBox( 0 );
+ disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0 );
+ myGeomGUI->SetActiveDialogBox( 0 );
}
//=================================================================================
//=================================================================================
void RepairGUI_FreeFacesDlg::onActivate()
{
- GeometryGUI::GetGeomGUI()->EmitSignalDeactivateDialog();
+ myGeomGUI->EmitSignalDeactivateDialog();
setEnabled( true );
- GeometryGUI::GetGeomGUI()->SetActiveDialogBox( this );
- connect( mySelection, SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
+ myGeomGUI->SetActiveDialogBox( this );
+ connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
activateSelection();
}
// function : Init()
// purpose :
//=================================================================================
-void RepairGUI_FreeFacesDlg::Init(SALOME_Selection* theSel)
+void RepairGUI_FreeFacesDlg::Init()
{
myObj = GEOM::GEOM_Object::_nil();
- mySelection = theSel;
-
/* signals and slots connections */
- GeometryGUI* aGeomGUI = GeometryGUI::GetGeomGUI();
- connect( aGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT ( onDeactivate() ) );
- connect( mySelection, SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
+ connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT ( onDeactivate() ) );
+ connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), SLOT ( onSelectionDone() ) );
activateSelection();
onSelectionDone();
void RepairGUI_FreeFacesDlg::onSelectionDone()
{
erasePreview();
- if( mySelection->IObjectCount() != 1 )
+ if( IObjectCount() != 1 )
{
myEdit->setText( "" );
return;
Standard_Boolean isOk = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), isOk );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), isOk );
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) )
{
TopExp::MapShapes( aSelShape, anIndices);
SALOME_Prs* aPrs = 0;
- QAD_WaitCursor wc;
+ QApplication::setOverrideCursor( Qt::waitCursor );
for ( int i = 0, n = aFaceLst->length(); i < n; i++ )
{
}
catch( const SALOME::SALOME_Exception& e )
{
- QtCatchCorbaException( e );
+ SalomeApp_Tools::QtCatchCorbaException( e );
}
}
}
GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer();
+ myDisplayer = new GEOM_Displayer( getStudy() );
return myDisplayer;
}
onSelectionDone();
}
+//=================================================================================
+// function : getDesktop()
+// purpose :
+//=================================================================================
+SUIT_Desktop* RepairGUI_FreeFacesDlg::getDesktop() const
+{
+ return dynamic_cast<SUIT_Desktop*>( parentWidget() );
+}