// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : OperationGUI_ChamferDlg.cxx
// Author : Damien COQUERET
// Module : GEOM
-
// $Header$
#include "OperationGUI_ChamferDlg.h"
#include "DlgRef_SpinBox.h"
-#include "QAD_Desktop.h"
+
+#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "OCCViewer_ViewModel.h"
+
+#include <TColStd_MapOfInteger.hxx>
+
+#include <qlabel.h>
#include "qpixmap.h"
#include <list>
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-OperationGUI_ChamferDlg::OperationGUI_ChamferDlg( QWidget* parent, SALOME_Selection* Sel )
-: GEOMBase_Skeleton(parent, "ChamferDlg", Sel, 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)
{
-
- mySelection = Sel;
myConstructorId = -1;
- QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_ALL")));
- QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_EDGE")));
- QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_FACE")));
- QPixmap iconSelect(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_ALL")));
+ QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_EDGE")));
+ QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_FACE")));
+ QPixmap iconSelect(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption( tr( "GEOM_CHAMFER_TITLE" ) );
for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter )
anIter.data()->RangeStepAndValidator( 0.001, 999.999, SpecificStep, 3 );
+ setHelpFileName("chamfer.htm");
+
/* Initialisations */
- Init( mySelection );
+ Init();
}
// function : Init()
// purpose :
//=================================================================================
-void OperationGUI_ChamferDlg::Init( SALOME_Selection* Sel )
+void OperationGUI_ChamferDlg::Init()
{
- mySelection = Sel;
myConstructorId = -1;
reset();
RadioButton1->setChecked( true );
this, SLOT( ValueChangedInSpinBox( double ) ) );
// selection
- connect( mySelection, 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();
}
void OperationGUI_ChamferDlg::ConstructorsClicked( int constructorId )
{
// Activate next widget
- if ( QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC )
- {
+ if (myGeomGUI->getApp()->desktop()->activeWindow()->getViewManager()->getType()
+ != OCCViewer_Viewer::Type())
+ {
RadioButton1->setChecked( true );
return;
- }
-
- if ( myConstructorId == constructorId )
+ }
+
+ if (myConstructorId == constructorId)
return;
// Get values from previous widget
// If selection of main object is activated
if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 )
{
- if ( mySelection->IObjectCount() == 1 )
+ if ( IObjectCount() == 1 )
{
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() )
{
// If face selection of second tab is activated
else if ( aCurrFocus == Face1 || aCurrFocus == Face2 )
{
- if ( mySelection->IObjectCount() == 1 )
+ if ( IObjectCount() == 1 )
{
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() )
{
TColStd_IndexedMapOfInteger anIndexes;
- mySelection->GetIndex( mySelection->firstIObject(), anIndexes );
+ ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
if ( anIndexes.Extent() == 1 )
{
// If face selection of third tab is activated
else if ( aCurrFocus == Faces )
{
- if ( mySelection->IObjectCount() == 1 )
+ if ( IObjectCount() == 1 )
{
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() )
{
TColStd_IndexedMapOfInteger anIndexes;
- mySelection->GetIndex( mySelection->firstIObject(), anIndexes );
+ ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
if ( anIndexes.Extent() > 0 )
{
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void OperationGUI_ChamferDlg::DeactivateActiveDialog()
-{
- // disconnect selection
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect( mySelection, SIGNAL(currentSelectionChanged()),
- this, SLOT( SelectionIntoArgument() ) );
+ connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT( SelectionIntoArgument() ) );
activateSelection();
displayPreview();